= Set Reset 0 0 S R Q Q Q Q 1 9/17/15 SR latch Q R D - - PowerPoint PPT Presentation

set reset 0 0 s r q q q q 1 9 17 15 sr latch q r d latch
SMART_READER_LITE
LIVE PREVIEW

= Set Reset 0 0 S R Q Q Q Q 1 9/17/15 SR latch Q R D - - PowerPoint PPT Presentation

9/17/15 Processor: Data Path Components Latch: CC-BY Rberteig@flickr Latches, Flip-flops, and Registers 2 1 Instruction ALU Registers Fetch and Memory Decode Sequential logic:


slide-1
SLIDE 1

9/17/15 1

Processor: ¡Data ¡Path ¡Components

ALU

Registers Memory

Instruction ¡ Fetch and ¡ Decode

1 2

Latches, ¡Flip-­‑flops, ¡and ¡Registers

Sequential ¡logic: ¡fundamental ¡elements ¡to ¡store ¡values Output ¡depends ¡on ¡inputs ¡and ¡stored ¡values. (vs. ¡combinational ¡logic: ¡output ¡depends ¡only ¡on ¡inputs)

Latch: ¡CC-­‑BY ¡Rberteig@flickr

Bistable latches

Q Q

Suppose ¡we ¡somehow ¡get ¡a ¡1 ¡ ¡(or ¡a ¡0?) ¡on ¡here.

Q Q

=

SR ¡latch

Q Q R S Set Reset S R Q Q' Q ¡(stable) Q' (stable) ? ? 1 1 1 1 1 1 ? ? 1 ? ? 1 1 ? ? 1

slide-2
SLIDE 2

9/17/15 2

SR ¡latch

Q Q R S Q Q R S Q Q R S R S Q Q

if ¡C ¡= ¡0, ¡then ¡SR ¡latch ¡stores ¡current ¡value ¡of ¡Q. if ¡C ¡= ¡1, ¡then ¡D ¡flows ¡to ¡Q: if ¡D ¡= ¡0, ¡then ¡R ¡= ¡1 ¡and ¡S ¡= ¡0, ¡Q ¡= ¡0 if ¡D ¡= ¡1, ¡then ¡R ¡= ¡0 ¡and ¡S ¡= ¡1, ¡Q ¡= ¡1

D ¡latch

D C R S Q Q Clock Data ¡bit

Clocks

Clock: ¡free-­‑running ¡signal with ¡fixed ¡cycle time ¡= ¡clock ¡period = ¡T. ¡ ¡ Clock ¡frequency = ¡1 ¡/ ¡clock ¡period A ¡clock ¡controls ¡when ¡to ¡update a ¡sequential ¡logic ¡element's ¡state.

Clock ¡period Falling ¡edge Rising ¡ edge

Synchronous ¡systems

Inputs ¡to ¡state ¡elements ¡must ¡be ¡valid on ¡active ¡clock ¡edge. State element 1 State element 2 Combinational ¡logic

slide-3
SLIDE 3

9/17/15 3

D ¡flip-­‑flop ¡with ¡falling-­‑edge ¡ trigger

D C Q E

Qm Dm Cm

D ¡latch

Qm Qs Ds Cs

D ¡latch

Qs

Q

master slave

Can ¡write ¡ Qnext while ¡simultaneously ¡ reading ¡state ¡Qnow Clock

master ¡stores ¡D as ¡E slave ¡stores ¡E as ¡Q Can ¡still ¡read ¡Qnow Qnext becomes ¡Qnow

Time

Reading ¡and ¡writing ¡in ¡the ¡same ¡cycle

Clock

master ¡stores ¡D as ¡E slave ¡stores ¡E as ¡Q

Time

Can ¡write ¡ Qnext while ¡simultaneously ¡ reading ¡state ¡Qnow

Can ¡still ¡read ¡Qnow Qnext becomes ¡Qnow Q D C D Flip-­‑Flop Q Clock

D ¡Flip-­‑Flop ¡= ¡one ¡bit ¡of ¡storage

Q D C D Flip-­‑Flop Q 1

A ¡1-­‑nybble* ¡register

(a ¡4-­‑bit ¡hardware ¡ “local ¡variable”)

*Half ¡ a ¡byte!

Write Clock

1 1 Q D C D Flip-­‑Flop Q Q D C D Flip-­‑Flop Q Q D C D Flip-­‑Flop Q Q D C D Flip-­‑Flop Q

slide-4
SLIDE 4

9/17/15 4

Register ¡file

Read ¡ports Why ¡2?

Read ¡register selector ¡1 Read ¡register selector ¡2 Write ¡register ¡ selector Write ¡data Write? Read ¡data ¡1 Read ¡data ¡2

r r r w w w

r ¡= ¡log2 number ¡of ¡registers w ¡= ¡bits ¡in ¡word

Array ¡of ¡registers, ¡ with ¡register ¡ selectors, ¡write/read ¡ control, input ¡port ¡for ¡writing ¡ data, ¡output ¡ports ¡for ¡reading ¡ data. Write ¡port

0 ¡= ¡read 1 ¡= ¡write

Read ¡ports (data ¡out)

Read register number 1 Register 0 Register 1 . . . Register n – 2 Register n – 1 M u x Read register number 2 M u x Read data 1 Read data 2 Write 1 n-to-2n decoder n – 2 n – 1 Register 0 C D Register 1 C D Register n – 2 C D Register n – 1 C D . . . Register number . . . Register data

Write ¡port (data ¡in)

incoming ¡data register ¡ number write ¡control clock