Computer Organization and Design Memories and State Machines Montek Singh Mon, April 13, 2011 Lecture 14.

Slides:



Advertisements
Similar presentations
Control path Recall that the control path is the physical entity in a processor which: fetches instructions, fetches operands, decodes instructions, schedules.
Advertisements

Introduction to CMOS VLSI Design Sequential Circuits.
VLSI Design EE 447/547 Sequential circuits 1 EE 447/547 VLSI Design Lecture 9: Sequential Circuits.
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.
Introduction to Sequential Logic Design Latches. 2 Terminology A bistable memory device is the generic term for the elements we are studying. Latches.
MICROELETTRONICA Sequential circuits Lection 7.
Modern VLSI Design 4e: Chapter 5 Copyright  2008 Wayne Wolf Topics n Memory elements. n Basics of sequential machines.
Lecture 11: Sequential Circuit Design. CMOS VLSI DesignCMOS VLSI Design 4th Ed. 11: Sequential Circuits2 Outline  Sequencing  Sequencing Element Design.
CHAPTER 3 Sequential Logic/ Circuits.  Concept of Sequential Logic  Latch and Flip-flops (FFs)  Shift Registers and Application  Counters (Types,
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /23/2013 Lecture 7: Computer Clock & Memory Elements Instructor: Ashraf Yaseen DEPARTMENT OF MATH &
Sequential Logic Handouts: Lecture Slides : Progress so far… PHYSICS: Continuous variables, Memory, Noise, f(RC) = 1 - e-t/R COMBINATIONAL: Discrete,
Copyright © 2001 Stephen A. Edwards All rights reserved Review of Digital Logic Prof. Stephen A. Edwards.
Circuits require memory to store intermediate data
EKT 124 / 3 DIGITAL ELEKTRONIC 1
LOGIC GATES ADDERS FLIP-FLOPS REGISTERS Digital Electronics Mark Neil - Microprocessor Course 1.
Sequential Circuits. Outline  Floorplanning  Sequencing  Sequencing Element Design  Max and Min-Delay  Clock Skew  Time Borrowing  Two-Phase Clocking.
1 Lecture 28 Timing Analysis. 2 Overview °Circuits do not respond instantaneously to input changes °Predictable delay in transferring inputs to outputs.
Sequential Logic Flip-Flops and Related Devices Dr. Rebhi S. Baraka Logic Design (CSCI 2301) Department of Computer Science Faculty.
10/13/2005Comp 120 Fall October Questions? Today Control.
EECC341 - Shaaban #1 Lec # 13 Winter Sequential Logic Circuits Unlike combinational logic circuits, the output of sequential logic circuits.
Chapter 10. Memory, CPLDs, and FPGAs
CS 300 – Lecture 3 Intro to Computer Architecture / Assembly Language Sequential Circuits.
L14 – Control & Execution 1 Comp 411 – Fall /04/09 Control & Execution Finite State Machines for Control MIPS Execution.
L14 – Memory 1 Comp 411 – Spring /18/08 Memory, Latches, & Registers 1) Structured Logic Arrays 2) Memory Arrays 3) Transparent Latches 4) How to.
Overview Logic Combinational Logic Sequential Logic Storage Devices SR Flip-Flops D Flip Flops JK Flip Flops Registers Addressing Computer Memory.
Lecture 4: Computer Memory
Modern VLSI Design 2e: Chapter 5 Copyright  1998 Prentice Hall PTR Topics n Memory elements. n Basics of sequential machines.
CS 151 Digital Systems Design Lecture 20 Sequential Circuits: Flip flops.
Sequential Circuits. 2 Sequential vs. Combinational Combinational Logic:  Output depends only on current input −TV channel selector (0-9) Sequential.
L15 – Control & Execution 1 Comp 411 – Spring /25/08 Control & Execution Finite State Machines for Control MIPS Execution.
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Hao Ji.
Introduction to CMOS VLSI Design Lecture 10: Sequential Circuits Credits: David Harris Harvey Mudd College (Material taken/adapted from Harris’ lecture.
Contemporary Logic Design Sequential Logic © R.H. Katz Transparency No Chapter #6: Sequential Logic Design Sequential Switching Networks.
Fall 2007 L16: Memory Elements LECTURE 16: Clocks Sequential circuit design The basic memory element: a latch Flip Flops.
CS3350B Computer Architecture Winter 2015 Lecture 5.2: State Circuits: Circuits that Remember Marc Moreno Maza [Adapted.
Digital Computer Design Fundamental
COE 202: Digital Logic Design Sequential Circuits Part 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.
FPGA-Based System Design: Chapter 3 Copyright  2004 Prentice Hall PTR Topics n Latches and flip-flops. n RAMs and ROMs.
SEQUENTIAL CIRCUITS Component Design and Use. Register with Parallel Load  Register: Group of Flip-Flops  Ex: D Flip-Flops  Holds a Word of Data 
מבנה מחשב תרגול 2. 2 Boolean AND Operation Truth Table Equivalent Gate Different notations:
Instructor: Alexander Stoytchev CprE 281: Digital Logic.
1 COMP541 Sequential Circuits Montek Singh Feb 1, 2012.
L05 – Logic Synthesis Fall /19/02 Hmmm, by sharing the decoder part of the logic MUXs could be adapted to make lookup tables with any number.
Sp09 CMPEN 411 L18 S.1 CMPEN 411 VLSI Digital Circuits Spring 2009 Lecture 16: Static Sequential Circuits [Adapted from Rabaey’s Digital Integrated Circuits,
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Dr. Shi Dept. of Electrical and Computer Engineering.
Computer Organization and Design Memories and State Machines Montek Singh Wed, Nov 6-11, 2013 Lecture 13.
ECE C03 Lecture 81 Lecture 8 Memory Elements and Clocking Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Synchronous Sequential Logic A digital system has combinational logic as well as sequential logic. The latter includes storage elements. feedback path.
Lecture 5. Sequential Logic 1 Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System Education & Research.
Instructor: Alexander Stoytchev CprE 281: Digital Logic.
Synchronous Sequential Circuits by Dr. Amin Danial Asham.
CS61C L24 State Elements : Circuits that Remember (1) Garcia, Fall 2014 © UCB Senior Lecturer SOE Dan Garcia inst.eecs.berkeley.edu/~cs61c.
07/11/2005 Register File Design and Memory Design Presentation E CSE : Introduction to Computer Architecture Slides by Gojko Babić.
Latches, Flip Flops, and Memory ECE/CS 252, Fall 2010 Prof. Mikko Lipasti Department of Electrical and Computer Engineering University of Wisconsin – Madison.
Copyright © 2001 Stephen A. Edwards All rights reserved Busses  Wires sometimes used as shared communication medium  Think “party-line telephone”  Bus.
Digital Integrated Circuits A Design Perspective
Computer Organization and Design Memories and State Machines
Control & Execution Finite State Machines for Control MIPS Execution.
Morgan Kaufmann Publishers
SEQUENTIAL LOGIC -II.
Chapter 11 Sequential Circuits.
Latches and Flip-flops
Control & Execution Finite State Machines for Control MIPS Execution.
CPE/EE 422/522 Advanced Logic Design L02
COMP541 Sequential Circuits
Instructor: Alexander Stoytchev
22 October 3 classes before 2nd exam! Control 1/16/2019
April 3 Fun with MUXes Implementing arbitrary logical functions
Memory, Latches, & Registers
Presentation transcript:

Computer Organization and Design Memories and State Machines Montek Singh Mon, April 13, 2011 Lecture 14

Memory, Latches, & Registers 1)Structured Logic Arrays 2)Memory Arrays 3)Transparent Latches 4)How to save a few bucks at toll booths! 5)Edge-triggered Registers 6)Finite State Machines

