CHAPTER 9 MULTIPLEXERS, DECODERS, AND PROGRAMMABLE LOGIC DEVICES
Contents
9.1 9.2 9.3 9.4 9.5 9.6 9.7 9.8 Introduction Multiplexers Three-State Buffers Decoders and Encoders Read-Only Memories Programmable Logic Devices Complex Programmable Logic Devices Field Programmable Gate Arrays
Objectives
1. Explain the function of a multiplexer. Implement a multiplexer using gates. 2. Explain the operation of three-state buffers. Determine the resulting output when three-state buffers outputs are connected together. Use three-state buffers to multiplex signals onto a bus. 3. Explain the operation of a decoder and encoder. Use a decoder with added gates to implement a set of logic functions. Implement a decoder or priority encoder using gates. 4. Explain the operation of a read-only memory (ROM). Use a ROM to implement a set of logic functions. 5. Explain the operation of a programmable logic array (PLA). Use a PLA to implement a set of logic functions. Given a PLA table or an internal connection diagram for a PLA, determine the logic functions realized. 6. Explain the operation of a programmable array logic device (PAL). Determine the programming pattern required to realize a set of logic function with a PAL. 7. Explain the operation of a complex programmable logic device (CPLD) and a field programmable gate array (FPGA). 8. Use Shannons expansion theorem to decompose a switching function.
9.1 Introduction
Multiplexer, Decoder, encoder. Three-state Buffer
ROMs PLD PLA CPLD FPGA
9.2 Multiplexers
Fig 9-1. 2-to-1 Multiplexer and Switch Analog
logic equation for the 2 - to - 1 MUX
Z = A' I 0 + AI1
9.2 Multiplexers
Fig 9-2. Multiplexer (1)
logic equation for the 4 - to - 1 MUX
Z = A' B' I 0 + A' BI1 + AB' I 2 + ABI 3
9.2 Multiplexers
Fig 9-2. Multiplexer (2)
logic equation for the 8 - to - 1 MUX
Z = A' B' C ' I 0 + A' B' CI1 + A' BC ' I 2 + A' BCI 3 + AB' C ' I 4 + AB' CI 5 + ABC ' I 6 + ABCI 7
9.2 Multiplexers
Fig 9-2. Multiplexer (3)
logic equation for the 2 n - to - 1 MUX
Z = mk I k
k =0
2 n 1
9.2 Multiplexers
Fig 9-3. Logic Diagram for 8-to-1 MUX
9.2 Multiplexers
Fig 9-4. Quad Multiplexer Used to Select Data
9.2 Multiplexers
Fig 9-5. Quad Multiplexer with Bus Inputs and Output
9.3 Three-State Buffers
Fig 9-6. Gate Circuit with Added Buffer
9.3 Three-State Buffers
Fig 9-7. Three-State Buffer
9.3 Three-State Buffers
Fig 9-8. Four Kinds of Three-State Buffers
B A 0 0 1 1 0 1 0 1 (a)
C Z Z 0 1
B A 0 0 1 1 0 1 0 1 (b)
C Z Z 1 0
B A 0 0 1 1 0 1 0 1 (c)
C 0 1 Z Z
B A 0 0 1 1 0 1 0 1 (d)
C 1 0 Z Z
We use the Symbol Z to represent high-impedance state
9.3 Three-State Buffers
Fig 9-9. Data Selection Using Three-State Buffers
9.3 Three-State Buffers
Fig 9-10. Circuit with Two Three-State Buffers
S1 X 0 1 Z
X X X X X
S2 0 X 0 X 0
1 X X 1 1
Z X 0 1 Z
X = Unknown
9.3 Three-State Buffers
Fig 9-11. 4-Bit Adder with Four Sources for One Operand
9.3 Three-State Buffers
Fig 9-12. Integrated Circuit with Bi-Directional Input/Output Pin
9.4 Decoders and Encoders
Fig 9-13. 3-to-8 Line Decoder
a b c 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1
y0 y1 y2 y3 y4 y5 y6 y7 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1
9.4 Decoders and Encoders
Fig 9-14. A 4-to-10 Line Decoder (1)
9.4 Decoders and Encoders
Fig 9-14. A 4-to-10 Line Decoder (2)
BCD Input A B C D 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 Decimal Output 3 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 4 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 5 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 6 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 7 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 8 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 9 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1
(c) Truth Table
9.4 Decoders and Encoders
Fig 9-15. Realization of a Multiple-Output Circuit Using a Decoder
yi = mi ,
i = 0 to 2 n 1 or
(noninverted outputs) (inverted outputs)
yi = mi ' = M i , i = 0 to 2 n 1
f1 (a, b, c, d ) = m1 + m2 + m4 = (m1 ' m2 ' m4 ' )'
f 2 (a, b, c, d ) = m4 + m7 + m9 = (m4 ' m7 ' m9 ' )'
9.4 Decoders and Encoders
Fig 9-16. 8-to-3 Priority Encoder
y0 y1 y2 y3 y4 y5 y6 y7 a 0 1 X X X X X X X 0 0 1 X X X X X X 0 0 0 1 X X X X X 0 0 0 0 1 X X X X 0 0 0 0 0 1 X X X 0 0 0 0 0 0 1 X X 0 0 0 0 0 0 0 1 X 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 1 1
b 0 0 0 1 1 0 0 1 1
c 0 0 1 0 1 0 1 0 1
d 0 1 1 1 1 1 1 1 1
9.5 Read-Only Memories
Fig 9-17. An 8-Word x 4-Bit ROM
A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 C 0 1 0 1 0 1 0 1 F0 1 1 0 0 1 0 1 0 F1 0 0 1 1 1 0 1 1 F2 1 1 1 0 0 0 1 0 F3 0 0 1 1 0 1 1 1
typical data stored in ROM (23 words of 4bits each)
(a) Block diagram
(b) Truth table for ROM
9.5 Read-Only Memories
Fig 9-18. Read-Only Memory with n Inputs and m Outputs
n input
Variables 00 00 00 00 00 01 10 11
m output
Variables 100 010 101 110 110 111 101 010 011 110 000 101
typical data array stored in ROM (2n words of
11 11 11 11
00 01 10 11
001 110 011 111
m bits each)
9.5 Read-Only Memories
Fig 9-19. Basic ROM Structure
9.5 Read-Only Memories
Fig 9-20. An 8-Word x 4-Bit ROM
F1 = m(2,3,4,6,7) = B + AC ' F2 = m(0,1,2,6) = A' B'+ BC ' F3 = m(2,3,5,6,7) = AC + B
F0 = m(0,1,4,6) = A' B '+ AC '
9.5 Read-Only Memories
Fig 9-21. Equivalent OR Gate for F0
F0 = m(0,1,4,6) = A' B'+ AC '
9.5 Read-Only Memories
Fig 9-22. Hexadecimal to ASCII Code Converter
Input W 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 X 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 Y 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 Z 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 Hex Digit 0 1 2 3 4 5 6 7 8 9 A B C D E F ASCII Code for Hex Digit A6 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 A5 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 A4 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 A3 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 A2 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 A1 0 0 1 1 0 0 1 1 0 0 0 1 1 0 0 1 A0 0 1 0 1 0 1 0 1 0 1 1 0 1 0 1 0
9.5 Read-Only Memories
Fig 9-23. ROM Realization of Code Converter
9.6 Programmable Logic Devices
Fig 9-24. Programmable Logic Array Structure
9.6 Programmable Logic Devices
Fig 9-25. PLA with Three Inputs, Five Product Terms, and Four Outputs
9.6 Programmable Logic Devices
Fig 9-26. AND-OR Array Equivalent to Figure 9-25
9.6 Programmable Logic Devices
Table 9-1. PLA Table for Figure 9-25
Product Term AB AC B BC AC
Inputs A 0 1 1 B 0 1 1 C 0 0 1 F0 1 1 0 0 0
Outputs F1 0 1 1 0 0 F2 1 0 0 1 0 F3 0 0 1 0 1
F0 = A ' B '+ AC ' F1 = AC '+ B F2 = A ' B '+ BC ' F3 = B + AC
9.6 Programmable Logic Devices
Fig 9-27. PLA Realization of Equations (7-23b)
a 0 1 1 -
b 1 1 0 0 1
c 0 1 1 1
d 1 1 -
f1 1 1 1 1 0 0
f2 1 0 0 0 1 0
f3 0 1 1 0 0 1
(a) PLA table
9.6 Programmable Logic Devices
Programmable Array Logic
The symbol of Figure 9-28(a)
logically equal
9.6 Programmable Logic Devices
Programmable Array Logic
Connections to the AND gate inputs in a PAL
9.6 Programmable Logic Devices
Fig 9-28. PAL Segment
9.6 Programmable Logic Devices
Fig 9-29. Implementation of a Full Adder Using a PAL
= X ' Y ' C in + X ' YC 'in + XY ' C 'in + XYC in
= XC in + YC in + XY
9.7 Complex Programmable Logic Devices
Fig 9-30. Architecture of Xilinx XCR3064XL CPLD
(Figure based on figures and text owned by Xilinx, Inc., Courtesy of Xilinx, Inc. Xilinx, Inc.1999-2003. All rights reserved.)
9.7 Complex Programmable Logic Devices
Fig 9-31. CPLD Function Block and Macrocell
(A Simplified Version of XCR3064XL)
9.8 Field Programmable Gate Arrays
Fig 9-32. Equivalent OR Gate for F0
9.8 Field Programmable Gate Arrays
Fig 9-33. Simplified Configurable Logic Block (CLB)
9.8 Field Programmable Gate Arrays
Fig 9-34. Implementation of a Lookup Table (LUT)
a 0 0 1
b 0 0 1
c 0 0 1
d 0 1 1
f 0 1 1
F = a ' b' c' d '+ a ' b' cd + a ' bc' d + a ' bcd '+ ab' c' d + ab' cd '+ abc' d '+ abcd
9.8 Field Programmable Gate Arrays
Decomposition if switching Functions
f (a, b, c, d ) = a ' f (0, b, c, d ) + af (1, b, c, d ) = a ' f 0 + af1
f (a, b, c, d ) = c' d '+ a' b' c + bcd + ac' = a' (c' d '+b' c + bcd ) + a(c' d '+bcd + c' ) = a' (c' d '+b' c + cd ) + a (c'+bd ) = a' f 0 + af1
f ( x1 , x 2 ,..., xi 1 , xi , xi +1 ,..., xn ) = xi ' f ( x1 , x 2 ,..., xi 1 ,0, xi +1 ,..., xn ) + xi f ( x1 , x 2 ,..., xi 1 ,1, xi +1 ,..., xn ) = xi ' f 0 + xi f i
9.8 Field Programmable Gate Arrays
Decomposition if switching Functions
f (a, b, c, d , e) = a' f (0, b, c, d , e) + af (1, b, c, d , e) = a ' f 0 + af1 G (a, b, c, d , e, f ) = a' G (0, b, c, d , e, f ) + aG (1, b, c, d , e, f ) = a ' G0 + aG1 G0 = b' G (0,0, c, d , e, f ) + bG (0,1, c, d , e, f ) = b' G00 + bG01 G1 = b' G (1,0, c, d , e, f ) + bG (1,1, c, d , e, f ) = b' G10 + bG11
G (a, b, c, d , e, f ) = a' b' G00 + a ' bG01 + ab' G10 + abG11
9.8 Field Programmable Gate Arrays
Fig 9-35. Function Expansion Using a Karnaugh Map
9.8 Field Programmable Gate Arrays
Fig 9-36. Realization of Five- and Six-Variable Functions with Function Generators