Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Part F:
- Write, compile and execute a C program with appropriate comments included that
- calculates parameters of a common-emitter audio amplifier
- The specified parameters:
- Vc= 6.5 (v)
- Ve= 1.3 (v)
- Ic = 3*10
- -3
- (A)
- Hfe= 100
- Parameter to be calculated:
- R1, R2, R3, R4 and Vout
- Explanation
- To write this program you do not need to know all aspects of the audio amplifier design.
- As a programmer, you just need to understand the application area, the application
- constraints and the algorithm employed for producing results.
- The first step is to identify:
- input data
- output data
- a sequence of operation to produce the output data
- The program input dataare: Vcc, Vc, Ve, Vin, Ic and Hfe
- The input parameter that the program prompts the user to enter are:
- Vin, which can be any value in the range 0.01 – 0.05 (v)
- Vcc, which can be 9.0, 10.0, or 12.0(v)
- In this assignment it is assumed that Vin and Vcc are entered correctly by the user. Other
- input parameters Ic, Vc, Ve, and Hfe must be defined as constants.
- The output dataare values of: R1, R2, R3, R4 and Vout
- The algorithm to calculate R1, R2, R3, R4 and Vout is a simple sequence of operations:
- 1. Calculate the base current: Ib= Ic/Hfe ( A )
- 2. Calculate R1 = (Vcc–Vc)/ Ic ( ohm )
- 3. Calculate R2 = Ve/ (Ic+ Ib)( ohm )
- 4. Calculate Vb= Ve+ 0.7( v )
- 5. Calculate R4 = Vb/ ( 5 * Ib)( ohm )
- 6. Calculate R3 = (Vcc– Vb)/( 6 * Ib)( ohm )
- 7. Calculate Signal Amplification
- Ks= R1/R2
- 8. Calculate Output signal
- Vout= Vin* Ks ( v )
- ,which you need to implement in your C program.
- The application constraints:
- - All calculation must be carried out with floatprecision.
- - The calculated values of R1, R2, R3 and R4 must be displayed as integer numbers.
- - Vout must be displayed with one decimal points precision.
- - Output must be properly aligned in columns (see the example below).
- Regardless what the compiler you have used working on this assignment, make sure that
- your program can be compiled by gccusing the following command:
- gcc –o main.exe –Wall -ansi main.c
- and produces main(executable file).
- Having been run, your program should produce output formatted as shown below :
- Enter Vin: 0.02
- Enter Vcc: 10
- ====================
- Resistors:
- R1 = 1624 ohm
- R2 = 272 ohm
- R3 = 42500 ohm
- R4 = 9000 ohm
- Output voltage:
- Vout = 0.5 v
Advertisement
Add Comment
Please, Sign In to add comment