Memory. The logic and arithmetic circuits we’ve seen so far have no memory. They just transform input to output. Can we make circuits that remember? Memory.

Slides:



Advertisements
Similar presentations
Registers Computer Organization I 1 September 2009 © McQuain, Feng & Ribbens A clock is a free-running signal with a cycle time. A clock may.
Advertisements

Sequential Logic Circuits. Set-Reset Latch The Set-Reset latch or bistable is a simple sequential logic circuit that remembers what has happened to the.
Changes in input values are reflected immediately (subject to the speed of light and electrical delays) on the outputs Each gate has an associated “electrical.
Sequential Logic ENEL 111. Sequential Logic Circuits So far we have only considered circuits where the output is purely a function of the inputs With.
Give qualifications of instructors: DAP
COE 202: Digital Logic Design Sequential Circuits Part 1 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office: Ahmad Almulhem, KFUPM.
Latches CS370 –Spring 2003 Section 4-2 Mano & Kime.
Flip-Flops Computer Organization I 1 June 2010 © McQuain, Feng & Ribbens A clock is a free-running signal with a cycle time. A clock may be.
CS 151 Digital Systems Design Lecture 19 Sequential Circuits: Latches.
Chapter 1 — Computer Abstractions and Technology — 1 Lecture 7 Carry look ahead adders, Latches, Flip-flops, registers, multiplexors, decoders Digital.
1 Lecture 20 Sequential Circuits: Latches. 2 Overview °Circuits require memory to store intermediate data °Sequential circuits use a periodic signal to.
October 16, 2002Flip-flops1 Summary : Latches A sequential circuit has memory. It may respond differently to the same inputs, depending on its current.
Sequential Logic Computer Organization Ellen Walker Hiram College Figures from Computer Organization and Design 3ed, D.A. Patterson & J.L. Hennessey, Morgan.
Flip-Flops Last time, we saw how latches can be used as memory in a circuit. Latches introduce new problems: We need to know when to enable a latch. We.
Our First Real System.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall 1.
Setting the flip-flop The normal value of R and S is zero. S (set) = 0 R (reset) = 0 remembered value 1.
CSE111: Great Ideas in Computer Science Dr. Carl Alphonce 219 Bell Hall Office hours: M-F 11:00-11:
1 Foundations of Software Design Lecture 3: How Computers Work Marti Hearst Fall 2002.
Administrivia Assignments Labs Questions?? Class questions – –Goes to dpd and the TA’s Hand in lab assignments.
CS 300 – Lecture 3 Intro to Computer Architecture / Assembly Language Sequential Circuits.
Instruction Counter Address [3..0] CLK Instruction ROM 0000: : : : : Inst [6..0] Control Unit.
Traffic Light Behavior IF A=1 AND B=0 Car Sensors B A.
Latches Section 4-2 Mano & Kime. Sequential Logic Combinational Logic –Output depends only on current input Sequential Logic –Output depends not only.
Memory; Sequential & Clocked Circuits; Finite State Machines COS 116: 3/25/2008 Sanjeev Arora.
Chp 6: Synchronous sequential logic 1 Synchronous Sequential Logic Acknowledgement: Most of the following slides are adapted from Prof. Kale's slides at.
Lecture 4: Computer Memory
Arithmetic-Logic Units (ALUs). The four-bit adder The basic four-bit adder always computes S = A + B + CI But by changing what goes into the adder inputs.
Digital Logic Design CHAPTER 5 Sequential Logic. 2 Sequential Circuits Combinational circuits – The outputs are entirely dependent on the current inputs.
Digital Electronics and Computer Interfacing Tim Mewes 3. Digital Electronics.
How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora.
COE 202: Digital Logic Design Sequential Circuits Part 1
Memory; Sequential & Clocked Circuits; Finite State Machines
Rabie A. Ramadan Lecture 3
Levels of Architecture & Language CHAPTER 1 © copyright Bobby Hoggard / material may not be redistributed without permission.
CSE115 / CSE503 Introduction to Computer Science I Dr. Carl Alphonce 343 Davis Hall 1.
CS1Q Computer Systems Lecture 11 Simon Gay. Lecture 11CS1Q Computer Systems - Simon Gay2 The D FlipFlop A 1-bit register is called a D flipflop. When.
Multiplexers 1 The output is equal to one of several input signals to the circuit The multiplexer selects which input signal to use as an output signal.
As we study functions we learn terms like input values and output values.
ECA1212 Introduction to Electrical & Electronics Engineering Chapter 9: Digital Electronics – Sequential Logic by Muhazam Mustapha, November 2011.
ITEC 352 Lecture 9 Flip Flops. Flip flops Review Questions? HW #2 posted, due next Friday at 10PM Floating point numbers.
CS 352 : Computer Organization and Design University of Wisconsin-Eau Claire Dan Ernst Latches & Flip-Flops.
SEQUENTIAL LOGIC By Tom Fitch. Types of Circuits Combinational: Gates Combinational: Gates Sequential: Flip-Flops Sequential: Flip-Flops.
July 2, 2002Latches1 Defining a logic unit A logic unit supports different logical functions on two multi-bit inputs X and Y, producing an output G. This.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
Sequential Logic Computer Organization II 1 © McQuain A clock is a free-running signal with a cycle time. A clock may be either high or.
LECTURE IX CH 5 LATCHES AND FLIP-FLOPS. Sequential logic circuits by definition progressive from one logic state to the next. In order for this to occur,
Lecture 5. Sequential Logic 1 Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System Education & Research.
CO5023 Latches, Flip-Flops and Decoders. Sequential Circuit What does this do? The OUTPUT of a sequential circuit is determined by the current output.
CS151 Introduction to Digital Design Chapter 5: Sequential Circuits 5-1 : Sequential Circuit Definition 5-2: Latches 1Created by: Ms.Amany AlSaleh.
Sequential Devices Sequential concept: output depends on present as well as past inputs Past inputs influence operations via memory elements.
1 Sequential Logic The Forbidden Zone Ellen Spertus MCS 111 September 10 and 12, 2002.
4–1. BSCS 5 th Semester Introduction Logic diagram: a graphical representation of a circuit –Each type of gate is represented by a specific graphical.
Combinational circuits
Clocks A clock is a free-running signal with a cycle time.
Computer Science 210 Computer Organization
More Devices: Control (Making Choices)
Flip Flop.
Assistant Prof. Fareena Saqib Florida Institute of Technology
Computer Science 210 Computer Organization
Electronic Homework Submission and Grading
Flip-Flops Last time, we saw how latches can be used as memory in a circuit. Latches introduce new problems: We need to know when to enable a latch. We.
Tri-state buffer A circuit which allows an input to go to output when desired Otherwise it behaves as if “nothing” is connected to the wire An equivalent.
Guest Lecture by David Johnston
Latches The second part of CS231 focuses on sequential circuits, where we add memory to the hardware that we’ve already seen. Our schedule will be very.
ECE 352 Digital System Fundamentals
ECE 352 Digital System Fundamentals
Registers and Counters
ECE 352 Digital System Fundamentals
ECE 352 Digital System Fundamentals
Presentation transcript:

