Advertisement
solielios

פייתון ניסויים

Jan 29th, 2025
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.16 KB | None | 0 0
  1. CMOS
  2. ```import math
  3.  
  4. R2 = 10**3 * (float(input("Enter R2 (kOhms): ‎‎")))
  5. C1 = 10**-6 * (float(input("Enter C1 (uFarads): ‎‎")))
  6. VCC = int(input("Enter VCC: "))
  7.  
  8. ton = math.log(3)*R2*C1‎
  9. toff = ton
  10. f = 1 / (ton+toff)
  11. dc = (ton / (ton+toff)) * 100
  12. vmax = VCC
  13. vmin = 0
  14.  
  15. print(f"Ton = Toff = {ton * 1000:.4f} msec")
  16. print(f"F = {f:.4f} Hz, D.C. = {dc}%")
  17. print(f"Vmax = {vmax}V, Vmin = {vmin}V")
  18. ```
  19.  
  20. מקור זרם
  21. ```RL = float(input("Enter RL (Ohms): "))
  22.  
  23. Beta = 200
  24. VCEsat = 0.3
  25. R3, R4, R1 = 4700, 4700, 1000
  26. VCC, VEE = 15, -15
  27.  
  28. VE = (VCC * R4) / (R3 + R4)
  29. IE = VE / R1‎
  30. IB = IE / (Beta + 1)
  31. IC = Beta * IB
  32. VL = VCC - (IC * RL)
  33.  
  34. if VL > VE + VCEsat:‎
  35. ‎    print("Transistor in active area")
  36. ‎    IL = IC  # ‎זרם העומס שווה ל‎-IC ‎באזור הפעיל
  37. else:‎
  38. ‎    print("Transistor in sat. area")
  39. ‎    IL = (VCC - VCEsat) / RL  # ‎חישוב זרם העומס ברוויה
  40.  
  41. print(f"VE = {VE:.2f} V")
  42. print(f"IB = {IB * 1e6:.2f} µA")
  43. print(f"IC = {IC * 1e3:.2f} mA")
  44. print(f"VL = {VL:.2f} V")
  45. print(f"IL = {IL * 1e3:.2f} mA")
  46. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement