Latches, Flip Flops, and Memory ECE/CS 252, Fall 2010 Prof. Mikko Lipasti Department of Electrical and Computer Engineering University of Wisconsin – Madison.

Slides:



Advertisements
Similar presentations
Give qualifications of instructors: DAP
Advertisements

COE 202: Digital Logic Design Sequential Circuits Part 1 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office: Ahmad Almulhem, KFUPM.
ECE C03 Lecture 81 Lecture 8 Memory Elements and Clocking Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Digital Logic Structures: Chapter 3 COMP 2610 Dr. James Money COMP
CS 151 Digital Systems Design Lecture 19 Sequential Circuits: Latches.
1 KU College of Engineering Elec 204: Digital Systems Design Lecture 12 Basic (NAND) S – R Latch “Cross-Coupling” two NAND gates gives the S -R Latch:
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /23/2013 Lecture 7: Computer Clock & Memory Elements Instructor: Ashraf Yaseen DEPARTMENT OF MATH &
Module 12.  In Module 9, 10, 11, you have been introduced to examples of combinational logic circuits whereby the outputs are entirely dependent on the.
1 Lecture 20 Sequential Circuits: Latches. 2 Overview °Circuits require memory to store intermediate data °Sequential circuits use a periodic signal to.
CP208 Digital Electronics Class Lecture 11 May 13, 2009.
Chapter 3 Digital Logic Structures
Chapter 3 Digital Logic Structures. 3-2 Transistor: Building Block of Computers Microprocessors contain millions of transistors Intel Pentium 4 (2000):
Sequential circuit Digital electronics is classified into combinational logic and sequential logic. In combinational circuit outpus depends only on present.
EECC341 - Shaaban #1 Lec # 13 Winter Sequential Logic Circuits Unlike combinational logic circuits, the output of sequential logic circuits.
CS 300 – Lecture 3 Intro to Computer Architecture / Assembly Language Sequential Circuits.
Overview Finite State Machines - Sequential circuits with inputs and outputs State Diagrams - An abstraction tool to visualize and analyze sequential circuits.
Chapter 3 Continued Logic Gates Logic Chips Combinational Logic Sequential Logic Flip Flops Registers Memory Timing State Machines.
Overview Logic Combinational Logic Sequential Logic Storage Devices SR Flip-Flops D Flip Flops JK Flip Flops Registers Addressing Computer Memory.
Overview Recall Combinational Logic Sequential Logic Storage Devices
Lecture 4: Computer Memory
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Wael Qassas/AABU 3-2.
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Transistor: Building.
Revision Mid 2 Prof. Sin-Min Lee Department of Computer Science.
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Hao Ji.
Midterm Wednesday Chapter 1-3: Number /character representation and conversion Number arithmetic CMOS logic elements Combinational logic elements and design.
Fall 2007 L16: Memory Elements LECTURE 16: Clocks Sequential circuit design The basic memory element: a latch Flip Flops.
Computer Science 210 s1 Computer Systems Semester 1 Lecture Notes James Goodman (revised by Robert Sheehan) Credits: Slides prepared by Gregory.
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Building Functions.
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 9 Sequential.
Introduction to Computing Systems from bits & gates to C & beyond Chapter 3 Digital Logic Structures Transistors Logic gates & Boolean logic Combinational.
Introduction to Computing Systems from bits & gates to C & beyond Chapter 3 Digital Logic Structures Transistors Logic gates & Boolean logic Combinational.
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.
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Basic Logic Gates.
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Combinational vs.
SEQUENTIAL CIRCUITS Component Design and Use. Register with Parallel Load  Register: Group of Flip-Flops  Ex: D Flip-Flops  Holds a Word of Data 
Introduction to Computer Engineering ECE/CS 252, Fall 2010 Prof. Mikko Lipasti Department of Electrical and Computer Engineering University of Wisconsin.
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Complete Example.
Chapter 3 Digital Logic Structures. 3-2 Combinational vs. Sequential Combinational Circuit always gives the same output for a given set of inputs  ex:
1 COMP541 Sequential Circuits Montek Singh Feb 1, 2012.
SEQUENTIAL LOGIC By Tom Fitch. Types of Circuits Combinational: Gates Combinational: Gates Sequential: Flip-Flops Sequential: Flip-Flops.
Chapter 3 Digital Logic Structures
PART 3 Digital Logic 1.Logic Gates 2.Logic Circuits 3.Memory 4.Sequential Circuits 5.LC-3 Data Path.
Introduction to Computer Engineering CS/ECE 252, Spring 2012 Prof. Karu Sankaralingam Computer Sciences Department University of Wisconsin – Madison.
Instructor:Po-Yu Kuo 教師:郭柏佑
Introduction to Computer Engineering CS/ECE 252, Fall 2007 Prof. David A. Wood Computer Sciences Department University of Wisconsin – Madison.
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Transistor: Building.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Complex Combinational Logic Blocks ECE/CS 252, Fall 2010 Prof.
Instructor : Po-Yu Kuo 教師:郭柏佑 Ch. 3 Digital Logic Structures EL 1009 計算機概論 ( 電子一 B) Introduction to Computer Science.
CO5023 Latches, Flip-Flops and Decoders. Sequential Circuit What does this do? The OUTPUT of a sequential circuit is determined by the current output.
Introduction to Computing Systems and Programming Digital Logic Structures.
Synchronous Sequential Circuits by Dr. Amin Danial Asham.
CS151 Introduction to Digital Design Chapter 5: Sequential Circuits 5-1 : Sequential Circuit Definition 5-2: Latches 1Created by: Ms.Amany AlSaleh.
Synchronous Sequential Circuits by Dr. Amin Danial Asham.
Digital Logic Structures. Transistor: The Digital Building Block Microprocessors contain LOTS of transistors –Intel Pentium 4 (2000): 48 million –IBM.
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Transistor: Building.
The George Washington University School of Engineering and Applied Science Department of Electrical and Computer Engineering ECE122 – Lab 7 Latches & Flip-flops.
Instructor:Po-Yu Kuo 教師:郭柏佑
Instructor:Po-Yu Kuo 教師:郭柏佑
Introduction to Computer Engineering
Chapter 11 Sequential Circuits.
Yee-Wing Hsieh Steve Jacobs
LECTURE 15 – DIGITAL ELECTRONICS
Chapter 3 Digital Logic Structures
Introduction to Computer Engineering
Chapter 3 Digital Logic Structures
Chapter 3 Digital Logic Structures An Hong 2016 Fall
CSE 370 – Winter Sequential Logic - 1
Instructor:Po-Yu Kuo 教師:郭柏佑
Sequential Circuits: Latches
Sequential Logic.
Presentation transcript:

Latches, Flip Flops, and Memory ECE/CS 252, Fall 2010 Prof. Mikko Lipasti Department of Electrical and Computer Engineering University of Wisconsin – Madison

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Building Functions from Logic Gates We've already seen how to implement truth tables using AND, OR, and NOT, etc. -- examples of combinational logic. Combinational Logic Circuit output depends only on the current inputs stateless Sequential Logic Circuit output depends on the sequence of inputs (past and present) stores information (state) from past inputs Next we’ll show how to build sequential circuits that store information.

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-3 Combinational vs. Sequential Combinational Circuit always gives the same output for a given set of inputs  ex: adder always generates sum and carry, regardless of previous inputs Sequential Circuit stores information output depends on stored information (state) plus input  so a given input might produce different outputs, depending on the stored information example: ticket counter  advances when you push the button  output depends on previous state useful for building “memory” elements and “state machines” Need a storage element

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Storage is based on feedback Feedback – output is fed back to the input What if we add feedback to a pair of inverters? Usually drawn as a ring or cross-coupled inverters: Stable way to store one bit of information

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Storage based on feedback How can we change the value that is stored? 3-5 ABA nand B “Set” “Reset” Result: RS latch A B

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-6 R-S Latch: Simple Storage Element R is used to “reset” or “clear” the element – set it to zero. S is used to “set” the element – set it to one. If both R and S are one, out could be either zero or one. “quiescent” state -- holds its previous value note: if a is 1, b is 0, and vice versa

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-7 R-S Latch Summary R = S = 1 hold current value in latch S = 0, R=1 set value to 1 R = 0, S = 1 set value to 0 R = S = 0 both outputs equal one final state determined by electrical properties of gates Don’t do it! Correct use is a bit tricky, so …

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-8 Gated D-Latch Two inputs: D (data) and WE (write enable) when WE = 1, latch is set to value of D  S = NOT(D), R = D when WE = 0, latch holds previous value  S = R = 1

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-9 Memory Now that we know how to store bits, we can build a memory – a logical k × m array of stored bits. k = 2 n locations m bits Address Space: number of locations (usually a power of 2) Addressability: number of bits per location (e.g., byte-addressable)

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display Example: 2 2 x 3 Memory address decoder word select word WE address write enable input bits output bits

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display More Memory Details This is a not the way actual memory is implemented. fewer transistors and wires, much more dense, relies on electrical properties But the logical structure is very similar. address decoder word select line word write enable Two basic kinds of RAM (Random Access Memory) Static RAM (SRAM) fast, not very dense (bitcell is a latch) Dynamic RAM (DRAM) slower but denser, bit storage must be periodically refreshed each bitcell is a capacitor (like a leaky bucket) that decays Also, non-volatile memories: ROM, PROM, flash, …

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Real SRAM Memory 3-12

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display Review: The Clock A clock circuit triggers transition from one state to the next. At the beginning of each clock cycle, state machine makes a transition, based on the current state and the external inputs. “1” “0” time  One Cycle

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display Sequential Circuits Combinational logic Determine outputs and next state. Storage elements Maintain state representation using … D latches? Clock is used to control WE of D latch Clock is high => D input propagates to output Then loops through combinational logic back to D input Feedback cycle: big no-no for combinational circuits! Have to make sure delay is longer than time that clock is high  Known as min-delay or shortest path constraint Painful, difficult to get right, cannot slow clock down to debug State Machine Combinational Logic Circuit Storage Elements InputsOutputs Clock “1” “0”

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display Instead: Master-Slave Flip-flop A pair of gated D-latches, to isolate next state from current state. During 1 st phase (clock=1), previously-computed state becomes current state and is sent to the logic circuit. During 2 nd phase (clock=0), next state, computed by logic circuit, is stored in Latch A (master).

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Master/Slave Flip-flop Two latches have opposite WE polarity from clock As clock transitions from 0 to 1, master latch closes, slave latch opens As clock transitions from 1 to 0, slave latch closes, master latch opens Flip-flop input is “copied” at the 0 to 1 transition or “edge” There is only a brief window of time where both latches are open (could even be zero, if designed that way) Closes the feedback loop Enables simple reasoning about correctness Short-path problem much easier (trivial, usually) Can slow clock down arbitrarily Hereafter, assume MSFF-based sequential circuits 3-16

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display Summary Sequential circuits have state Need a storage element to remember state RS Latch D Latch Memory Clocking issue with latch-based design D Master/Slave Flip-flop