Memory

The logic and arithmetic circuits we’ve seen so far have no memory. They just transform input to output. Can we make circuits that remember? Memory

Matt really likes Sue, but he doesn’t like changing his mind… So: Matt decides to go to the party if Sue decides to go OR if he (Matt) had already planned to go. The Stubborn Guy

Matt decides to go to the party if Sue decides to go OR if he (Matt) had already planned to go. Two inputs to Matt’s decision: Sue, and his own state OR Sue Matt Feedback Wire He Needs Feedback (from Himself)

Matt decides to go to the party if Sue decides to go OR if he (Matt) had already planned to go. If Sue decides to go... OR Sue Matt 1 The Stubborn Guy: Feedback

Matt decides to go to the party if Sue decides to go OR if he (Matt) had already planned to go. If Sue decides to go, Matt will go. OR Sue Matt The Stubborn Guy: Feedback

Matt decides to go to the party if Sue decides to go OR if he (Matt) had already planned to go. If Sue changes her mind… OR Sue Matt The Stubborn Guy: Feedback

Matt decides to go to the party if Sue decides to go OR if he (Matt) had already planned to go. If Sue changes her mind, Matt will still go! Once he decides to go, we can’t get him to change his mind OR Sue Matt The Stubborn Guy: Feedback

Matt doesn’t like Rita Matt decides to go to the party if Sue decides to go OR: If he (Matt) had already planned to go AND Rita decides NOT to go. Enter Rita

