59
Sequential Circuits Lecture 27 Section C.8 Robb T. Koether Hampden-Sydney College Mon, Nov 4, 2019 Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 1 / 34

Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

Sequential CircuitsLecture 27Section C.8

Robb T. Koether

Hampden-Sydney College

Mon, Nov 4, 2019

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 1 / 34

Page 2: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

1 Sequential Circuits

2 SR Latches

3 The Clock

4 D Latches

5 D Flip Flops

6 Assignment

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 2 / 34

Page 3: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

Outline

1 Sequential Circuits

2 SR Latches

3 The Clock

4 D Latches

5 D Flip Flops

6 Assignment

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 3 / 34

Page 4: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

Sequential Circuits

A sequential circuit has the ability to store a value.

Consequently, the output is not fully determined by the input.It is determined by the input together with the stored value(s).This forms the basis of the computer’s ability to store data.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 4 / 34

Page 5: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

Sequential Circuits

A sequential circuit has the ability to store a value.Consequently, the output is not fully determined by the input.

It is determined by the input together with the stored value(s).This forms the basis of the computer’s ability to store data.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 4 / 34

Page 6: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

Sequential Circuits

A sequential circuit has the ability to store a value.Consequently, the output is not fully determined by the input.It is determined by the input together with the stored value(s).

This forms the basis of the computer’s ability to store data.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 4 / 34

Page 7: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

Sequential Circuits

A sequential circuit has the ability to store a value.Consequently, the output is not fully determined by the input.It is determined by the input together with the stored value(s).This forms the basis of the computer’s ability to store data.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 4 / 34

Page 8: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

Outline

1 Sequential Circuits

2 SR Latches

3 The Clock

4 D Latches

5 D Flip Flops

6 Assignment

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 5 / 34

Page 9: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

SR Latches

An SR latch is a sequential circuit that has the ability to store a bit.

Thus, it is a sequential circuit.It is also an unclocked circuit, meaning that the computer’s clock(0 or 1) is not one of its inputs.It uses two NOR gates whose outputs are fed back in as inputs.(All sequential circuits use feedback.)

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 6 / 34

Page 10: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

SR Latches

An SR latch is a sequential circuit that has the ability to store a bit.Thus, it is a sequential circuit.

It is also an unclocked circuit, meaning that the computer’s clock(0 or 1) is not one of its inputs.It uses two NOR gates whose outputs are fed back in as inputs.(All sequential circuits use feedback.)

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 6 / 34

Page 11: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

SR Latches

An SR latch is a sequential circuit that has the ability to store a bit.Thus, it is a sequential circuit.It is also an unclocked circuit, meaning that the computer’s clock(0 or 1) is not one of its inputs.

It uses two NOR gates whose outputs are fed back in as inputs.(All sequential circuits use feedback.)

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 6 / 34

Page 12: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

SR Latches

An SR latch is a sequential circuit that has the ability to store a bit.Thus, it is a sequential circuit.It is also an unclocked circuit, meaning that the computer’s clock(0 or 1) is not one of its inputs.It uses two NOR gates whose outputs are fed back in as inputs.

(All sequential circuits use feedback.)

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 6 / 34

Page 13: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

SR Latches

An SR latch is a sequential circuit that has the ability to store a bit.Thus, it is a sequential circuit.It is also an unclocked circuit, meaning that the computer’s clock(0 or 1) is not one of its inputs.It uses two NOR gates whose outputs are fed back in as inputs.(All sequential circuits use feedback.)

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 6 / 34

Page 14: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

SR Latches

SR Latch

R

S

Q

PQ

P

S is “set” and R is “reset.”We will examine how the SR latch behaves for different values ofS and R.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 7 / 34

Page 15: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

SR Latches

R(t) S(t) Q(t − ε) P(t − ε) Q(t + ε) P(t + ε)

0 1 0 0

1 0

0 1 0 1

1 0

0 1 1 0

1 0

0 1 1 1

1 0

1 0 0 0

0 1

1 0 0 1

0 1

1 0 1 0

0 1

1 0 1 1

0 1

Analyze the circuit when the inputs are different.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 8 / 34

Page 16: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

SR Latches

R(t) S(t) Q(t − ε) P(t − ε) Q(t + ε) P(t + ε)

0 1 0 0 1 00 1 0 1 1 00 1 1 0 1 00 1 1 1 1 01 0 0 0 0 11 0 0 1 0 11 0 1 0 0 11 0 1 1 0 1

Analyze the circuit when the inputs are different.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 8 / 34

Page 17: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

SR Latches

R(t) S(t) Q(t − ε) P(t − ε) Q(t + ε) P(t + ε)

0 0 0 0

1 1

0 0 0 1

0 1

0 0 1 0

1 0

0 0 1 1

0 0

Analyze the circuit when the inputs are both 0.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 9 / 34

Page 18: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

SR Latches

R(t) S(t) Q(t − ε) P(t − ε) Q(t + ε) P(t + ε)

0 0 0 0 1 10 0 0 1 0 10 0 1 0 1 00 0 1 1 0 0

Analyze the circuit when the inputs are both 0.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 9 / 34

Page 19: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

Stability of the SR Latch

Notice that when R = S = 0, the values of P and Q are unstablewhen both are 0 or both are 1.

In reality, one of them receives the new value slightly ahead of theother, which then leads to stability.But it may take a few moments to stabilize.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 10 / 34

Page 20: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

Stability of the SR Latch

Notice that when R = S = 0, the values of P and Q are unstablewhen both are 0 or both are 1.In reality, one of them receives the new value slightly ahead of theother, which then leads to stability.

But it may take a few moments to stabilize.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 10 / 34

Page 21: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

Stability of the SR Latch

Notice that when R = S = 0, the values of P and Q are unstablewhen both are 0 or both are 1.In reality, one of them receives the new value slightly ahead of theother, which then leads to stability.But it may take a few moments to stabilize.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 10 / 34

Page 22: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

SR Latches

R(t) S(t) Q(t − ε) P(t − ε) Q(t + ε) P(t + ε)

1 1 0 0

0 0

1 1 0 1

0 0

1 1 1 0

0 0

1 1 1 1

0 0

Analyze the circuit when the inputs are both 1.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 11 / 34

Page 23: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

SR Latches

R(t) S(t) Q(t − ε) P(t − ε) Q(t + ε) P(t + ε)

1 1 0 0 0 01 1 0 1 0 01 1 1 0 0 01 1 1 1 0 0

Analyze the circuit when the inputs are both 1.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 11 / 34

Page 24: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

SR Latches

SR LatchR S Q P0 0 0 10 0 1 00 1 1 01 0 0 11 1 0 0

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 12 / 34

Page 25: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

SR Latches

If S is asserted (1) and R is deasserted (0), then Q is asserted(1), i.e., Q is set.

If R is asserted (1) and S is deasserted (0), then Q is deasserted(0), i.e., Q is reset.Thus, the name, set-reset latch.If R and S are both 1, then the values of Q and P are 0. As we willsee, this case will not arise.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 13 / 34

Page 26: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

SR Latches

If S is asserted (1) and R is deasserted (0), then Q is asserted(1), i.e., Q is set.If R is asserted (1) and S is deasserted (0), then Q is deasserted(0), i.e., Q is reset.

Thus, the name, set-reset latch.If R and S are both 1, then the values of Q and P are 0. As we willsee, this case will not arise.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 13 / 34

Page 27: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

SR Latches

If S is asserted (1) and R is deasserted (0), then Q is asserted(1), i.e., Q is set.If R is asserted (1) and S is deasserted (0), then Q is deasserted(0), i.e., Q is reset.Thus, the name, set-reset latch.

If R and S are both 1, then the values of Q and P are 0. As we willsee, this case will not arise.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 13 / 34

Page 28: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

SR Latches

If S is asserted (1) and R is deasserted (0), then Q is asserted(1), i.e., Q is set.If R is asserted (1) and S is deasserted (0), then Q is deasserted(0), i.e., Q is reset.Thus, the name, set-reset latch.If R and S are both 1, then the values of Q and P are 0. As we willsee, this case will not arise.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 13 / 34

Page 29: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

SR Latches

In all but the last case (which will not arise), P = Q. Therefore, wewill rename it Q.

Note that when R and S are both deasserted (0), Q maintains itsvalue (either 0 or 1) and Q maintains the complementary value.Thus, the SR Latch is able to store the values of Q and Q.The S input (set) will set Q and the R input (reset) will reset Q.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 14 / 34

Page 30: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

SR Latches

In all but the last case (which will not arise), P = Q. Therefore, wewill rename it Q.Note that when R and S are both deasserted (0), Q maintains itsvalue (either 0 or 1) and Q maintains the complementary value.

Thus, the SR Latch is able to store the values of Q and Q.The S input (set) will set Q and the R input (reset) will reset Q.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 14 / 34

Page 31: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

SR Latches

In all but the last case (which will not arise), P = Q. Therefore, wewill rename it Q.Note that when R and S are both deasserted (0), Q maintains itsvalue (either 0 or 1) and Q maintains the complementary value.Thus, the SR Latch is able to store the values of Q and Q.

The S input (set) will set Q and the R input (reset) will reset Q.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 14 / 34

Page 32: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

SR Latches

In all but the last case (which will not arise), P = Q. Therefore, wewill rename it Q.Note that when R and S are both deasserted (0), Q maintains itsvalue (either 0 or 1) and Q maintains the complementary value.Thus, the SR Latch is able to store the values of Q and Q.The S input (set) will set Q and the R input (reset) will reset Q.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 14 / 34

Page 33: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

SR Latches

How would the SR latch behave if we replaced the NOR gateswith NAND gates?

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 15 / 34

Page 34: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

Outline

1 Sequential Circuits

2 SR Latches

3 The Clock

4 D Latches

