3 Active States and Bubbles Primarily applies to control signals; used to denote when a condition is active or enabledActive State - signal state (0 or 1) that indicates the assertion of some condition or actionA signal is asserted when it is in the active stateA signal is negated when it is in the inactive stateActive-1 (active high) is when active state is logic 1Active-0 (active low) is when active state is logic 0Symbol pins without bubbles denote active-1 signalsSymbol pins with bubbles denote active-0 signals
4 Signal Naming Conventions The problem is how to distinguish between active-1 and active-0 signals.Use suffix of ‘_0’; (i.e A_0) after signal nameUse suffix of ‘_LO’ or ‘_L’Use suffix of ‘_BAR’No matter what you use, BE CONSISTENT!
8 What is a decoder?Decoder: A combinational circuit with an n-bit code word applied toits inputs and m-bit (m=2^n) code word appearing at the outputs.Detect which of the 2^n input code words is represented at the inputsProduce m outputs, only one of which is asserted
10 2-to-4 DecoderA 2-to-4 decoder operates according to the following truth tableThe 2-bit input is called S1-S0, and the four outputs are Q0-Q3If the input is the binary number i, then output Qi is uniquely trueFor instance, if the input S1 S0 = 10 (decimal 2), then output Q2 is true,and Q0, Q1, Q3 are all falseThis circuit “decodes” a binary number into a “one-of-four” code
11 How can you build a 2-to-4 decoder? Follow the design procedures from last time! We have a truth table, sowe can write equations for each of the four outputs (Q0-Q3)In this case there’s not much to be simplified. Here are the equations:Q0 = S1’ S0’Q1 = S1’ S0Q2 = S1 S0’Q3 = S1 S0
13 Enable InputsMany devices have an additional enable input, which is used to “activate”or “deactivate” the deviceFor a decoder,EN=1 activates the decoder, so it behaves as specified earlier. Exactlyone of the outputs will be 1EN=0 “deactivates” the decoder. By convention, that means all of thedecoder’s outputs are 0We can include this additional input in the decoder’s truth table:
14 An aside: abbreviated truth tables In this table, note that wheneverEN=0, the outputs are always 0,regardless of inputs S1 and S0.We can abbreviate the table bywriting x’s in the input columnsfor S1 and S0
19 3-to-8 decoder Larger decoders are similar. Here is a 3-to-8 decoder A truth table (without EN) is belowOutput equations are at the bottom rightAgain, only one output is true for any input combinationQ0 = S2’ S1’ S0’Q1 = S2’ S1’ S0Q2 = S2’ S1 S0’Q3 = S2’ S1 S0Q4 = S2 S1’ S0’Q5 = S2 S1’ S0Q6 = S2 S1 S0’Q7 = S2 S1 S0
23 So what good is a decoder? Do the truth table and equations look familiar?Decoders are sometimes called minterm generatorsFor each of the input combinations, exactly one output is trueEach output equation contains all of the input variablesThese properties hold for all sizes of decodersArbitrary functions can be implemented with decoders. If a sum ofminterms equation for a function is given, a decoder (a minterm generator)is used to implement that functionQ0 = S1’ S0’Q1 = S1’ S0Q2 = S1 S0’Q3 = S1 S0
24 Design example: Addition Let’s make a circuit that adds three 1-bit inputs X, Y and ZWe will need two bits to represent the total; let’s call them C and S, for“carry” and “sum.” Note that C and S are two separate functions of thesame inputs X, Y and ZHere are a truth table and sum-of-minterms equations for C and S= 11= 10C(X,Y,Z) = m(3,5,6,7)S(X,Y,Z) = m(1,2,4,7)
26 Active-Low DecodersThe output equations for an active-low decoder are mysteriously similar,yet somehow differentIt turns out that active-low decoders generate maxtermsSo we can use active-low decoders to implement arbitrary functions too,but as a product of maxterms, i.e., f(x,y,z) = M(4,5,7)Q3’ = (S1 S0)’ = S1’ + S0’Q2’ = (S1 S0’)’ = S1’ + S0Q1’ = (S1’ S0)’ = S1 + S0’Q0’ = (S1’ S0’)’ = S1 + S0
27 Summary of DecodersA n-to-2n decoder generates the minterms of an n-variable functionAs such, decoders can be used to implement arbitrary functionsLater on we’ll see other uses for decoders tooSome variations of the basic decoder include:Adding an enable inputUsing active-low inputs and outputs to generate maxtermsWe also talked about:Applying our circuit analysis and design techniques to understand andwork with decodersUsing block symbols to encapsulate common circuits like decodersBuilding larger decoders from smaller ones
28 Binary EncodersAn encoder is a digital function that performs the inverse operationof a decoderOnly one input can have the value of 1 at any given time
29 Octal-to-Binary Encoder This encoder has eight inputs, one for each of the octal digits.Three outputs that generate the corresponding binary number.EncoderD7D6D5D4D3D2D1D0A2A1A0
37 MultiplexersMultiplexers, or muxes, are used to choose between resourcesA real-life example: in the old days before networking, several computerscould share one printer through the use of a switch.
38 MultiplexersA n-to-1 multiplexer sends one of n input lines to a single output lineA multiplexer has two sets of inputs:n data input liness=log2n select lines, to pick one of the n data inputs
39 2-to-1 MuxThe select bit S controls which of the data bits D0-D1 is chosen:If S=0, then D0 is the output (Q=D0).If S=1, then D1 is the output (Q=D1).Here is another kind of abbreviated truth tableInput variables appear in the output columnThis table implies that when S=0, the output Q=D0, and when S=1 the output Q=D1This is a pretty close match to the equationQ = S’ D0 + S D1
48 Implementing functions with multiplexers Muxes can be used to implement arbitrary functionsOne way to implement a function of n variables is to use an 2^n-to-1 mux:For each minterm mi of the function, connect 1 to mux data input Di.Each data input corresponds to one row of the truth tableConnect the function’s input variables to the mux select inputs. Theseare used to indicate a particular input combinationFor example, let’s look at f(x,y,z) = m(1,2,6,7).
49 A more efficient wayWe can actually implement f(x,y,z) = m(1,2,6,7) withjust a 4-to-1 mux, instead of an 8-to-1Step 1: Find the truth table for the function, andgroup the rows into pairs. Within each pair of rows,x and y are the same, so f is a function of z only.When xy=00, f=zWhen xy=01, f=z’When xy=10, f=0When xy=11, f=1Step 2: Connect the first two input variables of thetruth table (here, x and y) to the select bits S1 S0of the 4-to-1 mux.Step 3: Connect the equations above for f(z) to thedata inputs D0-D3.
50 Example: multiplexer-based adder Let’s implement the adder carry function, C(X,Y,Z), with muxesThere are three inputs, so we’ll need a 4-to-1 muxThe basic setup is to connect two of the input variables (usually the firsttwo in the truth table) to the mux select inputsWith S1=X and S0=Y, thenQ=X’Y’D0 + X’YD1 + XY’D2 + XYD3
51 Multiplexer-based carry We can set the multiplexer data inputs D0-D3, by fixing X and Y andfinding equations for C in terms of just Z.When XY=00, C=0When XY=01, C=ZWhen XY=10, C=ZWhen XY=11, C=1C = X’ Y’ D0 + X’ Y D1 + X Y’ D2 + X Y D3= X’ Y’ 0 + X’ Y Z + X Y’ Z + X Y 1= X’ Y Z + X Y’ Z + XY= m(3,5,6,7)
52 Multiplexer-based sum Here’s the same thing, but for the sum function S(X,Y,Z)When XY=00, S=ZWhen XY=01, S=Z’When XY=10, S=Z’When XY=11, S=ZS = X’ Y’ D0 + X’ Y D1 + X Y’ D2 + X Y D3= X’ Y’ Z + X’ Y Z’ + X Y’ Z’ + X Y Z= m(1,2,4,7)
53 Summary of MuxesA n-to-1 multiplexer routes one of n input lines to a single output lineJust like decoders,Muxes are common enough to be supplied as stand-alone devices foruse in modular designs.Muxes can implement arbitrary functionsWe saw some variations of the standard multiplexer:Smaller muxes can be combined to produce larger onesWe can add active-low or active-high enable inputsAs always, we use truth tables and Boolean algebra to analyze things
54 Three-state Buffers Output = LOW, HIGH, or Hi-Z Wire can be considered disconnectedCan tie multiple outputs together if at most one at a time is enabledDifferent flavors: