Professional Documents
Culture Documents
Archl FSM 04
Archl FSM 04
Computer Architecture
CS2201 - 2021I
1
PROF.: JGONZALEZ@UTEC.EDU.PE
Executive Summary
2
Introduction
Conclusions
Introduction
Conclusions
Critical Path
A n1
B
n2
C
D Y
R1 R2
(a)
Tc
CLK
Q1
D2
(b)
COMPUTER SCIENCE DEPARTMENT
Timing Analysis: Setup Time
12
• Depends on the maximum delay from register R1 through combinational logic
to R2
• The input to register R2 must be stable at least tsetup before clock edge
CLK CLK
Q1 CL D2
Tc ≥
R1 R2
Tc
CLK
Q1
D2
tpcq tpd tsetup
COMPUTER SCIENCE DEPARTMENT
Setup Time Constraints
13
• Depends on the maximum delay from register R1 through combinational logic
to R2
• The input to register R2 must be stable at least tsetup before clock edge
CLK CLK
Q1 CL D2
Tc ≥ tpcq + tpd + tsetup
R1 R2
Tc
CLK
Q1
D2
tpcq tpd tsetup
COMPUTER SCIENCE DEPARTMENT
Setup Time Contraints
14
• Depends on the maximum delay from register R1 through combinational logic
to R2
• The input to register R2 must be stable at least tsetup before clock edge
CLK CLK
Q1 CL D2
Tc ≥ tpcq + tpd + tsetup
R1 R2
Tc tpd ≤ Tc – (tpcq + tsetup)
CLK
R1 R2
thold <
CLK
Q1
D2
tccq tcd
t
hold DEPARTMENT
COMPUTER SCIENCE
Hold Time Constraints
16
• Depends on the minimum delay from register R1 through the combinational
logic to R2
• The input to register R2 must be stable for at least thold after the clock edge
CLK CLK
Q1 CL D2
R1 R2
thold < tccq + tcd
CLK
Q1
D2
tccq tcd
t
hold DEPARTMENT
COMPUTER SCIENCE
Hold Time Constraints
17
• Depends on the minimum delay from register R1 through the combinational
logic to R2
• The input to register R2 must be stable for at least thold after the clock edge
CLK CLK
Q1 CL D2
R1 R2
thold < tccq + tcd
tcd > thold - tccq
CLK
Q1
D2
tccq tcd
t
hold DEPARTMENT
COMPUTER SCIENCE
Example: Timing Analysis
18
CLK CLK Timing Characteristics
A tccq = 30 ps
tpcq = 50 ps
B tsetup = 60 ps
thold = 70 ps
X' X
C
per gate
tpd = 35 ps
Y' Y
D tcd = 25 ps
tpd = 3 x 35 ps = 105 ps
tcd = 25 ps Hold time constraint:
Setup time constraint: tccq + tcd > thold ?
Tc ≥ ?
per gate
tpd = 35 ps
Y' Y
D tcd = 25 ps
tpd = 3 x 35 ps = 105 ps
tcd = 25 ps
Setup time constraint: Hold time constraint:
Tc ≥ (50 + 105 + 60) ps = 215 ps tccq + tcd > thold ?
fc = 1/Tc = 4.65 GHz
(30 + 25) ps > 70 ps ? No!
per gate
tpd = 35 ps
Y' Y
D tcd = 25 ps
tpd = 3 x 35 ps = 105 ps
tcd = 2 x 25 ps = 50 ps Hold time constraint:
Setup time constraint: tccq + tcd > thold ?
Tc ≥ ?
per gate
C
X' X thold = 70 ps
Y' Y tpd = 35 ps
D
tcd = 25 ps
tpd = 3 x 35 ps = 105 ps
tcd = 2 x 25 ps = 50 ps Hold time constraint:
Setup time constraint: tccq + tcd > thold ?
Tc ≥ (50 + 105 + 60) ps = 215 ps
(30 + 50) ps > 70 ps ? Yes!
fc = 1/Tc = 4.65 GHz
CLK
R1 R2
Tc
CLK1
Tc ≥ ?
CLK2
Q1
D2
R1 R2
Tc
CLK1
Tc ≥ tpcq + tpd + tsetup + tskew
CLK2
Q1
D2
R1 R2
Tc
CLK1
Tc ≥ tpcq + tpd + tsetup + tskew
CLK2 tpd ≤ Tc – (tpcq + tsetup + tskew)
Q1
D2
R1 R2
CLK1
CLK2
Q1
D2
tccq tcd
tskew thold
R1 R2
CLK1
D2
tccq tcd
tskew thold
R1 R2
CLK1
tskew thold
Case I
CLK
button
Q
D
Q
D
Case II
Q
Case III
???
Q
D
D Q
tsetup thold
ta
• Setup time (tsetup): time before the clock edge that data must be
stable (i.e. not changing)
• Hold time (thold): time after the clock edge that data must be
stable
• Aperture time (ta): time around clock edge that data must be
stable (ta = tsetup + thold)
COMPUTER SCIENCE DEPARTMENT
Metastability
34
• Bistable devices: two stable states, and a metastable state between them
• Flip-flop: two stable states (1 and 0) and one metastable state
• If flip-flop lands in metastable state, could stay there for an undetermined
amount of time
metastable
stable stable
CLK
Q Non-deterministic
Convergence
Metastability
Source: W. J. Dally, Notes from Lecture 13: Metastability and Synchronization Failure (When
COMPUTER SCIENCE DEPARTMENT
Good Flip-Flops go Bad) 11/9/2005.
Flip Flop Analysis
36
• Flip-flop has feedback: if Q is somewhere between 1 and 0, cross-coupled
gates drive output to either rail (1 or 0)
R
N1 Q
N2 Q
S
Introduction
Conclusions
The output Y is HIGH for one clock cycle out of every 3. In other
words, the output divides the frequency of the clock by 3.
parameter S0 = 2'b00;
parameter S1 = 2'b01;
parameter S2 = 2'b10;
S’ S
Next Current
State State
// state register
always @ (posedge clk, posedge reset)
if (reset) state <= S0;
else state <= nextstate;
// output logic
assign q = (state == S0);
• Alyssa P. Hacker has a snail that crawls down a paper tape with 1’s and 0’s
on it.
• The snail smiles whenever the last four digits it has crawled over are
1101.
• Design Moore and Mealy FSMs of the snail’s brain.
Moore
Mealy
COMPUTER SCIENCE DEPARTMENT
Implementing FSM Example 2: Definitions
45
module SmilingSnail (input clk,
input reset,
input number,
output smile);
parameter S0 = 2'b00;
parameter S1 = 2'b01;
parameter S2 = 2'b10;
parameter S3 = 2’b11;
number/smile
// state register
always @ (posedge clk, posedge reset)
if (reset) state <= S0;
else state <= nextstate;
// output logic
assign smile = (number & state == S3);
endmodule
Introduction
Conclusions
CS2201 - 2021I 5
2
PROF.: JGONZALEZ@UTEC.EDU.PE