73
How to Clock Your Computer: Digital Logic Design 1/3 Moti Medina Slides, slides material, and figures are taken from Digital Logic Design : a rigorous approach lecture slides and book by Guy Even and M (Chapters: 10, 11, 12, 14). 1

How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

How to Clock Your Computer:Digital Logic Design 1/3Moti Medina

Slides, slides material, and figures are taken from “Digital Logic Design : a rigorous approach” lecture

slides and book by Guy Even and M (Chapters: 10, 11, 12, 14). 1

Page 2: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Our Journey: From Transistors to Computers

Transistors GatesGates+wires+acyclicity= combinational circ.

+Flip-flops=Synchronous

circ.CPUs

Today + what is the best we can do?! Picture taken from here. 2

Page 3: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Today’s plan

• 40 min lecture session (~pages 1-9, 15-16 in the “reading material”). • Transistors

• From transistors to gates

• Combinational gates

• Wires

• Combinational circuits

• Equivalence to Boolean functions.

• Rest of the lecture:• Discuss, solve and present Question 1, Question 2 &3, or Question 4.

• Questions appear on Page 17 in the reading material.

3

Page 4: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Transistors

• A lot to say about these devices.

• Let’s keep it simple in the 1st 3 sessions.

• Let’s view transistors as “switches”

• N-transistor:• “turn it on” → drain=source (i.e., conducting).

• “turn off” → drain and source are not connected. (i.e., not conducting)

• P-transistor:• “turn it off” → drain=source.

• “turn on” → drain and source are not connected.

• “Turn on/off” = depends on the voltage at the gate.

4

Page 5: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

From Transistors to Gates

• How does an inverter look like?• ∀𝑏 ∈ 0,1 : 𝐼𝑁𝑉 𝑥 = 1 − 𝑥

• Every gate has its propagation delay• 𝑡𝑝𝑑• Time from stable logical inputs to

stable logical outputs.• There are more parameters…

• Gates are “analog”• We interpret voltages as 0 and 1

according to some thresholds.• There are noises in any system.• → Thresholds has to be separate• → there is a “non-logical” area.• More about this later in the course.

5

Page 6: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Combinational Gates

• Computes a simple Boolean function

• AND, OR, XOR, NXOR, NOT,…

• Takes 𝑡𝑝𝑑 time so that the output equal to the stable inputs.

• What happens when the inputs stop being stable?

• 𝑡𝑐𝑜𝑛𝑡 time after that the gate’s output becomes “garbage”

• Let’s throw in MUX as a gate as well.

• All our gates have a single output.

• Inputs & outputs of a gate aka• Terminals, ports, and pins.

6

Page 7: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Combinational Gates

• All out gates have a single output.

• Inputs & outputs of a gate aka• Terminals, ports, and pins.

• Fan-in of a gate = • number of input ports =• number of bits in the gate’s Boolean

function =• in-degree of a node that represents

the gate.

• Our “basic” gates have fan-in 1-3.

• Let’s add input and output gates• Get the “inputs” from the outer world

and feed the output back to it. • Fan-in is 0-3

7

Page 8: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Wires

• Simply a connection between two terminals.

• Fan-out of a gate = number of input ports it feeds.

8

Page 9: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Combinational Circuits

• Wires “have direction”: from an output port to an input port.

• Each input port is fed by a single output port.

• Map gates to vertices, wires to arcs = Directed (labeled) Graph.

• Directed graph is acyclic (DAG) = Combinational Circuit.

9

Page 10: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Bad Circuits

10

Page 11: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Comb. Circuits = Boolean function

• Given stable input to a Combinational Circuit 𝐶 (or its graph representation 𝐺𝐶), we can:

1. Simulate the circuit in linear time (w.r.t. to the size of 𝐺𝐶),2. Analyze the delay of 𝐶 in linear time.

• How? Topological sorting.

• Every Combinational circuit 𝐶 implements a Boolean function.• Given that we can simulate, this argument is obvious. • Remove the MUX from our “basic gates” to make things easier (i.e., fan-in ≤ 2).

• For every Boolean function 𝑓: 0,1 𝑛 → {0,1} there is a Comb. Circuit 𝐶that implements 𝑓

• That is, ∀𝑥 ∈ 0,1 𝑛: SIMUL 𝐶, 𝑥 = 𝑓(𝑥).• Question #1 on Page 17.

11

Page 12: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Complexity Measures: Cost and Delay

• Each gate has its cost.

• We are interested in the asymptotic behavior of our measures.

• Basic gates are of constant cost we treat them as cost=1.

• The cost of a Comb. Circ. 𝑪 is the number of its gates.

• Each gate has its propagation delay.

• Again, we are interested in the asymptotic behavior of our measures.

• Basic gates are of constant delay we treat them as 𝑡𝑝𝑑=1.