Memory as a Lookup Table  A multiplexer to implement a lookup table: Remember that, in theory, we can build any 1-output combinational logic block with multiplexers Remember that, in theory, we can build any 1-output combinational logic block with multiplexers For an N-input function we need a 2 N input multiplexer For an N-input function we need a 2 N input multiplexer  BIG Multiplexers? How about 10-input function? 20-input? How about 10-input function? 20-input? MUX Logic AB Fn(A,B)

A Mux’s Guts Hmmm, by sharing the decoder part of the logic MUXs could be adapted to make lookup tables with any number of outputs I 00 I 01 I 10 I 11 A B A B A B A B Y DecoderSelector Multiplexers can be partitioned into two sections. A DECODER that identifies the desired input,and a SELECTOR that enables that input onto the output. A decoder generates all possible product terms for a set of inputs

A New Combinational Device k D1D1 D2D2 DNDN DECODER: k SELECT inputs, N = 2 k DATA OUTPUTs. Selected D j HIGH; all others LOW. NOW, we are well on our way to building a general purpose table-lookup device. We can build a 2-dimensional ARRAY of decoders and selectors as follows... Have I mentioned that HIGH is a synonym for ‘1’ and LOW means the same as ‘0’

Shared Decoding Logic A B C in S C out There’s an extra level of inversion that isn’t necessary in the logic. However, it reduces the capacitive load on the module driving this one. These are just “DeMorgan”ized NOR gates Made from PREWIRED connections, and CONFIGURABLE connections that can be either connected or not connected We can build a general purpose “table-lookup” device called a Read- Only Memory (ROM), from which we can implement any truth table and, thus, any combinational device Decoder Configurable Selector This ROM stores 16 bits in 8 words of 2 bits.

