Docsity

Sequential Logic - Components and Techniques for Digital Systems - Lecture Slides, Slides of Computer Science

Partial preview of the text

Download Sequential Logic - Components and Techniques for Digital Systems - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

Sequential Logic

• Sequential Circuits

– Simple circuits with feedback

– Latches

– Edge-triggered flip-flops

• Timing Methodologies

– Cascading flip-flops for proper operation

– Clock skew

• Asynchronous Inputs

– Metastability and synchronization

• Basic Registers

– Shift registers

Sequential Circuits

• Circuits with Feedback

– Outputs = f(inputs, past inputs, past outputs)

– Basis for building "memory" into logic circuits

– Door combination lock is an example of a

sequential circuit

• State is memory

• State is an "output" and an "input" to combinational

logic

• Combination storage elements are also memory

C1 C2 C

comparator value equal multiplexer reset open/closed new equal mux control clock comb. logic state

Simplest Circuits with Feedback

• Two inverters form a static memory cell

– Will hold value as long as it has power applied

• How to get a new value into the memory cell?

– Selectively break feedback path

– Load new value into cell

"remember" "load" "data" "stored value"

"stored value"

Memory with Cross-coupled Gates

• Cross-coupled NOR gates

  • Similar to inverter pair, with capability to force output to 0

(reset=1) or 1 (set=1)

• Cross-coupled NAND gates

  • Similar to inverter pair, with capability to force output to 0

(reset=0) or 1 (set=0)

R
S
Q
Q'
R
S
Q
R'
S'
Q
Q
Q'
S'
R'

State Behavior of R-S latch

• Truth table of R-S latch behavior

S R Q

0 0 hold 0 1 0 1 0 1 1 1 unstable

Q Q'
Q Q'
Q Q'
Q Q'

Theoretical R-S Latch Behavior

• State Diagram

  • States: possible values
  • Transitions: changes

based on inputs

Q Q'
Q Q'
Q Q'
Q Q'
SR=
SR=00 SR=
SR=
SR=
SR=
SR=
SR=
SR=
SR=11 SR=
SR=
SR=
SR=01 SR=
SR=

possible oscillation

between states 00 and 11

R-S Latch Analysis

• Break feedback path

Q(t+) R

S

Q(t)

S R Q(t) Q(t+) 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 0 1 0 0 1 1 0 1 1 1 1 0 X 1 1 1 X hold reset set not allowed (^) characteristic equation Q(t+) = S + R’ Q(t)

R
S
Q
Q'

0 0 1 0 X 1 Q(t) X 1 R

S

Gated R-S Latch

• Control when R

and S inputs

matter

– Otherwise, the

slightest glitch on

R or S while

enable is low

could cause

change in value

stored

enable' S'

Q'
Q
R' R
S

Set Reset S' R' enable' Q Q'

Clocks (cont’d)

• Controlling an R-S latch with a clock

– Can't let R and S change while clock is active

(allowing R and S to pass)

– Only have half of clock period for signal changes to

propagate

– Signals must be stable for the other half of clock

period

clock R' and S' stable changing stable changing stable clock' S'

Q'
Q
R' R
S

Cascading Latches

• Connect output of one latch to input of

another

• How to stop changes from racing through

chain?

– Need to control flow of data from one latch to the

next

– Advance from one latch per clock period

– Worry about logic between latches (arrows) that is

too fast

clock

R
S Q
Q' R
S Q
R Q'
S

The 1s Catching Problem

• In first R-S stage of master-slave FF

– 0 - 1 - 0 glitch on R or S while clock is high "caught"

by master stage

– Leads to constraints on logic to be hazard-free

Set 1s catch S R CLK P P' Q Q' Reset Master Outputs Slave Outputs master stage slave stage P

P'
CLK
R
S Q
Q' R
S Q
R Q'
S

D Flip-Flop

• Make S and R complements of each other

– Eliminates 1s catching problem

– Can't just hold previous value (must have new

value ready every clock period)

– Value of D just before clock goes low is what is

stored in flip-flop

– Can make R-S flip-flop by adding logic to make D =

S + R' Q

10 gates

D Q
Q'

master stage slave stage P

P'
CLK
R
S Q
Q' R
S Q
Q'

Edge-Triggered Flip-Flops (cont’d)

• Step-by-step analysis

Q
D

Clk=

R
S
D
D’
D’
D’
D

when clock goes high-to-low data is latched when clock is low data is held

Q

new D Clk=

R
S
D
D’
D’
D’
D

new D  old D

Edge-Triggered Flip-Flops (cont’d)

• Positive edge-triggered

– Inputs sampled on rising edge; outputs change after

rising edge

• Negative edge-triggered flip-flops

– Inputs sampled on falling edge; outputs change after

falling edge

positive edge-triggered FF negative edge-triggered FF

D
CLK

Qpos Qpos' Qneg Qneg'