• The delay of a Comb. Circ. 𝑪 is the length of the longest input to output path in 𝑪.

12

Page 13: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

13

Page 14: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Lower Bounds: Cost and Depth

• Reminder I: The depth of a rooted tree with 𝒏 leaves is ≥ ⌈𝐥𝐨𝐠𝟐 𝒏⌉.

• Reminder II: The #nodes of every rooted tree with 𝒏 leaves is 𝟐𝒏 − 𝟏.

• Reminder III: Cost of every gate is 1 (input and output gates have 0 cost)

14

Page 15: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

The Cone of a Boolean Function

15

Page 16: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

An Example

16

Page 17: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Composition of Functions & Graphical Cone

17

Page 18: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Functional Cone ⊆ Graphical Cone

18

Page 19: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

“Hidden” Rooted Trees

𝑞𝑢 𝑞𝑢19

Page 20: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Putting things together! LB on Cost

20

Page 21: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Lower Bound on Delay

21

Page 22: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Effect of fan-in≤ 𝑘 on Lower Bounds

22

Page 23: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

See you on Monday!Enjoy the discussion ☺

23

Page 24: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

How to Clock Your Computer:Digital Logic Design 2/3Moti Medina

Slides, slides material, and figures are taken from “Digital Logic Design : a rigorous approach” lecture

slides and book by Guy Even and M (Chapters: 17-20). 24

Page 25: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Our Journey: From Transistors to Computers

Transistors GatesGates+wires+acyclicity= combinational circ.

+Flip-flops=Synchronous

circ.CPUs

Today

Picture taken from here.

25

≡Boolean Functions

Page 26: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Today’s plan• 40 min lecture session (~pages 9-17 in the “reading material”).

• The clock (2 min)

• Clock cycles (2 min)

• Flip-flop and Clock enabled Flip-Flops (4 min)

• The Zero-delay model (2 min)

• Example: Sequential XOR. (4 min)

• Canonic form of a synch. Circuit. (5 min)

• FSMs (4 min)

• Analysis and Synthesis (4 min)

• Example 1: analysis of a counter (4 min)

• Example 2: analysis of shift register (4 mins)

• Example 3: synthesis of a 2-state FSM (6 min)

• Rest of the lecture:• Discuss, solve and present Question 5, Question 6, or Question 10, 12.

• Questions appear on Page 17 in the reading material. 26

Page 27: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

The Clock

27

Page 28: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Clock Cycles

28

Page 29: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Flip-flop

29

Page 30: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Clock-enabled Flip-Flops

30

Page 31: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

The Zero-delay Model

31

Page 32: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Example: Sequential XOR

32

• How much a comb. circuit that imp. 𝑋𝑂𝑅𝑛 costs at best? Delay?

• Sequential version has cost of 𝑂(1)! How can that be?

Page 33: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Canonic Form of a Synch. Circuit

33

Functionality (without proof):

• Logical value of a signal 𝑋during the 𝑖th clock cycle by 𝑋𝑖

• Claim: For 𝑖 ≥ 0• 𝑆𝑖 = 𝑁𝑆𝑖−1• 𝑁𝑆𝑖 = 𝛿(𝐼𝑁𝑖 , 𝑆𝑖)

• 𝑂𝑈𝑇𝑖 = 𝜆(𝐼𝑁𝑖 , 𝑆𝑖)

• Why every Synch. Circuit can be represented in this Canonic Form?

Page 34: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

FSMs

34

Page 35: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

What does an FSM do?

35

Page 36: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Analysis and Synthesis

36

𝑆𝑦𝑛𝑐ℎ. 𝐶𝑖𝑟𝑐.⇒ 𝐹𝑆𝑀

𝐹𝑆𝑀 ⇒ 𝑆𝑦𝑛𝑐ℎ. 𝐶𝑖𝑟𝑐.

Page 37: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Example 1: Analysis of a Counter

37

Page 38: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Counter Implementation

38

Page 39: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Counter Analysis

39

Page 40: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Example 2: Analysis of Shift Register

40

Page 41: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Example 2: Analysis of Shift Register

41

Page 42: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Example 3: Synthesis of a 2-state FSM

42

Page 43: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Example 3: The circuit

43

Page 44: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

See you on Thursday!Enjoy the discussion ☺

44

Page 45: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

How to Clock Your Computer:Digital Logic Design 3/3Moti Medina

Slides, slides material, and figures are taken from “Digital Logic Design : a rigorous approach” lecture

slides and book by Guy Even and M (Chapters: 15, 17-22). 45

Page 46: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Our Journey: From Transistors to Computers

Transistors GatesGates+wires+acyclicity= combinational circ.

+Flip-flops=Synchronous

circ.CPUs

Today

Picture taken from here. 46

≡ Boolean Functions

≡ FSM

Page 47: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Today’s plan