Matt doesn’t like Rita Matt decides to go to the party if Sue decides to go OR: If he (Matt) had already planned to go AND Rita decides NOT to go. OR AND Sue Rita Matt Feedback Wire Enter Rita

Matt doesn’t like Rita Matt decides to go to the party if Sue decides to go OR: If he (Matt) had already planned to go AND Rita decides NOT to go. OR AND Sue Rita Matt Enter Rita

Matt doesn’t like Rita Matt decides to go to the party if Sue decides to go OR: If he (Matt) had already planned to go AND Rita decides NOT to go. OR AND Sue Rita Matt Enter Rita

Matt doesn’t like Rita Matt decides to go to the party if Sue decides to go OR: If he (Matt) had already planned to go AND Rita decides NOT to go. OR AND Sue Rita Matt Enter Rita

Matt doesn’t like Rita Matt decides to go to the party if Sue decides to go OR: If he (Matt) had already planned to go AND Rita decides NOT to go. OR AND Sue Rita Matt Enter Rita

Matt doesn’t like Rita Matt decides to go to the party if Sue decides to go OR: If he (Matt) had already planned to go AND Rita decides NOT to go. OR AND Sue Rita Matt 0 – nothing changes: Sue can make Matt go, but cannot make him not go Enter Rita

Matt doesn’t like Rita (maybe together they can make him not go) Matt decides to go to the party if Sue decides to go OR: If he (Matt) had already planned to go AND Rita decides NOT to go. OR AND Sue Rita Matt Enter Rita

Matt doesn’t like Rita Matt decides to go to the party if Sue decides to go OR: If he (Matt) had already planned to go AND Rita decides NOT to go. OR AND Sue Rita Matt Enter Rita

Matt doesn’t like Rita Matt decides to go to the party if Sue decides to go OR: If he (Matt) had already planned to go AND Rita decides NOT to go. OR AND Sue Rita Matt Enter Rita

Matt doesn’t like Rita Matt decides to go to the party if Sue decides to go OR: If he (Matt) had already planned to go AND Rita decides NOT to go. OR AND Sue Rita Matt Enter Rita

Matt doesn’t like Rita Matt decides to go to the party if Sue decides to go OR: If he (Matt) had already planned to go AND Rita decides NOT to go. OR AND Sue Rita Matt Enter Rita

Matt doesn’t like Rita Matt decides to go to the party if Sue decides to go OR: If he (Matt) had already planned to go AND Rita decides NOT to go. OR AND Sue Rita Matt Enter Rita

Matt doesn’t like Rita Matt decides to go to the party if Sue decides to go OR: If he (Matt) had already planned to go AND Rita decides NOT to go. OR AND Sue Rita Matt Enter Rita - no change

What Sue and Rita Can Do Sue can make Matt go, but cannot make him not go Rita can make Matt not go, but cannot make him go

OR AND Set Reset M M becomes 1 if Set is turned on M becomes 0 if Reset is turned on Otherwise (if both are 0), M just remembers its value The (SR) Flip-Flop

M becomes 1 if Set is turned on M becomes 0 if Reset is turned on Otherwise (if both are 0), M just remembers its value S R M The Flip-Flop

D W M What We Really Want Nothing happens unless Write = 1 If Write = 1, then M becomes set to D Once Write = 0 again, M just keeps its value. (It ignores D.) So, to set M to a value and store it as long as desired, set D to that value, then set W to 1 and then back to 0

AND Nothing happens unless Write = 1 S R M D Write The Data Flip-Flop

AND Nothing happens unless Write = 1 If Write = 1, then M becomes set to D Once Write = 0 again, M just keeps its value. (It ignores D.) S R M D Write The Data Flip-Flop

AND Initially, Write = 0. Let’s say M = 1. S R M D Write Using a Data Flip-Flop

