Professional Documents
Culture Documents
or alternately
“Timing is everything.”
© John Knight
Dig Cir p. 99 Revised; January 13, 2005 Slide 0
With Feedback
Latch
D Two inputs change at once
1/ Result: runt pulse may be captured
C 2
for a while
D
Two inputs change, D a hair early.
C 0
Result: new D captured
© John Knight
Dig Cir p. 101 Revised; January 13, 2005 Slide 1
© John Knight
Dig Cir p. 103 Revised; January 13, 2005 Slide 2
Setup time.........the interval before the clock where the data must stay stable.
Hold time ..........the interval after the clock where the data must stay stable.
© John Knight
Dig Cir p. 105 Revised; January 13, 2005 Slide 3
The restrictive time region around the clock edge is given two time specifications:
Setup time. . . . . . . . . .the interval before the clock where the data must not change.
Hold time . . . . . . . . . the interval after the clock where the data must not change.
© John Knight
Dig Cir p. 107 Revised; January 13, 2005 Slide 4
Synchronous Signals
The signals which travel around inside digital circuits are synchronous.
It is fairly easy to make them synchronous with a limited knowledge of circuit delays.
Asynchronous signals may happen when:
• Signals come in from off chip.
• Signals come from a circuit driven by another clock.
• Signals generated by using the clock for something other than latches or flip flops,
for example gates in the clock lead,
or driving the select on a mux from the clock.
tHOLD tHOLD
Din; Asynchronous
tCHQV
Q; Synchronous tCHQV
D in D Q CLOCK
CLOCK C
If Q changes,
its changes will be a synchronous.
© John Knight
Dig Cir p. 109 Revised; January 13, 2005 Slide 5
FIG. 1-7 One flip-flop feeding through logic into another flip-flop.
• Q1 takes tCHQV to get out of FF1.
• The propagation delay through the gate(s) is tPD.
• D2 must reach the FF2 at least tSETUP before the next clock edge.
tPD tSETUP
FF2
D1 Q1 Q2
D
D2
D tCLOCK ≥ tCHQV + tPD + tSETUP
C t CHQV C
tCLOCK
Alternative forms:
-
© John Knight
Dig Cir p. 111 Revised; January 13, 2005 Slide 6
© John Knight
Dig Cir p. 113 Revised; January 13, 2005 Slide 7
Fig. 1-9
© John Knight
Dig Cir p. 115 Revised; January 13, 2005 Slide 8
Hold-Time Violations
Hold problems can be cured by inserting a pair of inverters in the offending lead. Synthesizers will do this
automatically if the fix-hold option is specified.
Clock Skew.
Clock skew
When the clock edge does not reach all the flip-flops at the same time.
Positive skew
The data and clock are delayed in the same direction.
The right flip-flop receives the delayed clock.
D1 D Q1 D2 D Q2
tPD
C C
tSKEW
Fig. 1-10
Negative skew
The data and clock are delayed in opposite directions.
The right flip-flop receives the early clock.
D1 D Q1 D2 D Q2
tPD
C tSKEW C
Fig. 1-11
© John Knight
Dig Cir p. 117 Revised; January 13, 2005 Slide 9
Clock Skew.
FF1 FF2
D1 D D Q2
C C
tSKEW
CLOCK1 CLOCK2
tCLOCK
D1
tSKEW
CLOCK1
CLOCK2
Q2
tCLOCK + tSKEW
Fig. 1-12
© John Knight
Dig Cir p. 119 Revised; January 13, 2005 Slide 10
Clock Skew.
tCLOCK
D1 tSETUP
tSKEW
CLOCK1
CLOCK2
Q1
D2
tCHQV
tPD(MAX)
tSETUP
Q2
tCLOCK + tSKEW
Fig. 1-13
tCLOCK + tSKEW = tCHQV + tPD(MAX) + tSETUP
© John Knight
Dig Cir p. 121 Revised; January 13, 2005 Slide 11
Clock Skew.
D1
(a)
CLOCK1
Gate with
tCHQV
Q1 tPD<tPD(MIN)
Q1
tPD
D1
D tCHQV
tPD(MIN)
C tPD
tSKEW CLOCK2
© John Knight
Dig Cir p. 123 Revised; January 13, 2005 Slide 12
PROB 1.1 • FIND THE MAXIMUM DELAY IN THE CLOCK BUFFERS FOR THE SHIFT REGISTER SHOWN.
tCHQV=2 tCHQV=2
D1 Q1 tPD=0 D2 Q2 tPD=0 D3 Q3
D D D
tPD (Q to D) = 0 ns
C
tSKEW1-2 C tSKEW2-3 C
tCHQV = 2 ns max
CLOCK1 CLOCK2 CLOCK3 tHOLD = -1 ns min
Solution
For Q1 to D2 For Q2 to D3
tPD ≥ tHOLD + tSKEW - tCHQV tPD ≥ tHOLD + tSKEW - tCHQV
Delay CLOCK1 to CLOCK2
0 ≥ -1 + tSKEW1-2 - 2 0 ≥ -1 + tSKEW2-3 - 2 may be up to 3 ns.
tSKEW1-2 ≤ +3 tSKEW2-3 ≤ +3 Delay CLOCK1 to CLOCK3
may be up to6 ns.
tSKEW1-3 = tSKEW1-2 + tSKEW2-3 ≤ +6
Fig. 1-15
tCHQV=2 tCHQV=2
D1 D Q1 tPD=0 D2 D Q2 tPD=0 D3 D Q3 tPD (Q to D) = 0 ns
C C C tHOLD = -1 ns min
tSKEW tSKEW
CLOCK1 CLOCK2 CLOCK3 tCHQV = 2 ns max
tSKEW is negative that is
Solution tSKEW = -|tSKEW|
For Q1 to D2
tPD ≥ tHOLD + tSKEW - tCHQV
0 ≥ -1 - |tSKEW1-2| - 2
+3 ≥ - |tSKEW1-2|
+3 ≥ tSKEW1-2 > - tCLOCK Pos skew can be up to 3 ns.
Any negative skew up to a clock cycle is ok
© John Knight
Dig Cir p. 125 Revised; January 13, 2005 Slide 13
Shift Registers Should Have The Data Flow Opposite the Clock Flow
For tPD(MIN) (use “+” skew) For tPD(MAX) (use “-” skew)
tPD ≥ tHOLD + tSKEW - tCHQV tPD ≤ tCLOCK + tSKEW - tSETUP - tCHQV
© John Knight
Dig Cir p. 127 Revised; January 13, 2005 Slide 14
Q1 is the collective name for any or all outputs of the right-hand register.
D2 is the same for the inputs of the right-hand register.
Find tPD (MIN) and tPD (MAX).
tSKEW = tEDGE-CLOCK2 - tEDGE-CLOCK2
delay ≤ 3 |tSKEW| ≤ 3 ns
50 MHz tCLOCK = 20 ns
CLOCK1 CLOCK2
C1 C1 tHOLD = 0 ns min
D1 Q1 D2 Q2
1D COMBINATIONAL 1D tCHQV = 2 ns max
1D LOGIC 1D tSETUP = 4 ns max
delay ≤ 3 1D tPD(MIN) =? 1D
1D tPD(MAX) =? 1D
1D 1D
Solution:
For tPD(MIN) (use “+” skew) For tPD(MAX) (use “-” skew)
tPD ≥ tHOLD + tSKEW - tCHQV tPD ≤ tCLOCK + tSKEW - tSETUP - tCHQV
tPD(MIN) = 0 + 3 - 2 tPD(MAX) = 20 + (- 3) - 4 - 2
= 1 ns = 11 ns
Positive skew:
• allows longer logic delays
• forces the minimum delay to be longer.
Negative skew:
• allows a shorter minimum logic delay
• forces the maximum logic delays to be shorter.
tSKEW ≤ tCHQV
© John Knight
Dig Cir p. 129 Revised; January 13, 2005 Slide 15
(a) MU (b)
X INPUT 1D Q
1
1/1 1D Q ENABLE(H) C1
INPUT 1 G1 C1
CLOCK
ENABLE(H)
CLOCK
© John Knight
Dig Cir p. 131 Revised; January 13, 2005 Slide 16
INPUT Q EN
1D
EN Problem edge No problem Problem edge
C1
GCLK φlow
CLK CLK φhigh
GCLK
© John Knight
Dig Cir p. 133 Revised; January 13, 2005 Slide 17
INPUT Q Q EN
IN
1D 1D
EN EN GCLK
C1 C1 CLK
CLK CLK No!
GCLK
IN Q INPUT (a) Q
1D
EN
1D
EN GCLK EN
C1 C1 CLK No!
CLK
CLK GCLK
© John Knight
Dig Cir p. 135 Revised; January 13, 2005 Slide 18
FIG. 1-1 False clock edges, when the first half-clock-cycle is restricted
Restricted Region
(a) EN
IN 1D Q
EN GCLK C1 CLK φhigh No upward transitions
CLK
allowed in the restricted
GCLK
region ( φhigh).
OK edge False False
Restricted Region
(b)
IN 1D Q EN_N
EN_N GCLK C1 No downward transitions
CLK φlow
CLK allowed in the restricted
region ( φlow).
GCLK
OK edge False OK
Restricted Region
GCLK
False OK
OK edge
Restricted Region
EN No downward transitions
INPUT Q
allowed in the restricted
1D
EN
CLK φhigh region (φhigh).
C1
CLK GCLK
GCLK
False False
OK edge
© John Knight
Dig Cir p. 137 Revised; January 13, 2005 Slide 19
INPUT Q Q
1D EN 1D
EN EN_N
C1 C1
CLK CLK
Q EN Q
1D 1D
EN_N EN
C1 C1
CLK CLK
© John Knight
Dig Cir p. 139 Revised; January 13, 2005 Slide 20
TRANSPARENT COMB
SHUT LATCH LOGIC 1D Q1
DOWN Q3 EN
LOGIC 1D C1
EN-RAW GCLK
C1
CLK 1D Q2
GCLK
C1
© John Knight
Dig Cir p. 141 Revised; January 13, 2005 Slide 21
GCLK
CLK LATCH 1D Q2
GCLK ENABLED
C1
© John Knight
Dig Cir p. 143 Revised; January 13, 2005 Slide 22
Multiple Clocks
Why Two Clock Frequencies?
The internal clock for (Pentium, Alpha, Power PC, Spark, Xeon) is too fast for the board circuitry.
With both slow and fast logic, save power by using a slow clock for the slow logic.
Basic Methods
Enabled Flip-Flops 1D
• Clock all flip-flops at high-speed and enable the flip-flops at a lower speed. EN
Is the safest (easiest) method. C1
Will not give much power saving.
Gate Clock
INPUT Q
• Gate the high-speed clock with a slower signal. 1D
Will give medium power reduction. EN
C1
Will use less power in the flip-flops, CLK
But:
Charging and discharging the clock line at high speed wastes power.
Gated clock are subject to false edges and skew.
Divide the clock
• Divider can supply different frequencies to different flip-flops.
Can give lower power. Q
But:- 1D
Watch skew between the main and divided clocks. CLK C1
Divider/counters may glitches which will poison clock lines. CLK/2
Q
© John Knight
Dig Cir p. 145 Revised; January 13, 2005 Slide 23
Multiple Clocks
Why not to use multiple clocks
• It saves having to make multiple clock distribution networks on chip.
These networks take a lot of space and are difficult to layout.
• It saves having to keep active edges synchronized within some small skew.
Why use multiple clocks
• Clocking flip flops faster than necessary for the data rate, wastes power.
• If two data rates are completely asynchronous, and their data rates are near the maximum clock speed
desired for the chip, it may be necessary to clock the data streams at their own clock rate.