L #6: L C C S L G: Sfsu - E 301 - E L AB Ogic Ircuit Haracteristics and Imple Ogic Ates
L #6: L C C S L G: Sfsu - E 301 - E L AB Ogic Ircuit Haracteristics and Imple Ogic Ates
L #6: L C C S L G: Sfsu - E 301 - E L AB Ogic Ircuit Haracteristics and Imple Ogic Ates
Objective:
To characterize BJT and CMOS inverters. To investigate simple logic gates. To compare measured and simulated logic circuits. 1 CD4007UB MOSFET Array, 1 2N2222A npn BJT, 4 1N4148 pn diodes, 1 0.1 F capacitor, and resistors: 1 1.0 k and 3 10 k (all 5%, W).
Components:
Instrumentation:
A bench power supply, a waveform generator (triangle/square wave), a digital voltmeter (DVM), and a dual-trace oscilloscope.
instrument pickups are suitably amplified and conditioned via analog circuitry. They are then converted to digital form via analog-to-digital (A/D) converter circuits, whence they are manipulated via suitable digital signal processing (DSP) circuitry for mixing as well as the creation of special effects, and finally burned into a CD for storage, transportation, and sale. At the users end, suitable digital-to-analog (D/A) circuitry converts the CDs digital data back to analog form, for further amplification by power amplifiers and finally for the conversion back to sound waves via the loudspeakers. Todays tendency is thus as follows: Perform as many functions as possible in digital form, keeping in mind that nature presents itself predominantly in analog form, so that the electronic interface between real world and digital systems is analog.
Noise Margins:
As a signal produced by a transmitting gate travels down a wire, it picks up various forms of noise, so by the time it reaches a receiving gate it may be appreciably contaminated. The question arises as to how much noise can be tolerated at the receiving end and still allow for the signal to be interpreted correctly there. A logic familys ability to function correctly in noisy environments is measured via its noise margins. As shown in Fig. 2(a), an inverter is powered between VS (typically 5 V) and ground. Circuit behavior is best visualized via the voltage transfer curve (VTC), representing the plot of vO versus vI. Figure 2(b) shows the idealized VTC. For vI < 0.5VS the circuit gives vO = VS (= VOH), and for vI > 0.5VS it gives vO = 0 V (= VOL). The VTC of a practical inverter will generally depart from this idealized shape,
(a )
(b)
(c)
Fig. 1 Circuit symbols and truth tables for the basic logic gates: (a) the Inverter, (b) the NAND
gate, and (c) the NOR gate.
2002 Sergio Franco Engr 301 Lab #6 Page 2 of 11
(a )
(b)
(c)
Fig. 2 (a) Logic inverter. (b) Idealized VTC, and (c) practical VTC.
and will look more like that of Fig. 2(c). Here we observe that as long as vI is sufficiently low (near 0V), the inverter gives vO = VOH (note that VOH is not necessarily VS); as long as vI is sufficiently high (near VS), the inverter gives vO = VOL (note that VOL is not necessarily 0 V). The departure of a practical VTC from the ideal is specified in terms of the noise margins, defined as NML = VIL VOL NMH = VOH VIH (1a) (1b)
where VIL and VIH are the values of vI corresponding to the points of the VTC where slope is 1 V/V. Physically, the noise margins represent the maximum amount of noise that can be tolerated on a line going from the output of a transmitting gate to the input of a receiving gate. As illustrated further in Fig. 3, any noise in excess of this margin will be amplified by the receiving gate by more than unity, potentially leading to erroneous circuit behavior. Clearly, the higher the noise margins, the better. For the idealized VTC of Fig. 2(b) we have NML = NMH = 0.5VS (= 2.5 V for VS = 5 V). VTCs are readily visualized with a dual-trace oscilloscope operated in the x-y mode, or via
1k
10k Q2N2222
0
Fig. 4 BJT inverter and its VTC.
PSpice using a DC Sweep. Figure 4 shows a PSpice inverter based on the familiar 2N2222 BJT, along with its VTC. This circuit has been simulated using the 2N2222 model available in PSpicess library. As we know from Lab #4, the input sweep carries the BJT from the cutoff (CO) region, to the edge of conduction (EOC), through the forward-active (FA) region, to the edge of saturation (EOS), and thence into deep saturation (Sat). One can use simple graphical techniques to identify the points where slope is 1 V/V, and then determine VIL and VIH. Moreover, one can use the cursor to find the values of VOL and VOH, and thus calculate the noise margins via Eq. (1). Figure 5 shows a PSpice inverter of the CMOS type, along with its VTC. This circuit has been simulated using two homebrew MOSFETs, called respectively 301pMOSFET and 301nMOSFET. Both devices have been created by renaming and suitably editing the PSpice Models of two MOSFETs available in the PSpice Library. This has been done first by clicking the device to select it, then by clicking Edit PSpice Model to change the values of its parameters. Following are the model statements for the two devices: .model 301pMOSFET .model 301nMOSFET PMOS(W=20u L=5u kp=20u Vto=-1.75 lambda=0.08) NMOS(W=10u L=5u kp=50u Vto=1.5 lambda=0.05)
As shown on the VTC itself, the input sweep carries the two MOSFETs, denoted respectively as Mp and Mn, thorough the regions indicated, where CO indicates the cutoff region, the ohmic region, and PO the pinch-off region. Again, from the VTC one can readily find the noise margins using simple graphical technique. You can simulate both inverters by downloading their appropriate files from the Web. To this end, go to http://online.sfsu.edu/~sfranco/CoursesAndLabs/Labs/301Labs.html, and once there, click on PSpice Examples. Then, follow the instructions contained in the Readme file.
2002 Sergio Franco Engr 301 Lab #6 Page 4 of 11
5Vdc
vO
V
Propagation Delays:
An inverters response to a sharp-edged input pulse is not instantaneous, as the circuit takes a certain amount of time to swing its output from one level to the other (see Fig. 6). The speed of response is characterized in terms of the propagation delays tPLH and tPHL. The amount of time, following the leading edge vI, that it takes for vO to swing from VOH down to the transitions midpoint, defined as V50% = VOL + VOH 2 (2)
is denoted as tPHL. Likewise, the amount of time, following the trailing edge of vI , that it takes for vO to swing from VOL up to V50% is denoted as tPLH. The two delays are not necessarily identical, so their average
tP =
t PLH + t PHL 2
(3)
is aptly called the average propagation delay. Figure 7 shows the pulse response of the basic BJT inverter. One can readily measure the propagation delays using the cursor facility of PSpice. The results are tPHL 75 ns and tPLH 630 ns. These delays stem from the fact that it takes time to build up/remove charge in the junction capacitances of the BJT as well as the excess minority charge inside the base region. These functions are performed by the base current. During tPHL the base current is IBF (5 0.7)/10 = 0.43 mA, and it flows into the BJT to buildup charge. During tPLH the base current is IBR (0 0.7)/10 = 0.07 mA, the minus sign indicating that IBR flows out of the BJT, thus removing the charge built up by IBF. The asymmetry in the values of tPHL and tPLH stems in part from the different magnitudes of IBF and IBR. A particularly undesirable component of tPLH is the storage time tS, representing the amount of time it takes for IBR to remove the charge stored the base of the BJT when it was driven past the EOS, into deep saturation. It can be proved that the storage time can be calculated as tS = S ln I BF I BR I B (EOS) I BR (4)
where S is a characteristic parameter of the BJT called the saturation time constant, in ns, and IB(EOS) is the base current needed to bring the BJT to the edge of saturation, or IB(EOS) = IC(EOS)/F. For our circuit, IC(EOS) (5 0.2)/1 = 4.8 mA. Using the cursor facility of PSpice, we readily find tS 430 ns. In the case of CMOS gates there are no charge storage effects. However, there are still parasitic capacitances internal to the MOSFETs that need to be charged/discharged, thus causing nonzero propagation delays. A convenient way to find average propagation delays experimentally is to connect an odd number n of inverters in ring fashion, as depicted in Fig. 8 for the case n = 3. It is readily seen that the counters period of oscillation is T = 2ntP or T = 6tP in our example. One can thus measure T with the oscilloscope, and then divide by 6 to find the experimental value of tP.
1k vO
10k
Q2N2222
0
Fig. 7 Basic BJT inverter and its pulse response.
BJT Inverter:
The basic inverter of Fig. 4, though useful to illustrate how a BJT performs the logic function of inversion, is inadequate from a practical standpoint as it offers poor NML and excessively long storage. It is also susceptible to loading when connected to similar gates, indicating a drop in the value of VOH and, hence, a reduction in NMH. The improved inverter of Fig. 10a is of the so-called DTL (Diode-Transistor Logic) type, a precursor of the more popular TTL (Transistor-Transistor Logic) type. The function of D1 and D2 is to shift the VTC toward the right and thus improve NML, while that of R3 to help shut off the BJT during the storage time. Moreover, the base drive network has been redesigned so that with DA
Fig. 9 Pin configuration for the 2N2222 npn BJT and the CD4007UB CMOS Array.
2002 Sergio Franco Engr 301 Lab #6 Page 7 of 11
reverse biased it will not load a similar gate upstream. PSC1: Use PSpice to display the VTC of the BJT inverter of Fig. 10 (for the diodes and the BJT, use the models available in PSpices library.) Hence, use graphical techniques to determine its noise margins. PSC2: Use PSpice to display the pulse response of the BJT inverter of Fig. 10, in the manner of Fig. 7. Hence, use the cursor facility of PSpice to find its propagation delays. MC3: With power off, assemble the circuit of Fig. 10. Hence, apply power, display its VTC on the oscilloscope, and determine its noise margins graphically. Finally, compare with your findings of Step PSC1, and account for possible differences. Note: To observe the VTC experimentally, first adjust the waveform generator so that vI is a 100-Hz triangular wave alternating between 0 V and 5 V (make your adjustments using Ch. 1 of the oscilloscope, DC Mode, Trigger from Ch. 1). Next, switch the oscilloscope to the x-y Mode, set both channels to 1 V/div, DC, and adjust the offsets so that the origin of the x-y display (dot) is at the lower left corner of the screen. Finally, feed vI to the x-axis and vO to the y-axis. M4: In the circuit of Fig. 10 adjust the waveform generator so that vI is a 250-kHz pulse train
alternating between 0 V and 5 V (make your adjustments using Ch. 1 of the oscilloscope, DC Mode, Trigger from Ch. 1). Hence, while monitoring vO with Ch. 2 (1 V/div, DC), determine the propagation delays. How do they compare with those of Step PSC2? (For optimum visualization, you may need to vary the frequency from the suggested initial value of 200 kHz.)
(a ) Fig. 12 CMOS inverters: (a) basic type, and (b) buffered type.
2002 Sergio Franco
(b )
output of the rightmost inverter back to the input of the leftmost one, to turn the circuit into a ring counter with n = 3, as shown in Fig. 13. Apply power, measure the period T of oscillation with the oscilloscope, and obtain the average propagation delay as tP = T/6. How does it compare with that of the BJT inverter of Step M4, given that there are no charge storage effects in MOSFETs? CMOS Logic Gates: M10: With power off, assemble the circuit of Fig. 14. Apply power, and while monitoring Y with the DVM, record in the adjoining table the values of Y (H or L) as well as the states ( or CO) of the
MOSFETs for each of the four input combinations shown (L = 0 V, H = 5 V). What logic function does your gate provide? M11: Repeat Step M10, but for the CMOS gate of Fig. 15.