AND Initially, Write = 0. Let’s say M = 1. First, set D to desired value, say 0. S R M D Write Using a Data Flip-Flop

AND Initially, Write = 0. Let’s say M = 1. First, set D to desired value, say 0. Then, set Write to 1. S R M D Write Using a Data Flip-Flop

AND Initially, Write = 0. Let’s say M = 1. First, set D to desired value, say 0. Then, set Write to 1. This causes M to be reset to 0. Note use of abstraction with regard to SR flip-flop S R M D Write Using a Data Flip-Flop

AND Initially, Write = 0. Let’s say M = 1. First, set D to desired value, say 0. Then, set Write to 1. This causes M to be reset to 0. Finally set Write back to 0. Now D is irrelevant. S R M D Write ? 1 Using a Data Flip-Flop

If Write = 0, M just keeps its value. (It ignores D.) If Write = 1, then M becomes set to D D Write M The Data Flip-Flop

Are We Done?

When Write = 1, then M = D. If we have some feedback between M and D, then circuit could go haywire. D Write M ?? A Subtle Problem

For example, suppose a NOT gate connects M and D. When Write = 1, M and D keep changing. We have no control. D Write M NOT 1 ? ? A Subtle Problem

We want to control the feedback, so that each time we set Write to 1 and then back to 0, M stores only the last value of D (In this case, M should invert itself once each time we set Write to 1 and back to 0) D Write M NOT 1 ? ? A Subtle Problem

D1D1 W1W1 M1M1 D0D0 W0W0 M0M0 “Outer door” “Inner door” Write Two-Stage System to prevent D ever passing through directly to M (W 0,W 1 connected by NOT, so never 1 at the same time) D M The “Airlock” Flip-Flop

D1D1 W1W1 M1M1 D0D0 W0W0 M0M0 “Outer door” “Inner door” Write We start with Write = 0. Let’s say D is always NOT M; i.e. connected by NOT gate. Start with D = 0, M = 1. D M The “Airlock” Flip-Flop

D1D1 W1W1 M1M1 D0D0 W0W0 M0M0 “Outer door” “Inner door” Write We start with Write = 0. Let’s say D is always NOT M; i.e. connected by NOT gate Start with D = 0, M = 1. D M The “Airlock” Flip-Flop

D1D1 W1W1 M1M1 D0D0 W0W0 M0M0 “Outer door” “Inner door” Write Want to store D in memory. Set Write to 1 D M The “Airlock” Flip-Flop

D1D1 W1W1 M1M1 D0D0 W0W0 M0M0 “Outer door” “Inner door” Write Want to store D in memory. Set Write to 1 “Outer” flip-flop sets M 0 = D 0 = 0 “Inner” flip-flop ignores D 1 since W 1 = 0 D M The “Airlock” Flip-Flop

D1D1 W1W1 M1M1 D0D0 W0W0 M0M0 “Outer door” “Inner door” Write Now, set Write back to 0 D M The “Airlock” Flip-Flop

D1D1 W1W1 M1M1 D0D0 W0W0 M0M0 “Outer door” “Inner door” Write Now, set Write back to 0 Now “Inner” flip-flop sets M = D 1 = 0 D M The “Airlock” Flip-Flop

D1D1 W1W1 M1M1 D0D0 W0W0 M0M0 “Outer door” “Inner door” Write Because of feedback, D might change to (NOT M), which is 1 But Write = 0, so “Outer” flip-flop ignores D, so M 0 stays 0. D M The “Airlock” Flip-Flop

D1D1 W1W1 M1M1 D0D0 W0W0 M0M0 “Outer door” “Inner door” Write So memory does not change until we “toggle” Write. (“toggle” means change from 0 to 1 or vice versa) D M The “Airlock” Flip-Flop

D1D1 W1W1 M1M1 D0D0 W0W0 M0M0 “Outer door” “Inner door” Write This is Real Memory! D M The “Airlock” Flip-Flop

D M W D M W D M W D M W Write Data 1 Data 2 Data 3 Data 4 Memory “Register”: 4 bits

Review We have used the Universal method to build –ALU –Memory Next steps –State machines to computer with memory –Building the computer –Writing a program to use the computer