1 Electronic Instrumentation Experiment 10 Analog vs Digital

  • Slides: 44
Download presentation
1 Electronic Instrumentation Experiment 10 • Analog vs. Digital Circuits • Comparators and Schmitt

1 Electronic Instrumentation Experiment 10 • Analog vs. Digital Circuits • Comparators and Schmitt Triggers Combinational Logic Devices Sequential Logic Devices Bipolar Junction Transistors Inside the 555 Timer • •

Analog Circuits vs. Digital Circuits w An analog signal is an electric signal whose

Analog Circuits vs. Digital Circuits w An analog signal is an electric signal whose value varies continuously over time. w A digital signal can take on only finite values as the input varies over time. 12 April 2004 Electronic Instrumentation 2

 • A binary signal, the most common digital signal, is a signal that

• A binary signal, the most common digital signal, is a signal that can take only one of two discrete values and is therefore characterized by transitions between two states. • In binary arithmetic, the two discrete values f 1 and f 0 are represented by the numbers 1 and 0, respectively. 12 April 2004 Electronic Instrumentation 3

 • In binary voltage waveforms, these values are represented by two voltage levels.

• In binary voltage waveforms, these values are represented by two voltage levels. • In TTL convention, these values are nominally 5 V and 0 V, respectively. • Note that in a binary waveform, knowledge of the transition between one state and another is equivalent to knowledge of the state. Thus, digital logic circuits can operate by detecting transitions between voltage levels. The transitions are called edges and can be positive (f 0 to f 1) or negative (f 1 to f 0). 12 April 2004 Electronic Instrumentation 4

Comparators and Schmitt Triggers • In this section we will use op-amps to create

Comparators and Schmitt Triggers • In this section we will use op-amps to create binary signals. • Comparators are the simplest way to create a binary signal with an op amp. They take advantage of the very high gain of the chip to force it to saturate either high (VS+) or low (VS-) creating two (binary) states. • Schmitt Triggers are a modified version of a comparator which uses a voltage divider to improve the performance of the comparator in the presence of noise. 12 April 2004 Electronic Instrumentation 5

w Op-Amp Comparator • The prototype of op-amp switching circuits is the op-amp comparator.

w Op-Amp Comparator • The prototype of op-amp switching circuits is the op-amp comparator. • The circuit does not employ feedback. 12 April 2004 Electronic Instrumentation 6

 • Because of the large gain that characterizes openloop performance of the op-amp

• Because of the large gain that characterizes openloop performance of the op-amp (A > 105), any small difference between the input voltages will cause large outputs; the op-amp will go into saturation at either extreme, according the voltage supply values and the polarity of the voltage difference. • One can take advantage of this property to generate switching waveforms. • Consider the following. Non-inverting Op-Amp Comparator 12 April 2004 Electronic Instrumentation 7

 • The comparator is perhaps the simplest form of an analog-to-digital converter, i.

• The comparator is perhaps the simplest form of an analog-to-digital converter, i. e. , a circuit that converts a continuous waveform to discrete values. The comparator output consists of only two discrete levels. Input and Output of Non-Inverting Comparator Vsat = ± 13. 5 volts V = 1 volt 12 April 2004 Electronic Instrumentation 8

 • It is possible to construct an inverting comparator by connecting the non-inverting

• It is possible to construct an inverting comparator by connecting the non-inverting terminal to ground and connecting the input to the inverting terminal. Input and Output of Inverting Comparator 12 April 2004 Electronic Instrumentation 9

 • Comparator with Offset • A simple modification of the comparator circuit consists

• Comparator with Offset • A simple modification of the comparator circuit consists of connecting a fixed reference voltage to one of the input terminals; the effect of the reference voltage is to raise or lower the voltage level at which the comparator will switch from one extreme to the other. 12 April 2004 Electronic Instrumentation 10

 • Below is the waveform of a comparator with a reference voltage of

• Below is the waveform of a comparator with a reference voltage of 0. 6 V and an input voltage of sin(ωt). • Note that the comparator output is no longer a symmetric square wave. 12 April 2004 Electronic Instrumentation 11

 • Another useful interpretation of the op-amp comparator can be obtained by considering

• Another useful interpretation of the op-amp comparator can be obtained by considering its input-output transfer characteristic. Non-Inverting Zero-Reference (no offset) Comparator often called a zero-crossing comparator 12 April 2004 Electronic Instrumentation 12

 • Shown below is the transfer characteristic for a comparator of the inverting

• Shown below is the transfer characteristic for a comparator of the inverting type with a nonzero reference voltage. 12 April 2004 Electronic Instrumentation 13

Comparator Response to Noisy Inputs Note how the output swings between high and low.

Comparator Response to Noisy Inputs Note how the output swings between high and low. 12 April 2004 Electronic Instrumentation 14

w Schmitt Trigger • One very effective way of improving the performance of the

