Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

Exercises with Sequential Logic

CS 64: Computer Organization and Design Logic


Lecture #15
Winter 2020

Ziad Matni, Ph.D.


Dept. of Computer Science, UCSB
Administrative

• Lab 8 will be posted today

• Final Exam Info:


• Tuesday, March 17th at 7:30 PM in this classroom
• Arrive 10 mins early – randomized seating…

• Cumulative Exam
• Study guide/example Qs will be issued by this weekend
• More details to follow

3/4/2020 Matni, CS64, Wi20 3


Lecture Outline

• Exercises with Sequential Logic

3/4/2020 Matni, CS64, Wi20 4


time

D Q
D Clocked
Latch
CLK Q

3/4/2020 Matni, CS64, Wi20 5


time

D Q

D-FF

> CLK Q

3/4/2020 Matni, CS64, Wi20 6


Latches vs. FFs

• Latches capture data on an entire 1 or 0 of the clock


• FFs capture data on the edge of the clock
• This example shows the positive (01) edge used

Latch out

FFs give out less


FF out “glitchy” outputs

time
3/4/2020 Matni, CS64, Wi20 7
Simplified CPU Block Diagram

3/4/2020 Matni, CS64, Wi20 8


Class Exercise 1

3/4/2020 Matni, CS64, Wi20 9


Exercise 2
Given waveforms for A, B, C, and Clk (see blackboard),
determine the output waveform for F

B D Q

C Clk Clk Q F

3/4/2020 Matni, CS64, Wi20 10


Exercise 3

• Let’s design a 3-bit counter using D-FFs and logic gates.

• What’s needed:
• This counts 000  001  010  …  111  000
• i.e. from 0 to 7 and then loops again to 0, etc…

• Draw the T.T. based on this description


• How many inputs? How many outputs?
• Figure out what the “next states” look like based on “current states”
• Draw K-Maps and find optimal output functions

3/4/2020 Matni, CS64, Wi20 11


Exercise 4

• Draw the waveforms B and C for this digital circuit,


given CLKA is a regular clock input.
• Assume all inputs to the D-FFs are initially at 0.

• What do you conclude about what this does?

C
D Q

D Q B
Clk Q
CLKA Clk Q

3/4/2020 Matni, CS64, Wi20 12


15

3/4/2020 Matni, CS64, Wi20 13


YOUR TO-DOs

• Lab 8

3/4/2020 Matni, CS64, Wi20 14


3/4/2020 Matni, CS64, Wi20 15

You might also like