Review: Additional Boolean Operations
Review: Additional Boolean Operations
Operation: Expressions: Truth table: NAND (NOT-AND) (xy) = x + y NOR (NOT-OR) (x + y) = x y XOR (eXclusive OR) x y = xy + xy
Logic gates:
Decoders
XOR gates
A two-input XOR gate outputs true when exactly one of its inputs is true:
x y = x y + x y XOR corresponds more closely to typical English usage of or, as in eat your vegetables or you wont get any pudding. Several fascinating properties of the XOR operation:
Decoders
x (y z) = x (yz + yz) [ Definition of XOR ] = x(yz + yz) + x(yz + yz) [ Definition of XOR ] = xyz + xyz + x(yz + yz) [ Distributive ] = xyz + xyz + x((yz) (yz)) [ DeMorgans ] = xyz + xyz + x((y + z)(y + z)) [ DeMorgans ] = xyz + xyz + x(yz + yz) [ Distributive ] = xyz is xyz + xyz +useful Distributive ] adders (as well see on later) and error XOR + especially xyz [ for building
detection/correction circuits.
Decoders
XNOR gates
Finally, the complement of the XOR function is the XNOR function. A two-input XNOR gate is true when its inputs are equal:
(x y) = xy + xy
Decoders
Decoders
Decoders
Next, well look at some commonly used circuits: decoders and multiplexers. o These serve as examples of the circuit analysis and design techniques from last lecture. o They can be used to implement arbitrary functions. o We are introduced to abstraction and modularity as hardware design principles. Throughout the semester, well often use decoders and multiplexers as building blocks in designing more complex hardware.
Decoders
What is a decoder
In older days, the (good) printers used be like typewriters: o To print A, a wheel turned, brought the A key up, which then was struck on the paper. Letters are encoded as 8 bit codes inside the computer. o When the particular combination of bits that encodes A is detected, we want to activate the output line corresponding to A o (Not actually how the wheels worked) How to do this detection : decoder General idea: given a k bit input, o Detect which of the 2^k combinations is represented o Produce 2^k outputs, only one of which is 1.
Decoders
For instance, if the input S1 S0 = 10 (decimal 2), then output Q2 is true, and Q0, Q1, Q3 are all false. This circuit decodes a binary number into a one-of-four code.
Decoders
In this case theres not much to be simplified. Here are the equations:
Q0 = S1 S0 Q1 = S1 S0 Q2 = S1 S0 Q3 = S1 S0
Decoders
Decoders
Enable inputs
Many devices have an additional enable input, which is used to activate or deactivate the device. For a decoder, o EN=1 activates the decoder, so it behaves as specified earlier. Exactly one of the outputs will be 1. o EN=0 deactivates the decoder. By convention, that means all of the decoders outputs are 0. We can include this additional input in the decoders truth table:
Decoders
Decoders
A decoder block provides abstraction: o You can use the decoder as long as you know its truth table or equations, without knowing exactly whats inside. o It makes diagrams simpler by hiding the internal circuitry. o It simplifies hardware reuse. You dont have to keep rebuilding the decoder from scratch every time you need it. These blocks are like functions in programming!
Decoders
A 3-to-8 decoder
Larger decoders are similar. Here is a 3-to-8 decoder. o The block symbol is on the right. o A truth table (without EN) is below. o Output equations are at the bottom right. Again, only one output is true for any input combination.
Q0 = S2 S1 S0 Q1 = S2 S1 S0 Q2 = S2 S1 S0 Q3 = S2 S1 S0 Q4 = S2 S1 S0 Q5 = S2 S1 S0 Q6 = S2 S1 S0 Q7 = S2 S1 S0
Decoders
Q0 = S1 S0 Q1 = S1 S0 Q2 = S1 S0 Q3 = S1 S0 Decoders are sometimes called minterm generators. o For each of the input combinations, exactly one output is true. o Each output equation contains all of the input variables. o These properties hold for all sizes of decoders. This means that you can implement arbitrary functions with decoders. If you have a sum of minterms equation for a function, you can easily use a decoder (a minterm generator) to implement that function.
Decoders
0 + 1 + 1 = 10
1+1+1= 11
September 22, 2003 Decoders
Decoder-based adder
Here, two 3-to-8 decoders implement C and S as sums of minterms.
The +5V symbol (5 volts) is how you represent a constant 1 or true in LogicWorks. We use it here so the decoders are always active.
Decoders
Decoders
Q0 = S2 S1 S0 = m0 Q1 = S2 S1 S0 = m1 Q2 = S2 S1 S0 = m2 Q3 = S2 S1 S0 = m3 Q4 = S2 S1 S0 = m4 Q5 = S2 S1 S0 = m5 Q6 = S2 S1 S0 = m6 Q7 = S2 S1 S0 = m7
Decoders
Decoder expansion
You can use enable inputs to string decoders together. Heres a 3-to-8 decoder constructed from two 2-to-4 decoders:
Decoders
Modularity
Be careful not to confuse the inner inputs and outputs of the 2-to-4 decoders with the outer inputs and outputs of the 3-to-8 decoder (which are in boldface). This is similar to having several functions in a program which all use a formal parameter x.
You could verify that this circuit is a 3-to-8 decoder, by using equations for the 2-to-4 decoders to derive equations for the 3-to-8.
Decoders
An active-low decoder is the same thing, but with an inverted EN input and inverted outputs.
Decoders
Separated at birth?
Active-high decoders generate minterms, as weve already seen.
Q3 = S1 S0 Q2 = S1 S0 Q1 = S1 S0 Q0 = S1 S0
The output equations for an active-low decoder are mysteriously similar, yet somehow different.
Q3 = (S1 S0) = S1 + S0 Q2 = (S1 S0) = S1 + S0 It turns out that active-low decoders generate= S1 + S0 Q1 = (S1 S0) maxterms. Q0 = (S1 S0) = S1 + S0
Decoders
The ground symbol connected to EN represents logical 0, so this decoder is always enabled. Remember that you need an AND gate for a product of sums.
Decoders
Summary
A n-to-2n decoder generates the minterms of an n-variable function. As such, decoders can be used to implement arbitrary functions. Later on well see other uses for decoders too. Some variations of the basic decoder include: o Adding an enable input. o Using active-low inputs and outputs to generate maxterms. o We also talked about: o Applying our circuit analysis and design techniques to understand and work with decoders. Using block symbols to encapsulate common circuits like decoders. Building larger decoders from smafhxhcller ones. o ller ones. o ller ones. o ller ones. o ller ones. ller ones. ller ones. o ller ones. o ller ones. o ller ones. o ller ones. o ller ones. September 22, 2003 Decoders o ller ones.