Docsity

Digital logic design using verilog, Lecture notes of Digital Logic Design and Programming

Partial preview of the text

Download Digital logic design using verilog and more Lecture notes Digital Logic Design and Programming in PDF only on Docsity!

Clocking

Figure by MIT OCW.

2/18/

L06 – Clocks

Why Clocks and Storage Elements?

Inputs

Outputs

Combinational Logic

Want to reuse

combinational logic from cycle to cycle

2/18/

L06 – Clocks

Large Systems

Most large scale ASICs, and systems built with theseASICs, have several synchronous clock domains connectedby asynchronous communication channels

Chip A

Chip B

Chip C

Clock

domain 1

Clock

domain 4

Clock

domain 2

Clock domain 3

Clock

domain 5

Clock

domain 6

Asynch.

channel

We’ll focus on a single synchronous clock domain today

2/18/

L06 – Clocks

Clocked Storage Elements

Transparent Latch, Level Sensitive

data passes through when clock high, latched when clock low

Clock

D

Q

Clock

D Q

Transparent

Latched

D-Type Register or Flip-Flop, Edge-Triggered

data captured on rising edge of clock, held for rest of cycle

D

Q

Clock

D

Clock

Q

(Can also have latch transparent on clock low, or negative-edge triggered flip-flop)

2/18/

L06 – Clocks

Static CMOS Latch Variants

D

CLK CLK

CLK CLK

Q

Clocked CMOS

(C

2

MOS)

inverter

Output buffer shields storage

node from downstream logic

D

CLK CLK

Q

Weak feedback inverter so input can overpower it

CLK

D

Q

Pulldown

stack

overpowers

cross-coupled

Generally the best, fast

and energy efficient

Has lowest clock load

Can be small, lower clock load, but

sizing problematic

Q

feedback

inverters

2/18/

L06 – Clocks

Latch Timing Parameters

Clock

D Q

T

CQmax

T

CQmin

T

DQmax

T

DQmin

T

setup

T

hold

T

CQmin

/T

CQmax

propagation in

→

out when clock opens latch

T

DQmin

/T

DQmax

propagation in

→

out while transparent

usually the most important timing parameter for a latch

T

setup

/T

hold

define window around closing clock edge during which datamust be steady to be sampled correctly

2/18/

L06 – Clocks

Failing Setup

D

CLK CLK

CLK CLK

Q

If data arrives too close to clock edge, it won’t set upthe feedback loop before clock closes the inputtransmission gate.

2/18/

L06 – Clocks

The Hold Time Race^ D

CLK CLK

CLK CLK

Q

Added clock buffers to demonstrate

designs naturally have positive hold time

positive hold time on this latch – other latch

Hold time represents the race for clock to close the inputgate before next cycle’s data disturbs the stored value. (Here we’re rooting for the clock signal)

2/18/

L06 – Clocks

Flip-Flops

Can build a flip-flop using two latches back toback

D

Q

Master

Transparent

Master Latched

CLK

Slave

Latched

Slave

Transparent

Master

Transparent

Slave

Latched

Master

Slave

CLK

On positive edge, master latches input D, slave becomes transparent to pass new D to output Q

On negative edge, slave latches current Q, master goes transparent to sample input D again

2/18/

L06 – Clocks

Flip-Flop Designs

CLK

D

CLK CLK

CLK CLK

CLK CLK

CLK CLK

Q

CLK

Q

Can have true or

complementaryoutput or both

ƒ

Transmission-gate master-slave latches most popular in ASICs

robust, convenient timing parameters, energy-efficient

ƒ

Many other ways to build a flip-flop other than transmission gatemaster-slave latches

usually trickier timing parameters

only found in high performance custom devices

2/18/

L06 – Clocks

Single Clock Edge-Triggered Design

T

Pmin

/T

Pmax

CLK

Combinational

Logic

Single clock with edge-triggered registers most common

design style in ASICs

Slow path timing constraint

T

cycle

T

CQmax

  • T

Pmax

  • T

setup

can always work around slow path by using slower clock

Fast path timing constraint

T

CQmin

  • T

Pmin

T

hold

bad fast path cannot be fixed without redesign!

might have to add delay into paths to satisfy hold time

2/18/

L06 – Clocks

Clock Distribution

Can’t really distribute clock at same instant toall flip-flops on chip

Central

Clock Driver

Clock

Distribution

Network

LocalClock

Buffers Variations in trace

length, metal width and

height, coupling caps

Variations in local clock load, local power supply,

local gate length and

threshold, local

clock arrival time

is “clock skew”

Difference in

temperature

2/18/

L06 – Clocks

H-Trees

Recursive pattern to distribute signals uniformly withequal delay over area

Uses much less power than grid, but has more skew

In practice, an approximate H-tree is used at the toplevel (has to route around functional blocks), with localclock buffers driving regions

2/18/

L06 – Clocks

Clock Oscillators

Where does the clock signal come from?

Simple approach: ring oscillator

Odd number of inverter stages connected in a loop

Problem: ƒ

What frequency does the ring run at?

Depends on voltage, temperature, fabrication run, …

Where are the clock edges relative to an external observer?

Free running, no synchronization with external channel

2/18/

L06 – Clocks