Beruflich Dokumente
Kultur Dokumente
! Regular logic
" Programmable Logic Arrays " Multiplexers/Decoders " ROMs
Random Logic Full Custom Design
AND array
product terms
OR array
outputs
CS 150 - Fall 2005 Lec. #3: Programmable Logic - 2
Enabling Concept
! Shared product terms among outputs
example: F0 F1 F2 F3 = = = = A + A C' B' C' B' C B' C' + AB + AB + A input side: 1 = uncomplemented in term 0 = complemented in term = does not participate F2 1 0 0 1 0 F3 0 1 0 0 1 output side: 1 = term connected to output 0 = no connection to output reuse of terms
C 1 0 0
Before Programming
! All possible connections available before "programming"
" In reality, all AND and OR gates are NANDs
After Programming
! Unwanted connections are "blown"
" Fuse (normally connected, break unwanted ones) " Anti-fuse (normally disconnected, make wanted connections)
A B C
F0
F1
F2
F3
AB+A'B' CD'+C'D
CS 150 - Fall 2005 Lec. #3: Programmable Logic - 6
F1 F2 F3 F4 F5 F6
K-map for W
A 0 0 C 1 1 1 1 1 1 B X X X X 0 0 X X D
K-map for X
A 0 1 C 0 1 0 0 1 0 B X X X X 1 0 X X D
K-map for Y
K-map for Z
minimized functions: W=A+BD+BC X = B C' Y=B+C Z = A'B'C'D + B C D + A D' + B' C D' not a particularly good candidate for PLA implementation since no terms are shared among outputs however, much more compact and regular implementation when compared with discrete AND and OR gates
K-map for W
A 0 0 C 1 1 1 1 1 1 B X X X X 0 0 X X D
K-map for X
A 0 1 C 0 1 0 0 1 0 B X X X X 1 0 X X D
minimized functions: W= X= Y= Z=
K-map for Y
CS 150 - Fall 2005 Lec. #3: Programmable Logic - 10
K-map for Z
K-map for W
A 0 0 C 1 1 1 1 1 1 B X X X X 0 0 X X D
BC
K-map for X
A 0 1 0 0 1 0 B X X X X 1 0 X X D
minimized functions: W= X= Y= Z=
C 0 1
K-map for Y
CS 150 - Fall 2005 Lec. #3: Programmable Logic - 11
K-map for Z
A B
K-map for EQ
A 0 1 C 1 1 0 0 1 1 B 0 0 0 0 0 0 1 0 D
K-map for NE
A 0 0 C 0 0 1 0 0 0 B 1 1 0 1 1 1 0 0 D
K-map for LT
K-map for GT
CS 150 - Fall 2005 Lec. #3: Programmable Logic - 12
EQ NE LT GT
multiplexer
demultiplexer
4x4 switch
Multiplexers/Selectors
! Multiplexers/Selectors: general concept
" 2n data inputs, n control inputs (called "selects"), 1 output " Used to connect 2n points to a single point " Control signal pattern forms binary index of input connected to output I I A Z
Z = A' I 0 + A I 1 A 0 1 Z I0 I1 0 0 0 0 1 1 1 1
1
functional form logical form two alternative forms for a 2:1 Mux truth table
CS 150 - Fall 2005 Lec. #3: Programmable Logic - 14
0 0 1 1 0 0 1 1
0 1 0 1 0 1 0 1
0 0 1 0 0 1 1 1
Multiplexers/Selectors (cont'd)
! 2:1 mux: ! 4:1 mux: ! 8:1 mux: Z = A' I0 + A I1 Z = A' B' I0 + A' B I1 + A B' I2 + A B I3 Z = A'B'C'I0 + A'B'CI1 + A'BC'I2 + A'BCI3 + AB'C'I4 + AB'CI5 + ABC'I6 + ABCI7
2 n -1 k=0
! In general, Z = !
(mkIk)
I0 I1 I2 I3 I4 I5 I6 I7
I0 I1
2:1 mux A
I0 I1 I2 I3
4:1 mux A B
8:1 mux
A B C
Cascading Multiplexers
! Large multiplexers implemented by cascading smaller ones
I0 I1 I2 I3 I4 I5 I6 I7 4:1 mux 8:1 mux 2:1 mux 4:1 mux Z I0 I1 I2 I3 A I4 I5 I6 I7 alternative implementation 2:1 mux 2:1 mux 2:1 mux 2:1 mux C A B 8:1 mux
B C
4:1 mux
control signals B and C simultaneously choose one of I0, I1, I2, I3 and one of I4, I5, I6, I7 control signal A chooses which of the upper or lower mux's output to gate to Z
! Example:
" F(A,B,C) = m0 + m2 + m6 + m7 = A'B'C' + A'BC' + ABC' + ABC = A'B'(C') + A'B(C') + AB'(0) + AB(1)
1 0 1 0 0 0 1 1 0 1 2 3 4 8:1 MUX 5 6 7 S2 S1 S0 A B C
1 D 0 1 D D D D
0 1 2 3 4 8:1 MUX 5 6 7 S2 S1 S0 A B C
Announcements
! We took everyone on the wait list into the class
" Result is that Tu labs are very crowded! " Th night lab is very light -- think of switching to get more TA face time! " Send email to pokai@berkeley.edu to request a lab change
! Second HW on class web site ! Use ucb.class.cs150 newsgroup for lab, hw, course questions!
Demultiplexers/Decoders
! Decoders/demultiplexers: general concept
" Single data input, n control inputs, 2n outputs " Control inputs (called selects (S)) represent binary index of output to which the input is connected " Data input usually called enable (G)
1:2 Decoder: O0 = G S O1 = G S O0 O1 O2 O3 2:4 Decoder: = G S1 = G S1 = G S1 = G S1 S0 S0 S0 S0 O0 O1 O2 O3 O4 O5 O6 O7 = = = = = = = = 3:8 Decoder: G S2 S1 S0 G S2 S1 S0 G S2 S1 S0 G S2 S1 S0 G S2 S1 S0 G S2 S1 S0 G S2 S1 S0 G S2 S1 S0
demultiplexer generates appropriate minterm based on control signals (it "decodes" control signals)
Enable
F2
F3
A B C D
CS 150 - Fall 2005 Lec. #3: Programmable Logic - 23
Cascading Decoders
! 5:32 decoder
" 1x2:4 decoder " 4x3:8 decoders
0 2:4 DEC 1 2 S1 S0 3 A B 0 1 2 3:8 DEC 3 4 5 6 7 S2 S1 S0 A'B'C'D'E' 0 1 2 3:8 DEC 3 4 5 6 7 S2 S1 S0
A'BC'DE'
0 1 2 3:8 DEC 3 4 5 6 7 S2 S1 S0 C D E
ABCDE
0 1 2 3:8 DEC 3 4 5 6 7 S2 S1 S0 C D E
AB'C'D'E'
AB'CDE
Read-only Memories
! Two dimensional array of 1s and 0s
" Entry (row) is called a "word" " Width of row = word-size " Index is called an "address" " Address is input " Selected word is output
n 2 -1 i decoder j 0 internal organization 0 n-1 Address bit lines (normally pulled to 1 through resistor !selectively connected to 0 by word line controlled switches) word[i] = 0011 word[j] = 1010 1 1 1 1 word lines (only one is active !decoder is just right for this)
truth table
ROM Structure
! Similar to a PLA structure but with a fully decoded AND array
" Completely flexible OR array (unlike PAL)
n address lines inputs
decoder
2n word lines
! PLA
" Wires to connect inputs and outputs to logic blocks " Special logic blocks at periphery of device for external connections " How to make logic blocks programmable? " How to connect the wires? " After the chip has been fabbed
CS 150 - Fall 2005 Lec. #3: Programmable Logic - 29
! Key questions:
Tradeoffs in FPGAs
! Logic block - how are functions implemented: fixed functions (manipulate inputs) or programmable?
" Support complex functions, need fewer blocks, but they are bigger so less of them on chip " Support simple functions, need more blocks, but they are smaller so more of them on chip
! Interconnect
" How are logic blocks arranged? " How many wires will be needed between them? " Are wires evenly distributed across chip? " Programmability slows wires down !are some wires specialized to long distances? " How many inputs/outputs must be routed to/from each logic block? " What utilization are we willing to accept? 50%? 20%? 90%?
CS 150 - Fall 2005 Lec. #3: Programmable Logic - 30
! Built-in fast carry logic ! Can be used as memory ! Three types of routing
" direct " general-purpose " long lines of various lengths
IOB
IOB
CLB
CLB
Wiring Channels
IOB
IOB
! RAM-programmable
CLB
CLB
! Example
" 2-bit comparator: A B = C D and A B > C D implemented with 1 CLB (GT) F = A C' + A B D' + B C' D' (EQ) G = A'B'C'D'+ A'B C'D + A B'C D'+ A B C D
CLB
A3 B3
CLB
CLB
CLB
CLB
Cout
S3
C2
S2
C1
S1
C0
A3 B3 A2 B2
A1 B1 A0 B0 Cin
CLB S3 Cout
S2
CLB S1 C2
S0
" Multiplexers/decoders
# Multipoint connections for signal routing # Lookup Tables
" ROMs
# Truth table in hardware