w Schmitt Trigger • One very effective way of improving the performance of the comparator is by introducing positive feedback. Positive feedback can increase the switching speed of the comparator and provide noise immunity at the same time. • The voltage range over which the signal does not switch is called the hysteresis (In this case, h=2 d) Can you explain how this works? 12 April 2004 Electronic Instrumentation 15

 • In effect, the Schmitt trigger provides a noise rejection range equal to

• In effect, the Schmitt trigger provides a noise rejection range equal to ± Vsat [R 2 / (R 2 + R 1)] within which the comparator cannot switch. • Thus if the noise amplitude is contained within this range, the Schmitt trigger will prevent multiple triggering. 12 April 2004 Electronic Instrumentation 16

 • If it is desired to switch about a voltage other than zero,

• If it is desired to switch about a voltage other than zero, a reference voltage can also be connected to the non-inverting terminal. In this case, d+ is not equal to d-, and the hysteresis is given by h=d+ + d. Switching levels for the Schmitt Trigger are: positive-going transition negative-going transition 12 April 2004 Electronic Instrumentation 17

Combinational Logic Devices Logic Gates perform basic logic operations, such as AND, OR and

Combinational Logic Devices Logic Gates perform basic logic operations, such as AND, OR and NOT, on binary signals. w In this class, we use them as black boxes. This means that we do not worry about how these chips are built inside, but only about what output they produce for all possible inputs. w In order to show this behavior, we use truth tables, which show the output for all input combinations. w The outputs of combinational logic gates depend only on the instantaneous values of the inputs. w 12 April 2004 Electronic Instrumentation 18

Logic Gates 12 April 2004 Electronic Instrumentation 19

Logic Gates 12 April 2004 Electronic Instrumentation 19

Logic Gate Example: XOR Input A 0 0 1 1 Input B 0 1

Logic Gate Example: XOR Input A 0 0 1 1 Input B 0 1 12 April 2004 Output X 0 1 1 0 Question: What common household switch configuration corresponds to an XOR? Electronic Instrumentation 20

Boolean Algebra • The variables in a boolean, or logic, expression can take only

Boolean Algebra • The variables in a boolean, or logic, expression can take only one of two values, 0 (false) and 1 (true). • We can also use logical mathematical expressions to analyze binary operations, as well. 12 April 2004 Electronic Instrumentation 21

 • The basis of boolean algebra lies in the operations of logical addition,

• The basis of boolean algebra lies in the operations of logical addition, or the OR operation, and logical multiplication, or the AND operation. • OR Gate • If either X or Y is true (1), then Z is true (1) • AND Gate • If both X and Y are true (1), then Z is true (1) • Logic gates can have an arbitrary number of inputs. • Note the similarities to the behavior of the mathematical operators plus and times. 12 April 2004 Electronic Instrumentation 22

Laws of Boolean Algebra 12 April 2004 Electronic Instrumentation 23

Laws of Boolean Algebra 12 April 2004 Electronic Instrumentation 23

De. Morgan’s Laws 12 April 2004 Electronic Instrumentation 24

De. Morgan’s Laws 12 April 2004 Electronic Instrumentation 24

Using De. Morgan’s Laws Important Principal based on De. Morgan’s Laws: Any logic function

Using De. Morgan’s Laws Important Principal based on De. Morgan’s Laws: Any logic function can be implemented by using only OR and NOT gates, or only AND and NOT gates. 12 April 2004 Electronic Instrumentation 25

Sequential Logic Devices In a sequential logic device, the timing or sequencing of the

Sequential Logic Devices In a sequential logic device, the timing or sequencing of the input signals is important. Devices in this class include flip-flops and counters. w Positive edge-triggered devices respond to a low-tohigh (0 to 1) transition, and negative edge-triggered devices respond to a high-to-low (1 to 0) transition. w 12 April 2004 Electronic Instrumentation 26

Flip-Flops • A flip-flop is a sequential device that can store and switch betw

