Lecture 16 n Timing Terminology Timing issues Asynchronous

  • Slides: 18
Download presentation
Lecture 16 n Timing ¡ ¡ ¡ Terminology Timing issues Asynchronous inputs 1

Lecture 16 n Timing ¡ ¡ ¡ Terminology Timing issues Asynchronous inputs 1

Terminology n n Setup time tsu: Amount of time the input must be stable

Terminology n n Setup time tsu: Amount of time the input must be stable before the clock transitions high (or low for negativeedge triggered FF) Hold time th: Amount of time the input must be stable after the clock transitions high (or low for negativeedge triggered FF) 2

Terminology n n Clock width tw : Minimum clock width that must be met

Terminology n n Clock width tw : Minimum clock width that must be met in order for FF to work properly Propagation delays tp-lh and tp-hl: Delay between clocking event and change in output (high to low, low to high) ¡ Longer than hold time 3

Terminology D CLK Q tsu th tw tp-hl 4

Terminology D CLK Q tsu th tw tp-hl 4

Cascading flip-flops IN D Q > Q 0 D Q Q 1 > In

Cascading flip-flops IN D Q > Q 0 D Q Q 1 > In tsu Q 0 tp-lh CLK Q 1 Order can’t be reversed else Q 1 will not have its required hold time Clk th tp-hl , tp-lh > th tp + tsu < tcycle 5

Cascading flip-flops n Flip-flop propagation delays exceed hold times ¡ Second stage commits input

Cascading flip-flops n Flip-flop propagation delays exceed hold times ¡ Second stage commits input before Q 0 changes 6

System considerations n Basic rules for correct timing ¡ Clock flip-flops synchronously (all at

System considerations n Basic rules for correct timing ¡ Clock flip-flops synchronously (all at the same time) n n ¡ No flip-flop changes state more than once per clock cycle FF propagation delay > hold time Avoid mixing positive-edge triggered and negative-edge triggered flip-flops in the same circuit 7

System considerations n Use edge-triggered flip-flops wherever possible ¡ ¡ Avoid latches Most common:

System considerations n Use edge-triggered flip-flops wherever possible ¡ ¡ Avoid latches Most common: Master-slave D 8

Clock skew n Goal: Clock all flip-flops at the same time IN Q 0

Clock skew n Goal: Clock all flip-flops at the same time IN Q 0 CLK 0 clocks first flip-flop CLK 1 clocks second flip-flop CLK 1 should align with CLK 0, but is delayed due to clock skew Q 1 CLK 0 CLK 1 Original state: Next state: IN = 0, Q 0 = 1, Q 1 = 1 Q 0 = 0, Q 1 = 0 (should be Q 1 = 1) 9

Clock skew n Difficult to achieve in high-speed systems ¡ n n Clock delays

Clock skew n Difficult to achieve in high-speed systems ¡ n n Clock delays (wire, buffers) are comparable to logic delays Tp > Th Tp > Tskew + Th If Tskew < 0, Tperiod + Tskew > Tp + Tsu 10

Asynchronous versus synchronous n Asynchronous ¡ ¡ n State changes occur when state inputs

Asynchronous versus synchronous n Asynchronous ¡ ¡ n State changes occur when state inputs change Feedback elements may be wires or delays Synchronous ¡ ¡ State changes occur synchronously Feedback elements are clocked 11

Asynchronous inputs n Clocked circuits are synchronous ¡ ¡ n Circuit changes state only

Asynchronous inputs n Clocked circuits are synchronous ¡ ¡ n Circuit changes state only at clock edges Signals (voltages) settle in-between clock edges Unclocked circuits or signals are asynchronous ¡ ¡ No master clock Real-world inputs (e. g. a keypress) are asynchronous 12

Asynchronous inputs n Synchronous circuits have asynchronous inputs ¡ ¡ Reset signal, memory wait,

Asynchronous inputs n Synchronous circuits have asynchronous inputs ¡ ¡ Reset signal, memory wait, user input, etc. Inputs can change at any time n n We must synchronize the input to our clock Inputs will violate flip-flop setup/hold times 13

Synchronizer failure n Occurs when FF input changes near clock edge ¡ ¡ Input

Synchronizer failure n Occurs when FF input changes near clock edge ¡ ¡ Input is neither 1 or 0 when clock goes high Output may be neither 0 or 1 n ¡ May stay undefined for a long time Undefined state is called metastability 14

Synchronizer failure D CLK Q logic 0 logic 1 15

Synchronizer failure D CLK Q logic 0 logic 1 15

Minimizing synchronizer failure n Failure probability can never be zero ¡ Cascade two (or

Minimizing synchronizer failure n Failure probability can never be zero ¡ Cascade two (or more) flip-flops n n asynchronous input Effectively synchronizes twice Both would have to fail for system to fail D Q D synchronized input Q Clk 16

Handling asynchronous inputs n Never fan-out asynchronous inputs ¡ ¡ Synchronize at circuit boundary

Handling asynchronous inputs n Never fan-out asynchronous inputs ¡ ¡ Synchronize at circuit boundary Fan-out synchronized signal Synchronizer Async Input D Q Q 0 Async Input D Q Clock D Q Q 1 Clock Q 0 D Q Q 1 Clock 17

Summary n n For sequential logic circuits, timing issues have to be considered. Inputs

Summary n n For sequential logic circuits, timing issues have to be considered. Inputs are often asynchronous and can cause problems. Different amount of delay at different part of the circuit can cause problems also. Solutions: ¡ ¡ Cascade flip flops in series Design to keep timing alignment in mind (length of wires, etc) 18