Logic According to ROMs  ROMs ignore the structure of combinational functions... Size, layout, and design are independent of function Size, layout, and design are independent of function Any Truth table can be “programmed” by minor reconfiguration: Any Truth table can be “programmed” by minor reconfiguration:  Metal layer (masked ROMs)  Fuses (Field-programmable PROMs)  Charge on floating gates (EPROMs) ... etc.  Model: LOOK UP value of function in truth table... Inputs: “ADDRESS” of a T.T. entry Inputs: “ADDRESS” of a T.T. entry ROM SIZE = # TT entries... ROM SIZE = # TT entries... ... for an N-input boolean function, size = __________ 2 N x #outputs

Analog Storage: Using Capacitors  We’ve chosen to encode information using voltages and we know from physics that we can “store” a voltage as “charge” on a capacitor Pros: Pros:  compact! Cons: Cons:  it leaks!  refresh  complex interface  reading a bit, destroys it –(you have to rewrite the value after each read)  it’s NOT a digital circuit bit line N-channel FET serves as an access switch V REF To write: Drive bit line, turn on access fet, force storage cap to new voltage To read: precharge bit line, turn on access fet, detect (small) change in bit line voltage word line This storage circuit is the basis for commodity DRAMs

Y S B A “Digital” Storage Element  It’s also easy to build a settable DIGITAL storage element (called a latch) using a MUX and FEEDBACK: 0 1 G0011G0011 D Q IN Q OUT Q follows D Q stable “state” signal appears as both input and output A D G Q Here’s a feedback path, so it’s no longer a combinational circuit.

Looking Under the Covers  Let’s take a quick look at the equivalent circuit for our MUX when the control is LOW (the feedback path is active) D G=0 Q Q D Q This storage circuit is the basis for commodity SRAMs Advantages: 1) Maintains remembered state for as long as power is applied. 2) State is DIGITAL Disadvantage: 1) Requires more transistors

Why Does Feedback = Storage?  Key Idea: use positive feedback to maintain storage indefinitely logic gates are built to restore marginal signal levels, so noise shouldn’t be a problem! logic gates are built to restore marginal signal levels, so noise shouldn’t be a problem! V IN V OUT Result: a “bi-stable” storage element

Static D Latch G DQ D G Q stable Q follows D Positive latch Q “static” means latch will hold data (i.e., value of Q) while G is inactive, however long that may be. G DQ Negative latch Q G D 1 0 What is the difference?

Latch Timing  Circuits with memory must follow some rules Guarantee that inputs to sequential devices are valid and stable during periods when they may influence state changes Guarantee that inputs to sequential devices are valid and stable during periods when they may influence state changes  This is assured with additional timing specifications G D >t PULSE t PULSE (minimum pulse width): guarantee G is active for long enough for latch to capture data >t SETUP t SETUP (setup time): guarantee that D value has propagated through feedback path before latch becomes opaque >t HOLD t HOLD (hold time): guarantee latch is opaque and Q is stable before allowing D to change again

Flakey Control Systems Here’s a strategy for saving 2 bucks the next time you find yourself at a toll booth!

Flakey Control Systems Here’s a strategy for saving 2 bucks the next time you find yourself at a toll booth!

Flakey Control Systems WARNING: Professional Drivers Used! DON’T try this At home! Here’s a strategy for saving 2 bucks the next time you find yourself at a toll booth!

Escapement Strategy The Solution: Add two gates and only open one at a time.

Escapement Strategy The Solution: Add two gates and only open one at a time.

Escapement Strategy The Solution: Add two gates and only open one at a time.

Escapement Strategy The Solution: Add two gates and only open one at a time. (Psst… Don’t tell the toll folks)

Escapement Strategy The Solution: Add two gates and only open one at a time. (Psst… Don’t tell the toll folks)

