Advertisement
Guest User

Untitled

a guest
Dec 13th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.07 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. void main() ;
  4. {
  5. double B, Re, R1, R2, Vcc, Vb, Ve, Ie,Icq, Vceq, Rc, Isat;
  6. cout<<"B=" ;
  7. cin>>B;
  8. cout<<endl;
  9. cout<<"Re=" ;
  10. cin>>Re;
  11. cout<<endl;
  12. cout<<"R1=" ;
  13. cin>>R1;
  14. cout<<endl;
  15. cout<<"R2=" ;
  16. cin>>R2;
  17. cout<<endl;
  18. cout<<"Vcc=" ;
  19. cin>>Vcc;
  20. cout<<endl;
  21. if(B*Re>=10*R2)
  22. {Vb=Vcc*(R2/(R1+R2));
  23. cout<<"Vb="<<Vb<<endl;
  24. }
  25. else
  26. {double Rr=(B*Re*R2) /(B*Re+R2) ;
  27. Vb=Vcc*(Rr/(Rr+R1)) ;
  28. cout<<"Vb=" <<Vb<<endl;
  29. }
  30. Ve=Vb-0.7
  31. cout<<"Ve="<<Ve<<endl;
  32. Ie=Ve/Re;
  33. cout<<"Ie=" <<Ie<<endl;
  34. Icq=Ie;
  35. cout<<"Icq=" <<Icq<<endl;
  36. Vceq=Vcc-Icq*(Rc+Re) ;
  37. cout<<"Vceq=" <<Vceq<<endl;
  38. Isat=Vcc/(Rc+Re) ;
  39. cout<<"Isat=" <<Isat<<endl;
  40. if(Icq>Isat/2)
  41. {cout<<"Q_point is towards SAT" <<endl;
  42. if (Icq>(3/4) * Isat)
  43. cout<<"Q_point is closer to SAT" <<endl;
  44. else
  45. cout<<"Q_point is closer to MID" <<endl;
  46. }
  47. else if (Icq=Isat/2)
  48. cout<<"Q_point is MID" <<endl;
  49. else
  50. {cout<<"Q_point is towards Cutoff" <<endl;
  51. if (Icq>(1/4) * Isat)
  52. cout<<"Q_point is closer to MID" <<endl;
  53. else
  54. cout<<"Q_point is closer to cutoff" <<endl;
  55. }
  56. system ("pause") ;
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement