31
COMP 122/L Lecture 24 Kyle Dewey

COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

  • Upload
    ngothuy

  • View
    224

  • Download
    3

Embed Size (px)

Citation preview

Page 1: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

COMP 122/L Lecture 24 Kyle Dewey

Page 2: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

Outline

• Sequential circuits

• D flip-flops

Page 3: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

Sequential Circuits

Page 4: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

MotivationOutput = Input1 + Input2

-You’re working with a circuit that can add numbers

Page 5: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

MotivationOutput = Input1 + Input2

mov r0, #5add r1, r0, r0

-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in between instructions. That is, we need registers.-None of the components you’ve worked with so far do this sort of thing

Page 6: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

Combinatorial LogicOutputs entirely determined by the inputs

Page 7: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

Combinatorial LogicOutputs entirely determined by the inputs

Output = Input1 + Input2

-You’ve been working with combinatorial logic throughout the course so far

Page 8: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

Combinatorial LogicOutputs entirely determined by the inputs

Output = Input1 + Input2

Sequential LogicOutputs determined by the inputs,

along with the current state

-You’ve been working with combinatorial logic throughout the course so far

Page 9: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

Combinatorial LogicOutputs entirely determined by the inputs

Output = Input1 + Input2

Sequential LogicOutputs determined by the inputs,

along with the current state

mov r0, #5add r1, r0, r0

-You’ve been working with combinatorial logic throughout the course so far-Registers act to hold the current state-This ARM snippet does what it does because it remembers that r0 held 5 in between the two instructions

Page 10: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

Combinatorial LogicCircuitInputs Outputs

-Same information with a diagram

Page 11: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

Combinatorial LogicCircuitInputs Outputs

Sequential Logic

-Same information with a diagram-Interesting point: sequential circuits contain combinatorial circuits. This isn’t an entirely independent topic; it builds on everything you’ve seen and used so far

Page 12: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

Saving BitsWe can utilize feedback: putting the output of the circuit

back into itself.

Page 13: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

Saving BitsWe can utilize feedback: putting the output of the circuit

back into itself.

(SR Latch)

Page 14: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

Saving BitsWe can utilize feedback: putting the output of the circuit

back into itself.

S R Next Q

0 0 Q

0 1 0

1 0 1

1 1 X(SR Latch)-The animations for SR NOR latches are really good here (https://en.wikipedia.org/wiki/Flip-flop_(electronics)#D_flip_flop)

Page 15: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

Building UpCan use this to store any bit

Page 16: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

Building UpCan use this to store any bit

(D Latch)

Page 17: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

Building UpCan use this to store any bit

D E Next Q

0 0 Q

0 1 0

1 0 Q

1 1 1

(D Latch)

-D is short for data; E is short for enable-Basically, if E is set, store the data

Page 18: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

Building UpCan use this to store any bit

D E Next Q

0 0 Q

0 1 0

1 0 Q

1 1 1

(D Latch)

Component shorthand:

-D is short for data; E is short for enable-Basically, if E is set, store the data

Page 19: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

QuestionHow fast can this go?

-How quickly I can access memory is one thing, but what does a memory access even mean here? We’re talking physical devices - how do I know it’s ready?

Page 20: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

Gate DelayZ = X!X

Page 21: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

Gate DelayZ = X!X

Time

-This is a timing diagram: it shows how outputs change over time with inputs-This one also shows the values as it goes through a sub-portion of the circuit, namely Y-Key point: while logically this statement should always be false, there is actually a point when Z is true!

Page 22: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

Gate DelayZ = X!X

Z is true!Time

-This is a timing diagram: it shows how outputs change over time with inputs-This one also shows the values as it goes through a sub-portion of the circuit, namely Y-Key point: while logically this statement should always be false, there is actually a point when Z is true!

Page 23: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

SolutionOnly look at the outputs at preset intervals.

Space the intervals so the circuit will always be stable by that point.

Time

-This is a timing diagram: it shows how outputs change over time with inputs-This one also shows the values as it goes through a sub-portion of the circuit, namely Y-Key point: while logically this statement should always be false, there is actually a point when Z is true!

Page 24: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

SolutionOnly look at the outputs at preset intervals.

Space the intervals so the circuit will always be stable by that point.

Time Look here(sample here)

-This process of looking is more formally called sampling

Page 25: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

IntervalsProduced by a clock generator: another kind of circuit

-These exist as physical devices

Page 26: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

IntervalsProduced by a clock generator: another kind of circuit

CLK1

0

-These exist as physical devices

Page 27: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

IntervalsProduced by a clock generator: another kind of circuit

CLK1

0

-These exist as physical devices

Page 28: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

IntervalsProduced by a clock generator: another kind of circuit

CLK1

0

CLK1

0

-These exist as physical devices

Page 29: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

IntervalsProduced by a clock generator: another kind of circuit

CLK1

0

CLK1

0

For example:sample on

rising edge of clocksignal

-These exist as physical devices-With the “for example” part, we can design components that will trigger on the rising edge, the falling edge, the high plateau, or the low plateau. Real systems may use multiple one for different parts of the circuit

Page 30: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

D flip-flop

Page 31: COMP 122/L Lecture 24 Output = Input1 + Input2 mov r0, #5 add r1, r0, r0-...however, adding numbers is only one part of the problem-For a processor, we need a way to store values in

D flip-flop

Clock input.This could be triggered on the rising edge, depending on the component