Multiplexer&Demultiplexer

Download as pdf or txt
Download as pdf or txt
You are on page 1of 28

ECEN 248 Introduction to Digital Systems Design (Spring 2008) (Sections: 501, 502, 503, 507)

Prof. Xi Zhang ECE Dept, TAMU, 333N WERC http://www.ece.tamu.edu/~xizhang/ECEN248

Chapter 6.1 Multiplexers

2-to-1 multiplexer
s w0 w1
0 1

s f 0 1

f w0 w1

(a) Graphical symbol

(b) Truth table

w0 s w1

w0
f

s w1 f

(c) Sum-of-products circuit

(d) Circuit with transmission gates

Figure 6.1. A 2-to-1 multiplexer.

4-to-1 multiplexer
s s w w w w
0 1 0 1 2 3 00 01 10 11

s0 w0 s1 w1

(a) Graphic symbol s


1

f f w2

0 0 1 1

0 1 0 1

w w w w

0 1 2 3

w3

(c) Circuit

(b) Truth table

Figure 6.2. A 4-to-1 multiplexer.

4-to-1 multiplexer implemented by 2-to-1 multiplexer


s1 s0 w0 w1

0 1 0 1

w2 w3

0 1

Figure 6.3. Using 2-to-1 multiplexers to build a 4-to-1 multiplexer.

16-to-1 multiplexer

s0 s1 w0 w3

Building 16-to-1 multiplexer by using four 4-to-1 multiplexers.

w4 w7

s2 s3

f w8 w11

w12 w15

Figure 6.4. A 16-to-1 multiplexer.

A practical application of multiplexers


s

s=0
x1 y1 x2 y2 x2 y1 x1 y2

x1 x2

y1 y2

(a) A 2x2 crossbar switch x1


0 1

s=1

y1

s x2
0 1

y2

(b) Implementation using multiplexers

Figure 6.5. A practical application of multiplexers.

Implementing programmable switches in an FPGA


Storage cell
0/1 0/1

i1 i2

i1

f i2

(a) Part of the FPGA in Figure 3.39


0/1 0/1

Storage cell

(c) Implementation using multiplexers

Figure 6.6. Implementing programmable switches in an FPGA.

Chapter 6.1.1 Synthesis of Logic Functions Using Multiplexers

Synthesis of a logic function using multiplexers


w1 w2 f 0 1 1 0 w1 0 1 f w2 w2 0 0 1 1 0 1 0 1

f = w1 w2
w1 w2 0 0 1 1 0 1 0 1 f 0 1 1 0 0 1 1 0 f w2 w1

(b) Modified truth table w1 w2 f

(a) Implementation using a 4-to-1 multiplexer

(c) Circuit

Not efficient

More efficient

Figure 6.7. Synthesis of a logic function using multiplexers.

Three-input majority function by using a 4-to-1 multiplexer


w1 w2 w3 f w1 w2 f

0 0 0 0 1 1 1 1

0 0 1 1 0 0 1 1

0 1 0 1 0 1 0 1

0 0 0 1 0 1 1 1

0 0 1 1

0 1 0 1

0
w3 w3 w3

w2 w1

0 1

(b) Circuit

(a) Modified truth table

n-input Majority function: The output is 1 if more than half inputs are 1; Otherwise, the output is equal to 0.

Figure 6.8. Implementation of the three-input majority function using a 4-to-1 multiplexer.

Three-input XOR by 2-to-1 multiplexers

f = w1 w2 w3
w1 w2 w3 f

0 0 0 0 1 1 1 1

0 0 1 1 0 0 1 1

0 1 0 1 0 1 0 1

0 1 1 0 1 0 0 1

w2 w3

w2 w3

w1 f

w2 w3

(b) Circuit (a) Truth table

Figure 6.9. Three-input XOR implemented with 2-to-1 multiplexers.

Three-input XOR implemented with a 4-to-1 multiplexer

w1 w2 w3

f = w1 w2 w3
w3 w3 w3 w3 w3 f w2 w1

0 0 0 0 1 1 1 1

0 0 1 1 0 0 1 1

0 1 0 1 0 1 0 1

0 1 1 0 1 0 0 1

(a) Truth table

(b) Circuit

Figure 6.10. Three-input XOR function implemented with a 4-to-1 multiplexer.

Chapter 6.1.2 Multiplexer Synthesis Using Shannons Expansions

Multiplexers synthesis using Shannons Expansion f = w1w2 w3 + w1w2 w3 + w1w2 w3 + w1w2 w3


w1 w2 w3 f

f = w1 (w2 + w3 ) + w1 (w2 w3 )
w1 f w2w3 w2 + w3 w2 w3 w1 f

0 0 0 0 1 1 1 1

0 0 1 1 0 0 1 1