Flip-Flops • A flip-flop is a sequential device that can store and switch betw • It is called a bistable device since it has two and only two possi • It has the capability of remaining in a particular state (i. e. , stori 12 April 2004 Electronic Instrumentation 27

Simple Flip Flop Example: The RS Flip-Flop Q=0 Q=1 12 April 2004 Note that

Simple Flip Flop Example: The RS Flip-Flop Q=0 Q=1 12 April 2004 Note that the output depends on three things: the two inputs and the previous state of the output. Electronic Instrumentation 28

Inside the R-S Flip Flop Note that the enable signal is the clock, which

Inside the R-S Flip Flop Note that the enable signal is the clock, which regularly pulses. This flip flop changes on the rising edge of the clock. It looks at the two inputs when the clock goes up and sets the outputs according to the truth table for the device. 12 April 2004 Electronic Instrumentation 29

Inside the J-K Flip Flop Note this flip flop, although structurally more complicated, behaves

Inside the J-K Flip Flop Note this flip flop, although structurally more complicated, behaves almost identically to the R-S flip flop, where J(ump) is like S(et) and K(ill) is like R(eset). The major difference is that the J-K flip flop allows both inputs to be high. In this case, the output switches state or “toggles”. 12 April 2004 Electronic Instrumentation 30

Binary Counters w w Binary Counters do exactly what it sounds like they should.

Binary Counters w w Binary Counters do exactly what it sounds like they should. They c Binary numbers are comprised of only 0’s and 1’s. Decimal QD QC QB QA 0 1 2 3 4 5 0 0 1 1 0 0 0 1 0 1 0 0 0 12 April 2004 Electronic Instrumentation 31

Binary – Decimal -- Hexadecimal Conversion 101101011100010110011110110 11 B 5 5 12 C 5

Binary – Decimal -- Hexadecimal Conversion 101101011100010110011110110 11 B 5 5 12 C 5 9 5 12 9 B 5 C 59 CF 6 15 C F 6 binary number equivalent base 10 value for each group of 4 consecutive binary digits (bits) 6 corresponding hexadecimal (base 16) digit equivalent hexadecimal number Decimal 8 = 1 x 23 + 0 x 22 + 0 x 21 +0 x 20 = 01000 in Binary Calculator Applet 12 April 2004 Electronic Instrumentation 32

Binary Counters are made with Flip Flops Each flip flop corresponds to one bit

Binary Counters are made with Flip Flops Each flip flop corresponds to one bit in the counter. Hence, this is a four-bit counter. 12 April 2004 Electronic Instrumentation 33

Typical Output for Binary Counter w Note how the Q outputs form 4 bit

Typical Output for Binary Counter w Note how the Q outputs form 4 bit numbers 12 April 2004 Electronic Instrumentation 34

Bipolar Junction Transistors w w The bipolar junction transistor (BJT) is the salient invention

Bipolar Junction Transistors w w The bipolar junction transistor (BJT) is the salient invention that led to the electronic age, integrated circuits, and ultimately the entire digital world. The transistor is the principal active device in electrical circuits. When inputs are kept relatively small, the transistor serves as an amplifier. When the transistor is overdriven, it acts as a switch, a mode most useful in digital electronics. 12 April 2004 Electronic Instrumentation 35

There are two types of BJTs, npn and pnp, and the three layers are

There are two types of BJTs, npn and pnp, and the three layers are called collector (C), base (B), and emitter (E). C w All current directions are reversed from the npn-type to the pnp-type. w w B npn transistor E A BJT consists of three adjacent regions of doped silicon, each of which is connected to an external lead. The base, a very thin slice of one type, is sandwiched by the complementary pair of the other type, hence the name bipolar. 12 April 2004 Electronic Instrumentation 36

MOSFET Applying a gate voltage that exceeds the threshold voltage opens up the channel

MOSFET Applying a gate voltage that exceeds the threshold voltage opens up the channel between the source and the drain w This is from an excellent collection of java applets at SUNY Buffalo http: //jas. eng. buffalo. edu/ w 12 April 2004 Electronic Instrumentation 37

pnp and npn transistors VCE < 0 VBE < 0 pnp BJT Note: The

pnp and npn transistors VCE < 0 VBE < 0 pnp BJT Note: The npn-type is the more popular; it is faster and costs less. VCE > 0 VBE > 0 npn BJT Apply voltage LOW to base to turn ON 12 April 2004 Apply voltage HIGH to base to turn ON Electronic Instrumentation 38

Regions of the npn BJT w Cutoff Region • Not enough voltage at B

Regions of the npn BJT w Cutoff Region • Not enough voltage at B for the diode to turn on. • No current flows from C to E and the voltage at C is Vcc. w Saturation Region • The voltage at B exceeds 0. 7 volts, the diode turns on and the maximum amount of current flows from C to E. • The voltage drop from C to E in this region is about 0. 2 V but we often assume it is zero in this class. w Active Region • As voltage at B increases, the diode begins to turn on and small amounts of current start to flow through into the doped region. A larger current proportional to IB, flows from C to E. • As the diode goes from the cutoff region to the saturation region, the voltage from C to E gradually decreases from Vcc to 0. 2 V. 12 April 2004 Electronic Instrumentation 39

Model of the npn BJT The diode is controlled by the voltage at B.

Model of the npn BJT The diode is controlled by the voltage at B. w When the diode is completely on, the switch is closed. This is the saturation region. w When the diode is completely off, the switch is open. This is the cutoff region. w When the diode is in between we are in the active region. w 12 April 2004 Electronic Instrumentation 40

npn Common Emitter Characteristics IC = βIB VBE = 0. 7 V VBE <

npn Common Emitter Characteristics IC = βIB VBE = 0. 7 V VBE < 0. 6 V 12 April 2004 Electronic Instrumentation 41

Using the transistor as a switch 12 April 2004 Electronic Instrumentation 42

Using the transistor as a switch 12 April 2004 Electronic Instrumentation 42

Building logic gates with transistors Input 0 1 12 April 2004 Electronic Instrumentation Output

Building logic gates with transistors Input 0 1 12 April 2004 Electronic Instrumentation Output 1 0 43

Inside the 555 Timer 12 April 2004 Electronic Instrumentation animation 44

Inside the 555 Timer 12 April 2004 Electronic Instrumentation animation 44