deadlyhunter88

computor assignment

Apr 2nd, 2013
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.35 KB | None | 0 0
  1. Part F:
  2. Write, compile and execute a C program with appropriate comments included that
  3. calculates parameters of a common-emitter audio amplifier
  4.  
  5. The specified parameters:
  6. Vc= 6.5 (v)
  7. Ve= 1.3 (v)
  8. Ic = 3*10
  9. -3
  10. (A)
  11. Hfe= 100
  12. Parameter to be calculated:
  13. R1, R2, R3, R4 and Vout
  14. Explanation
  15. To write this program you do not need to know all aspects of the audio amplifier design.
  16. As a programmer, you just need to understand the application area, the application
  17. constraints and the algorithm employed for producing results.
  18. The first step is to identify:
  19.   input data
  20.   output data
  21.   a sequence of operation to produce the output data
  22. The program input dataare: Vcc, Vc, Ve, Vin, Ic and Hfe
  23. The input parameter that the program prompts the user to enter are:
  24.   Vin, which can be any value in the range 0.01 – 0.05 (v)
  25.   Vcc, which can be 9.0, 10.0, or 12.0(v)
  26. In this assignment it is assumed that Vin and Vcc are entered correctly by the user. Other
  27. input parameters Ic, Vc, Ve, and Hfe must be defined as constants.
  28. The output dataare values of: R1, R2, R3, R4 and Vout
  29. The algorithm to calculate R1, R2, R3, R4 and Vout is a simple sequence of operations:
  30. 1. Calculate the base current: Ib= Ic/Hfe  ( A )
  31. 2. Calculate R1 = (Vcc–Vc)/ Ic  ( ohm )
  32. 3. Calculate R2 = Ve/ (Ic+ Ib)( ohm )
  33. 4. Calculate Vb= Ve+ 0.7( v )
  34. 5. Calculate R4 = Vb/ ( 5 * Ib)( ohm )
  35. 6. Calculate R3 = (Vcc– Vb)/( 6 * Ib)( ohm )
  36. 7. Calculate Signal Amplification
  37. Ks= R1/R2
  38. 8. Calculate Output signal
  39. Vout= Vin* Ks   ( v )
  40. ,which you need to implement in your C program.
  41. The application constraints:
  42. - All calculation must be carried out with floatprecision.
  43. - The calculated values of R1, R2, R3 and R4 must be displayed as integer numbers.
  44. - Vout must be displayed with one decimal points precision.
  45. - Output must be properly aligned in columns (see the example below).
  46. Regardless what the compiler you have used working on this assignment, make sure that
  47. your program can be compiled by gccusing the following command:
  48. gcc –o main.exe –Wall -ansi main.c
  49. and produces main(executable file).
  50. Having been run, your program should produce output formatted as shown below :
  51. Enter Vin: 0.02
  52. Enter Vcc: 10
  53. ====================
  54. Resistors:
  55. R1 = 1624 ohm
  56. R2 = 272 ohm
  57. R3 = 42500 ohm
  58. R4 =  9000 ohm
  59. Output voltage:
  60. Vout =  0.5 v
Advertisement
Add Comment
Please, Sign In to add comment