0 1 0 1 0 1 0 1

0 0 0 1 0 1 1 1 (b) Truth table

0 1

(b) Circuit

Figure 6.11. The three-input majority function implemented using a 2-to-1 multiplexer.

Synthesis for

f = w1w3 + w1w2 + w1w3

f = w1w3 + w1w2 + w1w3 = w1 (w3 ) + w1 (w2 + w3 )


w1

f = w1w3 + w1w2 + w1w3 = w1w2 f w1w2 + w1w2 f w1w2 + w1w2 f w1w2 + w1w2 f w1w2 = w1w2 (w3 ) + w1w2 (w3 ) + w1w2 (w3 ) + w1w2 (1)
w2 w1
f

w3 w2
(a) Using a 2-to-1 multiplexer

w3 f 1
(b) Using a 4-to-1 multiplexer

Figure 6.12. The circuits synthesized in Example 6.6.

Synthesis for 3-input majority function


f = w1w2 + w1w3 + w2 w3 = w1 (w2 w3 ) + w1 (w2 + w3 + w2 w3 ) = w1 (w2 w3 ) + w1 (w2 + w3 )
w2 w1

Let

g = w1w2

and h = w1 + w2

0 w3
f

h = w2 (w3 ) + w2 (1)

g = w2 (0 ) + w2 (w3 )

Figure 6.13. The circuit synthesized in Example 6.7

Circuits Ex. 6.8 by using 3-input lookup table


f = w2 w3 + w1w2 w3 + w2 w3w4 + w1w2 w4
f = w1 f w1 + w1 f w1 = w1 (w2 w3 + w2 w3 ) + w1 (w2 w3 + w2 w3w4 + w2 w4 )
w1

0 w2 w3

fw

fw w4

(a) Using three 3-LUTs

Figure 6.14. Circuits synthesized in Example 6.8

Circuits Ex. 6.8 by using 3-input lookup table


f = w2 w3 + w1w2 w3 + w2 w3w4 + w1w2 w4 f = w2 f w 2 + w2 f w 2 = w2 (w3 + w1w4 ) + w2 (w1w3 + w3w4 )

Oberserving

f w2 = f w2 based on DeMorgan' s theorem

We need only two 3-lookup tables,


w2

0
w1 w3 w4 fw
2

(b) Using two 3-LUTs

Figure 6.14. Circuits synthesized in Example 6.8

Chapter 6.2 Decoders

Decoders

w0 n inputs wn Enable En
1

y0 2n outputs y
2n 1

Figure 6.15. An n-to-2n binary decoder.

2-to-4 decoder
En w1 w0 y

y y 2 3

w0 y0 w1 y1

1 1 1 1 0

0 0 1 1 x

0 1 0 1 x

1 0 0 0 0

0 1 0 0 0

0 0 1 0 0

0 0 0 1 0

(a) Truth table

y2

w0 w1 En

y0 y1 y2 y3

y3 En (c) Logic circuit

(b) Graphical symbol

Figure 6.16. A 2-to-4 decoder.

3-to-8 decoder by using 2-to-4 decoders


w0 w1 w2 w0 w1 En y0 y1 y2 y3 y0 y1 y2 y3

En

w0 w1 En

y0 y1 y2 y3

y4 y5 y6 y7

Figure 6.17. A 3-to-8 decoder using two 2-to-4 decoders.

w0 w1

w0 w1 En w0 w1

y0 y1 y2 y3 y0 y1 y2 y3 y0 y1 y2 y3 y0 y1 y2 y3

y0 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15

w2 w3 En

w0 w1 En

y0 y1 y2 y3

En w0 w1 En w0 w1 En

Figure 6.18. A 4-to-16 decoder built using a decoder tree.

Using decoder to build multiplexer

w0

w1 s0 s1 w0 w1 En y0 y1 y2 y3 f w2

w3

Figure 6.19. A 4-to-1 multiplexer built using a decoder.

Demultiplexer
Multiplexer
The purpose of Multiplexer is to multiplex the n data inputs onto the single data output under control of the select inputs. Perform the opposite function of the multiplexer. Place the value of a single data input onto multiple data outputs. Can be implemented by using a decoder circuit.

Demultiplexer

Example: 1-to-4 demultiplexer by using 2-to-4 decoder


Input to determine which output is set equal to En
w0 y0 w1 y1

Output

y2

Serve as data input

y3 En (c) Logic circuit

Sel0 Sel1 m-to-2m decoder a0 a1 Address am 1 Sel2

0/1 0/1 0/1

0/1 0/1 0/1

0/1 0/1 0/1

Sel2m 1

0/1

0/1

0/1

Read Data d n 1 dn 2 d0

Figure 6.21. A 2m x n read-only memory (ROM) block.

You might also like