5 D Flip Flops

6 Assignment

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 16 / 34

Page 35: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

The Clock

The clock is a component of the processor whose valuecontinuously oscillates between 0 and 1.As we will soon see, the clock is used to control all othercomponents of the processor.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 17 / 34

Page 36: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

The Clock

1 clock

rising edge falling edge

The behavior of the clock over time

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 18 / 34

Page 37: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

The Clock

1 clock

rising edge falling edge

On the rising edge, the clock changes from 0 to 1

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 18 / 34

Page 38: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

The Clock

1 clock

rising edge falling edge

On the falling edge, the clock changes from 1 to 0

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 18 / 34

Page 39: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

Outline

1 Sequential Circuits

2 SR Latches

3 The Clock

4 D Latches

5 D Flip Flops

6 Assignment

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 19 / 34

Page 40: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

D Latches

A D Latch is able to store a bit on the rising edge of the Clock.It uses an SR Latch to store the value and it uses a pair ofAND-gates to initiate the storing when the clock switches from 0 to1.It is a clocked circuit; one of its inputs it the clock.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 20 / 34

Page 41: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

D Latches

D Latch

S/R

Clock

Q

Q

S

R

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 21 / 34

Page 42: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

D Latches

D Latch

S/R

Clock

Q

Q

R

S

0/1

0

1/00

1/00

0

0

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 21 / 34

Page 43: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

D Latches

The input R/S is the data D to be stored.When Clock = 0, both AND gates will output 0.In this case, the latch is closed; the state of Q is unaffected.When Clock = 1, one of the AND gates will output 1, dependingon the value of R/S (or D).In this case, the latch is open; the value of D is stored as Q.Note that the two AND gates cannot both output 1 simultaneously.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 22 / 34

Page 44: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

D Latches

Suppose that initially Clock = 0 and S/R = 1.Consider a sequence of events where Clock switches to 1, then 0,then 1 again.Suppose that after Clock changes back to 0, S/R changes to 0,and then Clock changes back to 1.What happen to Q?

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 23 / 34

Page 45: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

D Latches

D Latch

Clock = 0 and D =?(whatever)

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 24 / 34

Page 46: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

D Latches

D Latch

S/R

Clock

Q

Q

R

S

1

0

00

10

0

0

?

?

S/R

Clock

Q

Q

R

S

1

1

10

11

0

1

1

0

Change Clock to 1; Set Q

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 24 / 34

Page 47: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

D Latches

D Latch

R/S

Clock

Q

Q

R

S

1

0

00

10

0

0

1

0

Change Clock to 0; no change to Q

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 24 / 34

Page 48: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

D Latches

D Latch

R/S

Clock

Q

Q

R

S

0

0

10

00

0

0

1

0

Change S/R to 0; no change to Q

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 24 / 34

Page 49: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

D Latches

D Latch

R/S

Clock

Q

R

S

1

0

1

1

1

0

1

0

0

1Q

Change Clock to 1; Reset Q

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 24 / 34

Page 50: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

D Latches

D Latch

Clock

S/R

Q

The clock and the input and output of the D latch over time.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 25 / 34

Page 51: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

D Latches

The D Latch is transparent because when Clock = 1, the input Dappears immediately as the output Q.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 26 / 34

Page 52: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

D Latches

How would we design a latch that closes on the rising edge andopens on the falling edge?

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 27 / 34

Page 53: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

Outline

1 Sequential Circuits

2 SR Latches

3 The Clock

4 D Latches

5 D Flip Flops

6 Assignment

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 28 / 34

Page 54: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

D Flip Flops

D Flip Flop

D Latch

D

C

Q

D Latch

D

C

Q

Q

D

Clock

Q

Q

The Clock will alternately set the value of the first latch or thesecond latch.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 29 / 34

Page 55: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

D Flip Flops

D Flip Flop

Q

Q

D

Clock

D Flip-Flop

Track the values of Q and Q over time as the clock C and theinput D changes.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 30 / 34

Page 56: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

D Flip Flops

Set-up time is the time it takes for data to stabilize before therising clock edge.Hold time is the time the data must be stable after the rising clockedge.The value Q of the D Flip Flop is changed on the falling edge ofthe clock.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 31 / 34

Page 57: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

D Flip Flops

The D Flip Flop is not transparent.The input is stored when Clock = 1, but it appears as output onlywhen Clock = 0.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 32 / 34

Page 58: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

Outline

1 Sequential Circuits

2 SR Latches

3 The Clock

4 D Latches

5 D Flip Flops

6 Assignment

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 33 / 34

Page 59: Sequential Circuits - Lecture 27 Section Cpeople.hsc.edu/faculty-staff/robbk/Coms361/Lectures/Lectures 2019/Lecture 27...Robb T. Koether (Hampden-Sydney College) Sequential Circuits

Assignment

AssignmentRead Section C.8.

Robb T. Koether (Hampden-Sydney College) Sequential Circuits Mon, Nov 4, 2019 34 / 34