Introduction to Digital Logic Missouri S&T University CPE 2210 Multiplexers/Demultiplexers Egemen K. Çetinkaya Department of Electrical & Computer Engineering Missouri University of Science and Technology cetinkayae@mst.edu http://web.mst.edu/~cetinkayae/teaching/cpe2210spring2018 2 April 2018 rev. 18.0 2014 2018 Egemen K. Çetinkaya
Introduction Multiplexers Multiplexers/Demultiplexers Outline Demultiplexers Summary 2
Digital Logic Systems Overview Combinatorial logic circuits for no memory systems Boolean algebra to mathematically design/analyze logic gates are building blocks Sequential logic circuits for memory systems Finite State Machines to mathematically design/analyze flip-flops and latches store memory flip-flops and latches are building blocks of sequential logic Sequential logic circuits (aka controllers) combine combinatorial circuits storage elements (e.g. registers) 3
Digital Systems Components analog phenomena electric signal A2D digital data digital data sensors and other inputs Digital System D2A electric signal actuators and other outputs digital data digital data Transducer: sensor + actuator Not all sensors/actuators require A2D/D2A conversion Digital system can be implemented: microprocessor readily available, cheap, easy to program, easy to reprogram custom circuit smaller, faster, consume less power 4
Digital Systems Paths Digital systems have two paths: datapath circuit control circuit Datapath circuit store data manipulate data transfer data from one part to another Control circuit controls the operation of datapath circuit 5
Adders Subtractors Comparators Datapath Components Building Block examples ALUs: Arithmetic Logic Units Registers Shifters Multiplexer/demultiplexers Encoders/decoders Counters/timers 6
Multiplexers Overview Multiplex n data inputs onto a single data output under control of the select inputs MUX for short 7
Demultiplexers Overview Places single data input onto multiple data outputs DEMUX for short 8
Multiplexers/Demultiplexers Application Area In communication (e.g. routers, switches) Cost efficient use of channel [ref: https://en.wikipedia.org/wiki/multiplexer] 9
2-Input Multiplexer Example Truth Table Output depends on select control input s w 0 w 1 f s w 0 w 1 0 1 f 10
2-Input Multiplexer Example Truth Table Output depends on select control input s w 0 w 1 0 1 f s w 0 w 1 f 0 0 0 0 0 0 1 0 0 1 0 1 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 1 1 1 1 11
2-Input Multiplexer Example Truth Table Output depends on select control input s w 0 w 1 f 0 0 0 0 s f s 0 0 1 0 0 1 0 1 0 w 0 1 w 1 w 0 w 1 0 1 f 0 1 1 1 1 0 0 0 w 0 1 0 1 1 1 1 0 0 1 1 1 1 s w 1 f 12
4-Input Multiplexer Example Truth Table Output depends on select control input s 0 s 0 s 1 s 0 f s 1 w 0 s 1 w 0 00 w 1 01 w 2 w 3 10 11 f 0 0 w 0 0 1 w 1 1 0 w 2 w 1 w 2 f 1 1 w 3 w 3 13
4-Input Multiplexer Example Cascading Can we build 4-to-1 multiplexer using 2-to-1 multiplexers? 14
4-Input Multiplexer Example Cascading We can build 4-to-1 multiplexer using 2-to-1 multiplexers s 1 s 0 w 0 w 1 0 1 0 1 f w 2 w 3 0 1 15
16-to-1 Multiplexer Example Cascading via 4-to-1 Multiplexers s 0 s 1 w 0 w 3 w 4 w 7 w 8 s 2 s 3 f w 11 w 12 w 15 16
Multiplexers Number of Control Inputs For n inputs, how many control inputs are needed? 17
Multiplexers Number of Control Inputs For n inputs, how many control inputs are needed? Answer: log 2 (n) For 2 input 1 control, for 4 input 2 control is needed 18
Logic Design via Multiplexers 2-to-1 Multiplexer Logic What is Boolean expression for 2-to-1 multiplexer? s I 0 I 1 0 1 f s I 0 I 1 f 0 0 0 0 0 0 1 0 0 1 0 1 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 1 1 1 1 s f 0 I 0 1 I 1 19
Logic Design via Multiplexers 2-to-1 Multiplexer Logic The Boolean expression for 2-to-1 multiplexer is: s I 0 I 1 0 1 f s I 0 I 1 f 0 0 0 0 0 0 1 0 0 1 0 1 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 1 1 1 1 s f 0 I 0 1 I 1 f = s I 0 + si 1 20
Logic Design via Multiplexers 4-to-1 Multiplexer Logic What is Boolean expression for 4-to-1 multiplexer? x y I 0 00 I1 01 I 2 I 3 10 11 f x y f 0 0 I 0 0 1 I 1 1 0 I 2 1 1 I 3 21
Logic Design via Multiplexers 4-to-1 Multiplexer Logic The Boolean expression for 4-to-1 multiplexer is: x y x y f I 0 00 I1 01 I 2 I 3 10 11 f 0 0 I 0 0 1 I 1 1 0 I 2 f = x y I 0 + x yi 1 + xy I 2 + xyi 3 1 1 I 3 22
Logic Design via Multiplexers 8-to-1 Multiplexer Logic What is Boolean expression for 8-to-1 multiplexer? x y z f 0 0 0 I 0 0 0 1 I 1 0 1 0 I 2 0 1 1 I 3 1 0 0 I 4 1 0 1 I 5 1 1 0 I 6 1 1 1 I 7 23
Logic Design via Multiplexers 8-to-1 Multiplexer Logic The Boolean expression for 8-to-1 multiplexer is: x y z f 0 0 0 I 0 0 0 1 I 1 0 1 0 I 2 0 1 1 I 3 f = x y z I 0 + x y zi 1 + x yz I 2 + x yzi 3 + xy z I 4 + xy zi 5 + xyz I 6 + xyzi 7 1 0 0 I 4 1 0 1 I 5 1 1 0 I 6 1 1 1 I 7 24
Logic Design via Multiplexers 8-to-1 Multiplexer Example Implement the minterm canonical formula: f (x,y,z) = (0,2,3,5) using 8-to-1 mux 25
Logic Design via Multiplexers 8-to-1 Multiplexer Example Implement f (x,y,z) = (0,2,3,5) using 8-to-1 mux x y z f 0 0 0 1 0 0 1 0 0 1 0 1 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 1 1 1 0 26
Logic Design via Multiplexers 8-to-1 Multiplexer Example Implement f (x,y,z) = (0,2,3,5) using 8-to-1 mux x y z f 0 0 0 1 0 0 1 0 0 1 0 1 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 1 1 1 0 27
Logic Design via Multiplexers 8-to-1 Multiplexer Logic Consider the Boolean expression for 8-to-1 mux: f = x y z I 0 + x y zi 1 + x yz I 2 + x yzi 3 + xy z I 4 + xy zi 5 + xyz I 6 + xyzi 7 8-to-1 mux Boolean expression can be simplified to: f = x y (z I 0 + zi 1 ) + x y(z I 2 + zi 3 ) + xy (z I 4 + zi 5 ) + xy(z I 6 + zi 7 ) Consider the 4-to-1 mux Boolean expression: f = x y I 0 + x yi 1 + xy I 2 + xyi 3 Any similarity between 4-to-1 and 8-to-1 mux? Can we implement 3-variable func. using 4-to-1 mux? 28
Logic Design via Multiplexers 8-to-1 Multiplexer Logic 8-to-1 mux Boolean expression can be simplified to: f = x y (z I 0 + zi 1 ) + x y(z I 2 + zi 3 ) + xy (z I 4 + zi 5 ) + xy(z I 6 + zi 7 ) Consider the 4-to-1 mux Boolean expression: f = x y I 0 + x yi 1 + xy I 2 + xyi 3 We can implement 3-variable func. using 4-to-1 mux 29
Logic Design via Multiplexers 8-to-1 Multiplexer Example Implement f (x,y,z) = (0,2,3,5) by 4-to-1 mux x y z f 0 0 0 1 0 0 1 0 0 1 0 1 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 1 1 1 0 f = x y (z I 0 + zi 1 ) + x y(z I 2 + zi 3 ) + xy (z I 4 + zi 5 ) + xy(z I 6 + zi 7 ) 30
Logic Design via Multiplexers 8-to-1 Multiplexer Example Implement f (x,y,z) = (0,2,3,5) by 4-to-1 mux x y z f 0 0 0 1 0 0 1 0 0 1 0 1 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 1 1 1 0 f = x y (z I 0 + zi 1 ) + x y(z I 2 + zi 3 ) + xy (z I 4 + zi 5 ) + xy(z I 6 + zi 7 ) f = x y (z 1 + z0) + x y(z 1 + z1) + xy (z 0 + z1) + xy(z 0 + z0) 31
Logic Design via Multiplexers 8-to-1 Multiplexer Example Implement f (x,y,z) = (0,2,3,5) by 4-to-1 mux x y z f 0 0 0 1 0 0 1 0 0 1 0 1 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 1 1 1 0 f = x y (z I 0 + zi 1 ) + x y(z I 2 + zi 3 ) + xy (z I 4 + zi 5 ) + xy(z I 6 + zi 7 ) f = x y (z 1 + z0) + x y(z 1 + z1) + xy (z 0 + z1) + xy(z 0 + z0) f = x y (z ) + x y(z + z) + xy (z) + xy(0) f = x y (z ) + x y(1) + xy (z) + xy(0) 32
Logic Design via Multiplexers 8-to-1 Multiplexer Example Implement f (x,y,z) = (0,2,3,5) by 4-to-1 mux x y z f 0 0 0 1 0 0 1 0 0 1 0 1 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 1 1 1 0 f = x y (z I 0 + zi 1 ) + x y(z I 2 + zi 3 ) + xy (z I 4 + zi 5 ) + xy(z I 6 + zi 7 ) f = x y (z 1 + z0) + x y(z 1 + z1) + xy (z 0 + z1) + xy(z 0 + z0) f = x y (z ) + x y(z + z) + xy (z) + xy(0) f = x y (z ) + x y(1) + xy (z) + xy(0) 33
Logic Design via Multiplexers 16-to-1 Multiplexer Example Implement f (w,x,y,z) = (0,1,5,6,7,9,12,15) using 8-to-1 mux at your leisure 34
Logic Design via Multiplexers 16-to-1 Multiplexer Example 8-to-1 mux implem. of f (w,x,y,z) = (0,1,5,6,7,9,12,15) 35
Multiplexers Multiplexers/Demultiplexers Summary multiplex n data inputs onto a single data output under control of the select inputs Demultiplexers places single data input onto multiple data outputs 36
References and Further Reading [V2011] Frank Vahid, Digital Design with RTL Design, VHDL, and Verilog, 2nd edition, Wiley, 2011. [G2003] Donald D. Givone, Digital Principles and Design, McGraw-Hill, 2003. [BV2009] Stephen Brown and Zvonko Vranesic, Fundamentals of Digital Logic with VHDL Design, 3rd edition, McGraw-Hill, 2009. [W2006] John F. Wakerly, Digital Design Principles and Practices, 4th edition, Prentice Hall, 2006. [S2017] John Seiffertt, Digital Logic for Computing, 1st edition, Springer, 2017. 37
End of Foils 38