Chapter 4: Comparators and Controls

Example 4.1 Page No 88

In [1]:
#Given
Vsat = 14.0         #Saturation Voltage
R1 = 1000.0 
R2 = 100.0            #Load resistances

#Calculation
Vut = (R2/(R1*R2))*Vsat

#Result
print" Value of Upper Threshold Voltage =  ",Vut*1000,"mV"
 Value of Upper Threshold Voltage =   14.0 mV

Example 4.2 Page No 88

In [2]:
#Given
Vsat = -13.0        #Saturation Voltage
R1 = 1000.0
R2 = 100.0          #Load resistances

#Calculation
Vlt = (R2/(R1*R2))*Vsat

#Result
print" Value of Lower Threshold Voltage = ",Vlt*1000,"mV"
 Value of Lower Threshold Voltage =  -13.0 mV

Example 4.4 Page No 94

In [3]:
#Given
Vut = 12.0
Vlt = 8.0            #Upper and Lower Threshold Voltages 
Vsatp = 15.0
Vsatm = -15.0        # Saturation Voltages
R = 10*10**3         #Choosing R

#Calculation
Vh = Vut - Vlt          # Hysteresis Voltage 
Vctr = (Vut + Vlt)/2.0  #Center Voltage
n = (Vsatp - Vsatm)/Vh  # Resistor Factor
Vref = Vctr / (1 + (1/n)) #Reference Voltage
Resistance = n * R

#Result
print" Center Voltage = ", Vctr ,"V"
print" Resistor Factor =  " , n 
print" Reference Voltage =  ", round(Vref,2)
print" Feedback resistor is ", Resistance
 Center Voltage =  10.0 V
 Resistor Factor =   7.5
 Reference Voltage =   8.82
 Feedback resistor is  75000.0

Example 4.5 Page No 95

In [5]:
#Given
Vsatp = 15.0
Vsatm = -15.0     # Saturation Voltages
Vh = 4.0          #Hysteresis Voltage
Vctr = 10.0       #Center voltage

#Calculation
n = ((Vsatp - Vsatm)/Vh)-1 
R = 10*10**3    #Input Resistance
Vref = ((n + 1)*(Vctr))/n  # Reference Voltage
Resistance = n * R # Feedback Resistance

#Result
print"  Resistance Factor = ", n
print"  Reference Voltage = ", round(Vref,2),"V"
print"  Feedback Resistance = ", Resistance/1000,"kohm"
  Resistance Factor =  6.5
  Reference Voltage =  11.54 V
  Feedback Resistance =  65.0 kohm

Example 4.6 Page No 98

In [6]:
#Given
Vut = 13.5
Vlt = 10.5      #Upper and Lower Threshold Voltages
Vref = -15      # Reference Voltage
Vsatp = 13.0
Vsatm = -13.0   #Saturation Voltages 
R = 10*10**3    # Input Resistance

#Calculation
Vctr = (Vut + Vlt)/2.0
Vh = Vut - Vlt 
m = -(Vref / Vctr)
Resistance = m * R 
n = (Vsatp-Vsatm)/Vh 
Resistance1 = n * R 

#Result
print"  Hysteresis Voltage = ", Vh 
print"  Center Voltage =  ", Vctr 
print"  Resistor mR = ", Resistance/1000,"kohm"
print"  Resistor nR = ", round(Resistance1/1000,2),"kohm"
  Hysteresis Voltage =  3.0
  Center Voltage =   12.0
  Resistor mR =  12.5 kohm
  Resistor nR =  86.67 kohm