Professional Documents
Culture Documents
Jin-Fu Li Advanced Reliable Systems (ARES) Laboratory Department of Electrical Engineering National Central University Jhongli, Taiwan
Outline
Introduction Datapath Operators Control Structures
System-Level Hierarchy
System (Top) Complex units (cores) Simple Components Logic Circuits Silicon
Categories of Components
Types of digital component
Datapath operators Memory elements Control structures I/O cells
Tradeoff of selection
Speed Density Programmability Easy of design etc
Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 4
Datapath Adder
C 0 0 0 0 1 1 1 1 A 0 0 1 1 0 0 1 1 B 0 1 0 1 0 1 0 1 Adder Truth Table A.B(G) A+B(P) A B 0 0 0 1 0 0 0 1 0 1 1 1 0 1 1 1 0 1 1 0 0 1 1 1 SUM CARRY 0 1 1 0 1 0 0 1 0 0 0 1 0 1 1 1
CARRY
B G P C
Generate Signal G(A.B): occurs when a carry output (CARRY) is internally generated within the adder .
Propagate Signal P(A+B): when it is true, the carry in signal C is passed to the carry output (CARRY) when C is true
Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU
SUM
Datapath Adder
SUM=A B C CARRY=AB+AC+BC Single-bit schematic of SUM A B C -C -A -B B -A SUM C A A A A C -A B -B -A -C SUM
Datapath Adder
Single-bit schematic of CARRY A B
C A B
CARRY
-C -A -B
CARRY
Datapath Adder
Optimized combinational adder schematic Ci+1=AiBi+AiCi+BiCi Si=(Ai+Bi+Ci).Ci+1+AiBiCi Ai Bi Ci Ci+1 Ci Bi Ai Vss
Jin-Fu Li, EE, NCU 8
Vdd
Ci+1
Si
Si
Datapath Adder
Symmetrical optimized combinational adder schematic
A A Ci A B B A B B A Cout A Cout A B Ci B Ci Ci B A B S
C<n+1> B<n> A<n> C<n> C<3> B<3> S<3> A<3> B<2> S<2> A<2> B<1> S<1> A<1> B<0> S<0> A<0> Cin
10
S<n>
C<3> S<3>
S<0>
Cout 01 10 A
addend
01101 01001
B
11 0 10011001 0 01101 1 01 00 10 1
augend
Result
Cin
12
B<3>
S<3>
B<2>
S<2>
B<1>
S<1>
CPA Adder
Feature
The Carry of each bit is generated from the propagate and the generate signals as well as the input carry The propagate and the generate signals are derived from the operand Ai and Bi by Gi=Ai.Bi Pi=Ai+Bi
Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 14
4-bit CLA
CLG1 C1 SG1
CLG2 C2 SG2
CLG3 C3 SG3
CLG4 C4 SG4
S0
Advanced Reliable Systems (ARES) Lab.
S1
Jin-Fu Li, EE, NCU
S2
S3
15
G0 C0 P0 G0 P0 C1
16
C4
18
Pi Ci Ci+1 Gi
Pi Ci Clk
C4
P3 G3
P2 G2
P0
Clk C0
C4
C3
C2
C1
Jin-Fu Li, EE, NCU
P 7 P 6 P 5 P 4 P 3 P 2 P1 P 0 C
n-bit adder
[i+3]
[i]
4-bit CLG
Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 20
G[i,i+3]=Gi+3+Pi+3Gi+2+Pi+3Pi+2Gi+1+Pi+3Pi+2Pi+1Gi P[i,i+3]=Pi+3Pi+2Pi+1Pi
21
Carry-skip logic
Generalization
P[i,i+3]=Pi+3Pi+2Pi+1Pi Carry=Ci+4+P[i,i+3]Ci
Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 22
4-bit adder U1 s6 s5
4-bit adder U0 s6 s5
b3 a3
1 0 MUX 1 0 MUX 1 0 MUX 1 0 MUX 1 0 MUX
b2 a2
b1 a1
b0 a0 c0
c4
4-bit adder L
c8
s7
s6
s5
s4
23
Conditional cell S0 S1 C0 C1
Conditional cell S0 S1 C0 C1
Conditional cell S0 S1 C0 C1
Conditional cell S0 S1 C0 C1
C0=Cin S0 S1 S2 S3 C4
24
25
Datapath Multipliers
Bit-level multiplier
a b 0 0 1 1 0 1 0 1 axb 0 0 0 1 a b axb
a3b3 p7 p6
a3b2 a2b3 p5
p1
p0
26
Datapath Multipliers
The product axb is given by the 8-bit result p=p7p6p5p4p3p2p1p0 The ith product term pi can be expressed as
pi
i jk
a b
j k
ci 1
(a3 p7 p6
(a3 a2 p5
27
Datapath Multipliers
Using a product register for multiplication
7 6 5 4 3 2 1 0 Product register (axb0)20 (axb1)21 (axb2)22 (axb3)23
28
Datapath Multipliers
Shift-right multiplication sequence
add (axb0) shift right a3b0 a2b0 a1b0 a0b0 a3b0 a2b0 a1b0 a0b0 cx a3b0 a2b0 a1b0 a0b0 a3b1 a2b1 a1b1 a0b1 ab ab ab ab cx a b a3b0 a2b0 a1b0 0 0 2 1 0 1 3 1 1 1 a3b0 a2b0 a1b0 a0b0 a3b1 a2b1 a1b1 a0b1 a2b2 a1b2 a0b2 a3b0 a2b0 a1b0 a0b0 a3b1 a2b1 a1b1 a0b1 a3b2 a2b2 a1b2 a0b2 a3b0 a2b0 a1b0 a0b0 a3b1 a2b1 a1b1 a0b1 a3b2 a2b2 a1b2 a0b2 a3b3 a2b3 a1b3 a0b3
Jin-Fu Li, EE, NCU 29
cy
a3b2 cy
n
Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 30
X Xi 2
i 0
n1
Y Yj 2 j
j 0
n 1 i 0 n 1
n 1
P X Y X i 2 Yj 2 j
i j 0
Advanced Reliable Systems (ARES) Lab.
i0 n n 1
n 1
n 1 j0
( X iY j ) 2 i j
k 0
Pk 2 k
31
Y1 P0 Y2 P1 Y3 P2
P3 P7 P6 P5 P4
Jin-Fu Li, EE, NCU 32
X0Y1
P7
P6
P5
P4
P3
P2
P1
P0
33
yi yi 1 yi 2
0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1
Pj+1 Adder/substractor
Pj 0
Advanced Reliable Systems (ARES) Lab.
Mux x
sel 2x
1 0
1 0 1 0 1 0 1 0 1
0 1 0 1 1
Final Addition
38
FA
s
Cin Cout
s
Cin
FA
FA
FA
FA
c s c
FA
s
Outputs
39
1. Require MN clock cycles to produce a product for an N-bit multiplier and a M-bit multiplicand
40
S0 D
S1 D
S2 D
1. Require M+N clock cycles to produce a product for an N-bit multiplier and a M-bit multiplicand 2. The critical path consists of the adders
41
Control FSM
Moore
input clk
output
Mealy
input clk
Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU
output
42
Control FSM
FSM design procedure Draw the state-transition diagram Check the state diagram Write state equations (Write HDL) An example of state-transition diagram
R -A IDLE A -A EXIT C A
Advanced Reliable Systems (ARES) Lab.
WAIT
-C
Jin-Fu Li, EE, NCU
43
Control FSM
Check the state-transition diagram Ensure all states are represented, including the IDLE state Check that the OR of all transitions leaving a state is TRUE. This is a simple method of determining that there is a way out of a state once entered. Verify that the pairwise XOR of all exit transitions is TRUE. This ensures that there are not conflicting conditions that would lead to more than one exittransition becoming active at any time. Insert loops into any state if it is not guaranteed to otherwise change on each cycle. Formal FSM verification method Perform conformance checking
Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 44
EXIT: if (car_in==11) begin next_state=EXIT; green=1b1; end else begin next_state=IDEL; green=1b0; end default: begin next_state=IDLE; green=1b0; end endcase end endmodule
45
Control PLA
Structure of a PLA
Minterms
AND array
OR array
f0
f1
f2
f3
f i mi ( a, b, c, d )
i
f1 a b c d a b c d a b c d
Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 46
Control PLA
Fuse-programmable PLA
Fuse
f0
Jin-Fu Li, EE, NCU
f1
f2
f3
47
Control PLA
Logic gate diagram of a PLA
f0
Jin-Fu Li, EE, NCU
f1
f2
f3
48