how circuits acquire memory: sequential & clocked circuits. cos 116, spring 2011 sanjeev arora

29
How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

Upload: virginia-ward

Post on 26-Dec-2015

230 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

How circuits acquire memory: Sequential &

Clocked Circuits.COS 116, Spring 2011Sanjeev Arora

Page 2: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

Midterm

Midterm exam scores

Formula for overall grade: 50% exam + 25% HW + labs, 25% participation

Page 3: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

Recap: Combinational Circuits

Crossed wires that are not connected are sometimes drawn like this.

No loops allowed (direct or indirect)

Wires: transmit voltage(and hence value)

Page 4: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

Timing Diagram

5V

0VTime

X

5V

0VTime

output

NOT gate

delay

Page 5: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

Recap: Combinational circuit for binary addition?

Want to design a circuit to add any two N-bit integers (say N =64).

2511001

+29 11101

54 110110

Is the truth table method useful? Ideas?

Page 6: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

Modular design

Have small numberof basic components.

Put them together to achieve desired functionality

Basic principle of modern industrial design; recurring theme in next few lectures.

Page 7: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

1-bit adder

(Carry from previous adder)

Hand in on Mar 22: Truth table, circuit for 1-bit adder.

ak bk

ck1-ADDck+1

sk

Carry bit for

next adder.

Page 8: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

Modular Designfor boolean circuits

An N-bit adder using N 1-bit adders(will do Mar 22)

Page 9: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

A Full Adder (from handout)

Page 10: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

Memory

Rest of this lecture:How boolean circuits can have “memory”.

Page 11: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

What do you understand by ‘memory”?

How can you tell that a 1-year old child has it?

Behaviorist’s answer: His/her actions depend upon past events.

Page 12: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

Why combinational circuits have no “memory”

Wires: transmit voltage(and hence value)

Boolean gates connected by wires

Important: no loops allowed

Output is determined by current inputs;no “memory” of past values of the inputs.

Today: Circuits with loops; aka “Sequential Circuits”

Page 13: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

Matt likes Sue but he doesn’t like changing his mind Represent with a circuit:

Matt will go to the party if Sue goes or if he already wanted to go

S

M Is this well-defined?

Page 14: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

Sequential Circuits

Circuits with AND, OR and NOT gates.

Cycles are allowed (ie outputs can feed

back into inputs)

Can exhibit “memory”.

Sometimes may have “undefined” values

How to write the “truth table”? Suggestions?

Page 15: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

Enter Rita

Matt will go to the party if Sue goes OR if the following holds: if Rita does not go and he already wanted to go.

?

M

S

R

MR, S: “control” inputs

What combination of R, S changes M?

Page 16: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

R-S LatchS

R

M

Page 17: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

A more convenient form of memory

Fact: “Data Flip-Flop” or “D flip flop”;can be implemented using two R-S flip flops.

No“undefined”outputs ever!

Page 18: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

“Register” with 4 bits of memory

Page 19: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

What controls the “Write” signal?

Page 20: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

The “symphony” inside a computer

Clock

Combinational circuit

Memory

ClockedSequentialCircuit(akaSynchronousCircuits)

Page 21: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

Timing diagram (analog of truth table for sequential circuits)

R S M(t) M(t+1)

0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

Fill in timing diagram for RS latch and hand in on a piece of paper.

Page 22: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

Clocked Sequential Circuits

Page 23: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

Synchronous Sequential Circuit(aka Clocked Sequential Circuit)

CLOCK

INPUTSCombinational

CircuitMemory

(flip-flops)

Page 24: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

Shorthand

Combinational Circuit

Memory(flip-flops)

CLK

This stands for “lots of wires”(aka “bus”)

Page 25: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

Clock Speeds

Heinrich Hertz1857-94

1974 Intel 8080 2 MHz(Mega = Million)

1981 Original IBM PC 4.77 MHz

1993 Intel Pentium 66 MHz

2005 Pentium 4 3.4 GHz(Giga = Billion)

Page 26: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

What limits clock speed?

Combinational Circuit

Memory(flip-flops)

CLK

Delays in combinational logic (remember the adder). Clock cycle = time needed for circuit value to settle.During 1 clock cycle of Pentium 4, light travels: 4 inches

Page 27: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

Finite State Machines

Read handout (Brian Hayes article) for next time.

Page 28: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

Example: State diagram for automatic door

Closed Open

Detected PersonNo Person

Detected

Detected Person

No Person Detected

Finite # of “states”;Transition rules between states

Page 29: How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora

Next lectures…

FSMs Computer organization: CPUs and RAM Lessons from computer architecture.