Escapement Strategy The Solution: Add two gates and only open one at a time. (Psst… Don’t tell the toll folks)

Escapement Strategy The Solution: Add two gates and only open one at a time. (Psst… Don’t tell the toll folks)

Escapement Strategy The Solution: Add two gates and only open one at a time.

Escapement Strategy The Solution: Add two gates and only open one at a time.

Escapement Strategy The Solution: Add two gates and only open one at a time. (Psst… Don’t tell the toll folks)

Escapement Strategy The Solution: Add two gates and only open one at a time. (Psst… Don’t tell the toll folks)

Escapement Strategy The Solution: Add two gates and only open one at a time. (Psst… Don’t tell the toll folks)

Escapement Strategy The Solution: Add two gates and only open one at a time. (Psst… Don’t tell the toll folks)

Escapement Strategy The Solution: Add two gates and only open one at a time.

Escapement Strategy The Solution: Add two gates and only open one at a time.

Escapement Strategy The Solution: Add two gates and only open one at a time. (Psst… Don’t tell the toll folks) Key Idea: At no time is there an open path through both gates…

G DQ G DQ Edge-triggered Flip Flop  Logical “escapement”: Double-gated toll booth built using logic gates Double-gated toll booth built using logic gates  Observations: only one latch “transparent” at any time: only one latch “transparent” at any time:  master closed when slave is open (CLK is high)  slave closed when master is open (CLK is low)  no combinational path all the way through flip flop Q only changes shortly after 0  1 transition of CLK, so flip flop appears to be “triggered” by rising edge of CLK Q only changes shortly after 0  1 transition of CLK, so flip flop appears to be “triggered” by rising edge of CLK DQ D CLK QD Q masterslave Transitions mark instants, not intervals

Flip Flop Waveforms G DQ G DQDQ D CLK QD Q masterslave D CLK Q master closed slave open slave closed master open

Flip Flop Timing CLK D Q DQ D Q <t PD t PD : maximum propagation delay, CLK  Q >t SETUP t SETUP : setup time guarantee that D has propagated through feedback path before master closes >t HOLD t HOLD : hold time guarantee master is closed and data is stable before allowing D to change

Synchronous Systems Flipflop Combinational logic Flipflop leading edge trailing edge On the leading edge of the clock, the input of a flipflop is transferred to the output and held. We must be sure the output of the combinational logic has settled before the next leading clock edge. Clock data

Fetching Sequential Instructions PCPC 4 Read Address Instruction Memory How about branch? flipflop +

Datapath for R-type Instructions Read Reg. 1 (rs) Read Reg. 2 (rt) Write Reg. (rd) Write Data data 1 data 2 3 ALU Operation Inst Bits Inst Bits Inst Bits RegWrite 32

MUX Blocks Out 210 Select Input 8 3 Select InOut The select signal determines which of the inputs is connected to the output

Inside there is a 32 way MUX per bit Register 0 Register 1 Register 2 Register 3 Register 4 Register... Register 30 Register to1 MUX Read Reg 1 Data 1 For EACH bit in the 32 bit register LOT’S OF CONNECTIONS! And this is just one port! Remember, there’s data1 and data2 coming out of the register file! 5

Our Register File has 3 ports Read Reg Read Reg. 2 Write Reg. Write Data data 1 data 2 Inst Bits Inst Bits Inst Bits RegWrite 32 2 Read Ports 1 Write Port REALLY LOTS OF CONNECTIONS! This is one reason we have only a small number of registers What’s another reason?

Finite State Machines  What is a State Machine? Remember automata? Remember automata? It is defined by the following: It is defined by the following:  Set of STATES  Set of INPUTS  Set of OUTPUTS  A mapping from (STATES, INPUTS) to … … the next STATE and an OUTPUT STATE represents memory! STATE represents memory!

Implementing an FSM State (flipflops) Function (comb. logic) Inputs Outputs Clock

Summary  Regular Arrays can be used to implement arbitrary logic functions  Memories ROMs are HARDWIRED memories ROMs are HARDWIRED memories RAMs include storage elements that are read-write RAMs include storage elements that are read-write  dynamic memory: compact, only reliable short-term  static memory: controlled use of positive feedback  For static storage: Level-sensitive D-latches; edge-triggered flipflops Level-sensitive D-latches; edge-triggered flipflops Timing issues: setup and hold times Timing issues: setup and hold times  Finite State Machines (FSM) With just a register and some logic, we can implement a state machine With just a register and some logic, we can implement a state machine