• 45 min lecture session (~pages 9-17 in the “reading material”).• Sequential Adder (4 min)

• Binary Adder (2 min)

• Ripple Carry Adder (RCA) (4 min)

• Relation between Ripple Carry Adder and Seq. Adder (2 min)

• Recursive Def. of RCA(n) (2 min)

• Registers: parallel load and serial load (aka Shift registers) (6 min)

• Random Access Memory (RAM) (10 min)

• A simplified CPU example – the DLX. (14 min)

• Recap (1 min)

• Rest of the lecture:• Discuss, solve and present Question 7, Question 8, or Question 9.

• Questions appear on Page 17 in the reading material. 47

Page 48: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Sequential Adder

48

Page 49: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Sequential Adder: Implementation

49

Assume 𝑟𝑒𝑠𝑒𝑡𝑖= 1 ↔ 𝑖 = 0

Page 50: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Sequential Adder: Correctness

50

Complete the Pf. (Ex. 7)

Page 51: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Binary Adder

51

Page 52: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Ripple Carry Adder RCA(n)

52

Page 53: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Relation between RCA(n) and Seq. Adder

53

Page 54: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Recursive Definition of RCA(n)

54

Page 55: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Can We Do Better?

• Cost and Delay of RCA(n) are Θ(𝑛).

• Lower bound of Binary Adder Ω log 𝑛 for the delay and Ω(𝑛) for the cost

• What is the cone of the 𝑆[𝑛 − 1]?• What is the cone of 𝐶[𝑛]?• Again: How did we manage to get a const.

size seq. adder then?

• Can you somehow “break” RCA(n) and make it more “parallel”?

• Almost optimal design CSA(n)• Cost is Θ(𝑛log2 3)

• Optimal design uses Parallel-Prefix Comp.• Next semester.

55

Page 56: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

56

Page 57: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Registers

57

Page 58: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Parallel Load Register - specification

58

Page 59: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Parallel Load Register - design

59

Page 60: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Random Access Memory (RAM)

60

Page 61: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

RAM - definition

61

Page 62: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Memory Cell - specification

• Wait a minute…how do we do this for a single bit?

62

Page 63: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

RAM -design

63

Only the 𝐴𝑑𝑟𝑒𝑒𝑠 th bit

is “on”

Page 64: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

64

Page 65: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

We are ready…

• We are now ready to start talking about a high-level implementation of a simplified processor (don’t get confused – this is a huge achievement).

• We know how to implement FSMs and how to implement any Boolean function.

• We also have some (more than) rough idea on how a RAM looks like.

• Let us assume a processor that interacts with a RAM which stores both instructions and data that the processor operates on.

• These instructions have some syntax and semantics, that we won’t discuss here.

• Nevertheless, we will see how to combine all the things that we saw in this series of lectures to implement a “system” that reacts to the bits that encode instructions and we shall see how that data flows in the processor. 65

Page 66: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

The Datapath of the Simplified DLX Machine

66

Page 67: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

ALU Environment

67

Page 68: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Shifter Environment

68

LLS: Left shiftLRS: Right shift

Page 69: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

The GPR Environment

69

Addresses are coming from

the instruction

Page 70: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Special Registers• A, B, C, MAR, MDR, PC, and IR are (ce-)

registers• With some additional logic (e.g., MUXes) for reg’s

with env’s.

• IR (Instruction Reg.) holds the instruction brought from memory.

• A,B,C are used as “interface” registers to the GPR env.

• PC (Program Counter) simply holds a “pointer” to memory which (unless the programmer affects it) advances by 1 after bringing an instruction from memory (e.g., PC env is a CE Counter).

• MAR, MDR (Mem. Add. Reg, Mem. Data. Reg.)holds a memory address that some data should be brought from and MDR holds data that is brought from memory.

• All registers in this processor are 32 bit wide70

Page 71: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

DLX Control• The control is an FSM that interprets the DLX

instructions.

• For every DLX instruction the control output a sequence of control signals that are input to the data-path (clock enables, MUX select bits, etc.)

• These control signals are output according to the state in which the FSM is at and according to the executed instruction…as in every FSM.

• Essentially, these control signals control the way the bits are routed between the registers.

• Let us stop here.

• By now, you know that you can implement any

FSM. The complete processor consists of

the Control and the DATA path.71

Page 72: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Our journey is over: From Transistors to Computers

Transistors GatesGates+wires+acyclicity= combinational circ.

+Flip-flops=Synchronous

circ.CPUs

Picture taken from here. 72

≡ Boolean Functions

≡ FSMCan be imp by a

Synch. Circ.!

Page 73: How to Clock Your Computer: Digital Logic Design 1/3 · 2021. 2. 15. · • Flip-flop and Clock enabled Flip-Flops (4 min) • The Zero-delay model (2 min) • Example: Sequential

Good Luck!Enjoy the discussion ☺

73