Академический Документы
Профессиональный Документы
Культура Документы
• Introduction to CA
• Role of CA in designs
• Performance Issues
• Now … Review of some DLD Concepts
Gate Level Components
Name Symbol VHDL Equation Truth Table
A X X <= A and B A B X
AND B
0 0 0
0 1 0
1 0 0
1 1 1
A X X <= A or B A B X
OR B
0 0 0
0 1 1
1 0 1
1 1 1
A X X <= A xor B A B X
XOR B
0 0 0
0 1 1
1 0 1
1 1 0
Boolean Algebra
• Logic -> Truth value of set of statements
• Algebra -> Mathematical Manipulation of
set of statements
• Boolean Algebra
• 0, 1, OR, NOT
• AND, IMPLICATION
Definitions
• Associativity
• Commutativity
• Complement
• Idempotency
• De Morgan’s
Logic Simplification
Boolean Algebra
Complicated
Accident Prone
Only way when the number of variables > 5
Karnaugh Map
Graphical - Pictorial
Simple when the number of variables <= 5
Map Simplification
B BC
A 0 1 00 01 11 10
A
0 (A,B) (A,B)
0 (A,B,C) (A,B,C) (A,B,C) (A,B,C)
=0 =1 =0 =1 =3 =2
1 (A,B) (A,B)
1 (A,B,C) (A,B,C) (A,B,C) (A,B,C)
=2 =3 =4 =5 =7 =6
CD
AB 00 01 11 10
00 (A,B,C,D) (A,B,C,D) (A,B,C,D) (A,B,C,D)
=0 =1 =3 =2
01 (A,B,C,D) (A,B,C,D) (A,B,C,D) (A,B,C,D)
=4 =5 =7 =6
(A,B,C,D) (A,B,C,D) (A,B,C,D) (A,B,C,D)
11 = 12 = 13 = 15 = 14
(A,B,C,D) (A,B,C,D) (A,B,C,D) (A,B,C,D)
10 = 8 =9 = 11 = 10
Map Simplification Example
A B C D X CD
0 0 0 0 0 AB 00 01 11 10
0 0 0 1 1
00
0 0 1 0 1
0 0 1 1 1
0 1 0 0 0 01
0 1 0 1 0
0 1 1 0 1 11
0 1 1 1 1
1 0 0 0 0 10
1 0 0 1 1
1 0 1 0 1
1 0 1 1 1
1 1 0 0 1
1 1 0 1 0
1 1 1 0 0
1 1 1 1 1
=> X = sum(1,2,3,6,7,9,10,11,12,15)
Circuits
• Combinational Circuits
– For given Inputs, Unique Output
– Memory less, No Feedback
– Propagation Delay <-> Input to Output
• Sequential Circuits
– Maintains a “State”
– Output dependent on Inputs and State
– Time Dependent Behavior
Combinatorial Circuit Example- Half-adder
Function table:
A B Sum Carry-out
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
Logic diagram:
VHDL Code:
HALF_ADDER: process (A,B)
A Sum begin
B
Sum <= A xor B;
Carry_out <= A and B;
Carry-out
end process HALF_ADDER;
Combinatorial Circuit Example- Full-adder
Function table:
A
B
CI Sum
Carry-out
VHDL Code:
Function table:
I2 I1 I0 Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0
0 0 0 0 0 0 0 0 0 0 1
0 0 1 0 0 0 0 0 0 1 0
0 1 0 0 0 0 0 0 1 0 0
0 1 1 0 0 0 0 1 0 0 0
1 0 0 0 0 0 1 0 0 0 0
1 0 1 0 0 1 0 0 0 0 0
1 1 0 0 1 0 0 0 0 0 0
1 1 1 1 0 0 0 0 0 0 0
Combinatorial Circuit Example- Decoder
VHDL Code:
Function table:
I7 I6 I5 I4 I3 I2 I1 I0 Y2 Y1 Y0
0 0 0 0 0 0 0 1
0 0 0 0 0 0 1 0
0 0 0 0 0 1 0 0
0 0 0 0 1 0 0 0
0 0 0 1 0 0 0 0
0 0 1 0 0 0 0 0
0 1 0 0 0 0 0 0
1 0 0 0 0 0 0 0
Combinatorial Circuit Example- Encoder
VHDL Code:
SR flip-flops have two inputs, set and reset, that act as follows:
Q_last <= Q;
Flip-Flop Types - JK
Truth Table:
J K C Q
x x 0 Q_last
x x 1 Q_last
0 0 Q_last
0 1 0
1 0 1
1 1 /Q_last
Flip-Flop Types - JK
Symbolic representation: VHDL code:
JK_FF : process (C)
begin
J Q if (C’event and (C = ‘1’)) then
K if ((J = ‘0’) and (K = ‘0’)) then
Q <= Q_last;
C elsif ((J = ‘1’) and (K = ‘0’)) then
Q <= ‘1’;
elsif ((J = ‘0’) and (K = ‘1’)) then
Q <= ‘0’;
else
Q <= not Q_last;
end if;
end if;
end process JK_FF;
Q_last <= Q;
Flip-Flop Types - D
D flip-flops have one input, data, that act as follows:
Truth Table:
D C Q
x 0 Q_last
x 1 Q_last
0 0
1 1
Flip-Flop Types - D
Truth Table:
T C Q
x 0 Q_last
x 1 Q_last
0 Q_last
1 / Q_last
Flip-Flop Types - T
Q_last <= Q;
Registers
D
Q(n-1..0)
SHIFT
Truth table:
Q_last <= Q;
Counters
State Diagram:
CNT
CNT CNT
001 010
000 011
CNT CNT
111 100
CNT
CNT 110 101
CNT
Counters - Example: 3-bit Binary Up Counter
Truth Table: Counter Design:
CNT C Q_last Q Bit Q(0) Toggles on every
x 0 xxx Q_last CNT = 1
x 1 xxx Q_last
0 xxx Q_last Bit Q(1) Toggles on every
1 000 Q_last+1 CNT = 1 and
1 ... Q_last+1 Q(0) = 1
1 110 Q_last+1
1 111 000 Bit Q(2) Toggles on every
CNT = 1 and
State Diagram: Q(0) = 1
CNT Q(1) = 1
CNT CNT
001 010
000 011
CNT CNT
111 100
CNT
CNT 110 101
CNT
Counters - Example: 3-bit Binary Up Counter
Logic Diagram (one design): Logic Diagram (another design):
CNT Q(0)
T Q CNT Q(0)
T Q
Q(1)
T Q Q(1)
T Q
Q(2)
T Q Q(2)
T Q
C
C
Q_last <= Q;
Sequential Circuits
Since all loops have a flip-flop in them, this will leave the remaining
circuit without loops, and hence combinational.
Structural
Logic diagram
Excitation Equations
Logical equations for the flip-flop inputs as a function
of current flip-flop states and circuit input signals
Output equations
Logical equations for circuit outputs as a function of
current flip-flop states and circuit inputs signals
Sequential Circuit Descriptions
Behavioral
Transition and output equations
Logical equations for next flip-flop states and circuit
outputs in terms of current flip-flop states and circuit
input signals
Transition table
Two-dimensional truth table of transition and output
equations
State table
Transition table with the states given descriptive names
UP DN Q Q_next UP DN Q Q_next
Sequential Circuit Description- Example
Q_next(1) = Q_next(0) =
Q(1..0) Q(1..0)
UP DN 00 01 11 10 UP DN 00 01 11 10
00 00
01 01
11 11
10 10
Sequential Circuit Timing
tPNI
CLK_ext
tSU_E tHD_E
D_int
tPFF
Q_int
tPNO
Q_ext
tP
Maximum Clock Frequency
tPFF tPN
D1 Q1 Combinatorial D2 Q2
D Q D Q
Logic Delay
Skew Between C1
Clocks
C1 tSKEW
Maximum Clock Frequency
Consider the following timing diagram:
tPER
C1
tSKEW tSKEW
tPER = tPFF + tPN
C2
+ tSU + tSKEW
tPFF
Q1
tPN tSU
D2
Note the skewing C1 after C2 is the worst case. If the skew had delayed
C2 after C1, it would have increased the maximum clock
frequency.
Maximum Clock Skew
tPFF tPN
D1 Q1 Combinatorial D2 Q2
D Q D Q
Logic Delay
Skew Between C1
Clocks
C1 tSKEW
Maximum Clock Skew
Consider the same timing diagram as above:
C1
tSKEW tHD
tSKEW = tPFF + tPN - tHD
C2
tPFF
Q1
tPN
D2
Note the skewing C2 after C1 is the worst case. If the skew had
delayed C1 after C2, it would have increased the maximum clock
skew allowed.
Summary
• Review of DLD
• Combinational & Sequential Circuits
• Basic Timing definitions in Circuits