10-1 Introduction Chapter #7: Sequential Logic Case Studies.

Slides:



Advertisements
Similar presentations
Lecture 15 Finite State Machine Implementation
Advertisements

COUNTERS Counters with Inputs Kinds of Counters Asynchronous vs
Prith Banerjee ECE C03 Advanced Digital Design Spring 1998
ECE C03 Lecture 81 Lecture 8 Memory Elements and Clocking Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Digital Logic Chapter 5 Presented by Prof Tim Johnson
Page 1 Sequential Logic Basic Binary Memory Elements.
Sequential Logic Case Studies
Homework Reading Machine Projects Labs Tokheim Chapter 9.1 – 9.6
Contemporary Logic Design Sequential Case Studies © R.H. Katz Transparency No Chapter #7: Sequential Logic Case Studies 7.1, 7.2 Counters.
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.
Contemporary Logic Design Sequential Case Studies © R.H. Katz Transparency No Chapter #7: Sequential Logic Case Studies 7.4 Counters.
Overview Recall Combinational Logic Sequential Logic Storage Devices
Registers  Flip-flops are available in a variety of configurations. A simple one with two independent D flip-flops with clear and preset signals is illustrated.
11/16/2004EE 42 fall 2004 lecture 331 Lecture #33: Some example circuits Last lecture: –Edge triggers –Registers This lecture: –Example circuits –shift.
Logic and Computer Design Fundamentals Registers and Counters
ENGIN112 L27: Counters November 5, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 27 Counters.
ECE C03 Lecture 101 Lecture 10 Registers, Counters and Shifters Prith Banerjee ECE C03 Advanced Digital Design Spring 1998.
Contemporary Logic Design FSM Optimization © R.H. Katz Transparency No Chapter #9: Finite State Machine 9.4 Choosing Flip-Flops 9.5 Machine Partitioning.
CS370 Counters. Overview °Counter: A register that goes through a prescribed series of states °Counters are important components in computers. °Counters.
C.S. Choy1 SEQUENTIAL LOGIC A circuit’s output depends on its previous state (condition) in addition to its current inputs The state of the circuit is.
ECE C03 Lecture 91 Lecture 9 Registers, Counters and Shifters Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Contemporary Logic Design Sequential Logic © R.H. Katz Transparency No Chapter #6: Sequential Logic Design Sequential Switching Networks.
Contemporary Logic Design Sequential Case Studies © R.H. Katz Transparency No Chapter #7: Sequential Logic Case Studies 7.6 Random Access Memories.
Introduction Flip-flops are synchronous bistable devices. The term synchronous means the output changes state only when the clock input is triggered. That.
Lecture 21 Overview Counters Sequential logic design.
EKT 124 / 3 DIGITAL ELEKTRONIC 1
Chapter 1_4 Part II Counters
1 Sequential Circuits Registers and Counters. 2 Master Slave Flip Flops.
1 Flip Flops, Registers Today: Latches, Flip FlipsFirst Hour: Types of Latches, Flip Flips –Section of Katz’s Textbook –In-class Activity #1.
EE345: Introduction to Microcontrollers Register and Counters Prof. Ahmad Abu-El-Haija.
Lecture 27 Counters Give qualifications of instructors: DAP
Sequential Circuits Chapter 4 S. Dandamudi To be used with S. Dandamudi, “Fundamentals of Computer Organization and Design,” Springer,  S.
Test #2 Combinational Circuits – MUX Sequential Circuits – Latches – Flip-flops – Clocked Sequential Circuits – Registers/Shift Register – Counters – Memory.
EE24C Digital Electronics Projects
1 Random-Access Memory (RAM) Note: We’re skipping Sec 7.5 Today: First Hour: Static RAM –Section 7.6 of Katz’s Textbook –In-class Activity #1 Second Hour:
Page 1 Registers and Counters. Page 2 What is a Register?  A Register is a collection of n flip-flops with some common function or characteristic  Control.
1 Registers and Counters A register consists of a group of flip-flops and gates that affect their transition. An n-bit register consists of n-bit flip-flops.
No. 7-1 Chapter #7: Sequential Logic Case Studies.
VII - Finite State Machines © Copyright 2004, Gaetano Borriello and Randy H. Katz 1 Finite State Machines (FSM) Sequential circuits  primitive sequential.
SEQUENTIAL CIRCUITS Component Design and Use. Register with Parallel Load  Register: Group of Flip-Flops  Ex: D Flip-Flops  Holds a Word of Data 
2017/4/24 CHAPTER 6 Counters Chapter 5 (Sections )
Counters By Taweesak Reungpeerakul
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 17 Dr. Shi Dept. of Electrical and Computer Engineering.
1 CSE370, Lecture 15 Lecture 15 u Logistics n HW5 due this Friday n HW6 out today, due Friday Feb 20 n I will be away Friday, so no office hour n Bruce.
ENG241 Digital Design Week #8 Registers and Counters.
Registers and Counters Chapter 6. Digital Circuits 2 Clocked sequential circuits a group of flip-flops and combinational gates connected to form a feedback.
Chap 5. Registers and Counters. Chap Definition of Register and Counter l a clocked sequential circuit o consist of a group of flip-flops & combinational.
Asynchronous vs. Synchronous Counters Ripple Counters Deceptively attractive alternative to synchronous design style State transitions are not sharp! Can.
 Seattle Pacific University EE Logic System DesignMemory-1 Memories Memories store large amounts of digital data Each bit represented by a single.
Topic: Sequential Circuit Course: Logic Design Slide no. 1 Chapter #6: Sequential Logic Design.
Chapter 3 Digital Logic Structures. 3-2 Combinational vs. Sequential Combinational Circuit always gives the same output for a given set of inputs  ex:
Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.
Feb. 26, 2001Systems Architecture I1 Systems Architecture I (CS ) Lecture 12: State Elements, Registers, and Memory * Jeremy R. Johnson Mon. Feb.
Sequential logic circuits
EKT 124 / 3 DIGITAL ELEKTRONIC 1
EE121 John Wakerly Lecture #9
Learning to Design Counters
Digital Circuits Introduction Memory information storage a collection of cells store binary information RAM – Random-Access Memory read operation.
Flip Flops, Registers Today: First Hour: Types of Latches, Flip Flips
Chap 5. Registers and Counters
1 Homework Reading –Tokheim Chapter 9.1 – 9.6 Machine Projects –Continue on mp3 Labs –Continue in labs with your assigned section.
Sequential Logic Design
Homework Reading Machine Projects Labs Tokheim Chapter 9.1 – 9.6
Chapter #6: Sequential Logic Design
Registers and Counters
Registers and Counters Register : A Group of Flip-Flops. N-Bit Register has N flip-flops. Each flip-flop stores 1-Bit Information. So N-Bit Register Stores.
Registers and Counters
CSE 370 – Winter Sequential Logic-2 - 1
Overview Last lecture Digital hardware systems Today
Presentation transcript:

10-1 Introduction Chapter #7: Sequential Logic Case Studies

10-2 Introduction Motivation Flipflops: most primitive "packaged" sequential circuits More complex sequential building blocks: Storage registers, Shift registers, Counters Available as components in the TTL Catalog How to represent and design simple sequential circuits: counters Problems and pitfalls when working with counters: Start-up States Asynchronous vs. Synchronous logic

10-3 Introduction Chapter Overview Examine Real Sequential Logic Circuits Available as Components Registers for storage and shifting Random Access Memories Counters Counter Design Procedure Simple but useful finite state machine State Diagram, State Transition Table, Next State Functions Excitation Tables for implementation with alternative flipflop types Synchronous vs. Asynchronous Counters Ripple vs. Synchronous Counters Asynchronous vs. Synchronous Clears and Loads

10-4 Introduction Kinds of Registers and Counters Storage Register Group of storage elements read/written as a unit 4-bit register constructed from 4 D FFs Shared clock and clear lines TTL Quad D-type FF with Clear (Small numbers represent pin #s on package) Schematic Shape + Clr D3 D2 D1 D0 Clk Q3 S R Q2 Q1 Q0

10-5 Introduction Kinds of Registers and Counters Input/Output Variations Selective Load Capability Tri-state or Open Collector Outputs True and Complementary Outputs Octal D-type FFs with input enable Octal D-type FFs with output enable EN enabled low and lo-to-hi clock transition to load new data into register OE asserted low presents FF state to output pins; otherwise high impedence

10-6 Introduction Kinds of Registers and Counters Register Files Two dimensional array of flipflops Address used as index to a particular word Word contents read or written x4 Register File with Tri-state Outputs Separate Read and Write Enables Separate Read and Write Address Data Input, Q Outputs Contains 16 D-ffs, organized as four rows (words) of four elements (bits)

10-7 Introduction Kinds of Registers and Counters Shift Registers Storage + ability to circulate data among storage elements Shift from left storage element to right neighbor on every lo-to-hi transition on shift signal Wrap around from rightmost element to leftmost element Master Slave FFs: sample inputs while clock is high; change outputs on falling edge Shift Direction \Reset Shift CLK + +

10-8 Introduction Kinds of Registers and Counters Shift Register I/O Serial vs. Parallel Inputs Serial vs. Parallel Outputs Shift Direction: Left vs. Right bit Universal Shift Register Serial Inputs: LSI, RSI Parallel Inputs: D, C, B, A Parallel Outputs: QD, QC, QB, QA Clear Signal Positive Edge Triggered Devices S1,S0 determine the shift function S1 = 1, S0 = 1: Load on rising clk edge synchronous load S1 = 1, S0 = 0: shift left on rising clk edge LSI replaces element D S1 = 0, S0 = 1: shift right on rising clk edge RSI replaces element A S1 = 0, S0 = 0: hold state Multiplexing logic on input to each FF! Shifters well suited for serial-to-parallel conversions, such as terminal to computer communications S1 S0 LSI D C B A RSI CLK CLR QD QC QA QB

10-9 Introduction Kinds of Registers and Counters Shift Register Application: Parallel to Serial Conversion Parallel Inputs Serial transmission Parallel Outputs

10-10 Introduction Kinds of Registers and Counters Counters Proceed through a well-defined sequence of states in response to count signal 3 Bit Up-counter: 000, 001, 010, 011, 100, 101, 110, 111, 000,... 3 Bit Down-counter: 111, 110, 101, 100, 011, 010, 001, 000, 111,... Gray Code Counter : 000, 001, 011, 010, 110, 100, 101, 111,... Binary vs. BCD vs. Gray Code Counters A counter is a "degenerate" finite state machine/sequential circuit where the state is the only output A counter is a "degenerate" finite state machine/sequential circuit where the state is the only output

10-11 Introduction Kinds of Registers and Counters Ring Counter 1000, 0100, 0010, 0001, 1000,...

10-12 Introduction Kinds of Registers and Counters Johnson (Mobius) Counter End-Around 8 possible states, single bit change per state, useful for avoiding glitches

10-13 Introduction Kinds of Registers and Counters Catalog Counter Synchronous 4-Bit Upcounter Synchronous Load and Clear Inputs Positive Edge Triggered FFs Parallel Load Data from D, C, B, A P, T Enable Inputs: both must be asserted to enable counting RCO: asserted when counter enters its highest state 1111, used for cascading counters "Ripple Carry Output" 74161: similar in function, asynchronous load and reset

10-14 Introduction Kinds of Registers and Counters Detailed Timing Diagram

10-15 Introduction Counter Design Procedure Introduction This procedure can be generalized to implement ANY finite state machine Counters are a very simple way to start: no decisions on what state to advance to next current state is the output Example:3-bit Binary Upcounter Decide to implement with Toggle Flipflops What inputs must be presented to the T FFs to get them to change to the desired state bit? This is called "Remapping the Next State Function" State Transition Table Flipflop Input Table Present State Next State Flipflop Inputs State Transition Digram 000

10-16 Introduction Counter Design Procedure Introduction This procedure can be generalized to implement ANY finite state machine Counters are a very simple way to start: no decisions on what state to advance to next current state is the output Example:3-bit Binary Upcounter Decide to implement with Toggle Flipflops What inputs must be presented to the T FFs to get them to change to the desired state bit? This is called "Remapping the Next State Function" State Transition Table Flipflop Input Table Present State Next State Flipflop Inputs State Transition Digram 000

10-17 Introduction Counter Design Procedure Example Continued K-maps for Toggle Inputs: Resulting Logic Circuit: CB A 0 1 TA = CB A 0 1 TB = CB A 0 1 TC =

10-18 Introduction Counter Design Procedure Example Continued K-maps for Toggle Inputs: Resulting Logic Circuit: Timing Diagram:

10-19 Introduction Counter Design Procedure More Complex Count Sequence Step 1: Derive the State Transition Diagram Count sequence: 000, 010, 011, 101, 110 Step 2: State Transition Table Present State Next State

10-20 Introduction Counter Design Procedure More Complex Count Sequence Step 1: Derive the State Transition Diagram Count sequence: 000, 010, 011, 101, 110 Step 2: State Transition Table Note the Don't Care conditions Present State Next State

10-21 Introduction Counter Design Procedure More Complex Count Sequence Step 3: K-Maps for Next State Functions CB A 0 1 C+ = CB A 0 1 A+ = CB A 0 1 B+ =

10-22 Introduction Counter Design Procedure More Complex Count Sequence Step 3: K-Maps for Next State Functions CB A X1X X00 C B C+ CB A X0X X01 C B B+ CB A X1X X01 C B A+

10-23 Introduction Counter Design Procedure More Complex Counter Sequencing Step 4: Choose Flipflop Type for Implementation Use Excitation Table to Remap Next State Functions Toggle Excitation Table Remapped Next State Functions Present State Toggle Inputs

10-24 Introduction Counter Design Procedure More Complex Counter Sequencing Step 4: Choose Flipflop Type for Implementation Use Excitation Table to Remap Next State Functions Toggle Excitation Table Remapped Next State Functions Present State Toggle Inputs

10-25 Introduction Counter Design Procedure More Complex CounterSequencing Remapped K-Maps TC = TB = TA = CB A 0 1 TC CB A 0 1 TA CB A 0 1 TB

10-26 Introduction Counter Design Procedure More Complex CounterSequencing Remapped K-Maps TC = A C + A C = A xor C TB = A + B + C TA = A B C + B C B C A X1 X1X0 CB B TC A X1 X1X1 CB C B TB X0 X0X1 CB C 1 A

10-27 Introduction Counter Design Procedure More Complex Counter Sequencing Resulting Logic: Timing Waveform: 5 Gates 13 Input Literals + Flipflop connections TC T CLK Q Q S R Count T CLK Q Q S R TB C \C\C BA \B\B \A\A TA T CLK Q Q S R \Reset 1 0 TA A C A /B/B C TC /A/A B /C/C TB/B/B C

10-28 Introduction Self-Starting Counters Start-Up States At power-up, counter may be in possible state Designer must guarantee that it (eventually) enters a valid state Especially a problem for counters that validly use a subset of states Self-Starting Solution: Design counter so that even the invalid states eventually transition to valid state Two Self-Starting State Transition Diagrams for the Example Counter Implementation in Previous Slide!

10-29 Introduction Self-Starting Counters Deriving State Transition Table from Don't Care Assignment

10-30 Introduction Self-SrartingCounters Counter Reset Usual to have a distinguished starting state for the counter or finite state machine Desirable to include additional hardware to reset the counter to this state Use reset signal to placeflipflopsin the desired starting state

10-31 Introduction

10-32 Introduction Implementation with Different Kinds of FFs R-S Flipflops Continuing with the 000, 010, 011, 101, 110, 000,... counter example RS Exitation Table Q+ = S + R Q Remapped Next State Functions Present State Next State Remapped Next State

10-33 Introduction Implementation with Different Kinds of FFs RS FFs Continued RC = SC = RB = SB = RA = SA = CB A 0 1 RC CB A 0 1 RA CB A 0 1 RB CB A 0 1 SC CB A 0 1 SA CB A 0 1 SB

10-34 Introduction Implementation with Different Kinds of FFs RS FFs Continued RC = A SC = A RB = A B + B C SB = B RA = C SA = B C

10-35 Introduction Implementation With Different Kinds of FFs RS FFs Continued Resulting Logic Level Implementation: 3 Gates, 11 Input Literals + Flipflop connections

10-36 Introduction Implementation with Different FF Types J-K FFs J-K Excitation Table Q+ = J Q + K Q Remapped Next State Functions Present State Next State Remapped Next State

10-37 Introduction Implementation with Different FF Types J-K FFs Continued JC = KC = JB = KB = JA = KA = CB A 0 1 JC CB A 0 1 JA CB A 0 1 JB CB A 0 1 KC CB A 0 1 KA CB A 0 1 KB

10-38 Introduction Implementation with Different FF Types J-K FFs Continued JC = A KC = A JB = 1 KB = A + C JA = B C KA = C

10-39 Introduction Implementation with Different FF Types J-K FFs Continued Resulting Logic Level Implementation: 2 Gates, 10 Input Literals + Flipflop Connections

10-40 Introduction Implementation with Different FF Types D FFs Simplest Design Procedure: No remapping needed! DC = A DB = A C + B DA = B C Resulting Logic Level Implementation: 3 Gates, 8 Input Literals + Flipflop connections

10-41 Introduction Implementation with Different FF Types Comparison T FFs well suited for straightforward binary counters But yielded worst gate and literal count for this example! No reason to choose R-S over J-K FFs: it is a proper subset of J-K R-S FFs don't really exist anyway J-K FFs yielded lowest gate count Tend to yield best choice for packaged logic where gate count is key D FFs yield simplest design procedure Best literal count D storage devices very transistor efficient in VLSI Best choice where area/literal count is the key

10-42 Introduction Asynchronous vs. Synchronous Counters Ripple Counters Deceptively attractive alternative to synchronous design style Count signal ripples from left to right State transitions are not sharp! Can lead to "spiked outputs" from combinational logic decoding the counter's state Can lead to "spiked outputs" from combinational logic decoding the counter's state

10-43 Introduction Asynchronous vs. Synchronous Counters Cascaded Synchronous Counters with Ripple Carry Outputs First stage RCO enables second stage for counting RCO asserted soon after stage enters state 1111 also a function of the T Enable Downstream stages lag in their 1111 to 0000 transitions Affects Count period and decoding logic

10-44 Introduction Asynchronous vs. Synchronous Counters The Power of Synchronous Clear and Load Starting Offset Counters: e.g., 0110, 0111, 1000, 1001, 1010, 1011, 1100, 1101, 1111, 0110,... Use RCO signal to trigger Load of a new state Since Load is synchronous, state changes only on the next rising clock edge 0110 is the state to be loaded L O A D C L R C L K R C O PT Q A Q B Q C Q D Load D C B A 01 ++

10-45 Introduction Asynchronous vs. Synchronous Counters Offset Counters Continued Ending Offset Counter: e.g., 0000, 0001, 0010,..., 1100, 1101, 0000 Decode state to determine when to reset to 0000 Clear signal takes effect on the rising count edge Replace '163 with '161, Counter with Async Clear Clear takes effect immediately! C L R L O A D C L K PT R C O Q Q D C B A CLR DC BA 1 0 D C B A +

10-46 Introduction Random Access Memories Static RAM Transistor efficient methods for implementing storage elements Small RAM: 256 words by 4-bit Large RAM: 4 million words by 1-bit We will discuss a 1024 x 4 organization Static RAM Cell Words = Rows Columns = Bits (Double Rail Encoded) use MOS small # easy to implement

10-47 Introduction Random Access Memories Static RAM Organization Chip Select Line (active lo) Write Enable Line (active lo) 10 Address Lines 4 Bidirectional Data Lines

10-48 Introduction Random Access Memories RAM Organization Long thin layouts are not the best organization for a RAM 64 x 64 Square Array Amplifers & Mux/Demux Some Addr bits select row Some Addr bits select within row

10-49 Introduction Random Access Memories RAM Timing Simplified Read Timing Simplified Write Timing

10-50 Introduction Random Access Memories Dynamic RAMs 1 Transistor (+ capacitor) memory element Read: Assert Word Line, Sense Bit Line Write: Drive Bit Line, Assert Word Line Destructive Read-Out Need for Refresh Cycles: storage decay in ms Internal circuits read word and write back

10-51 Introduction Random Access Memories DRAM Organization Long rows to simplify refresh Two new signals: RAS, CAS Row Address Strobe Column Address Strobe replace Chip Select

10-52 Introduction Random Access Memory RAS, CAS Addressing Even to read 1 bit, an entire 64-bit row is read! Separate addressing into two cycles: Row Address, Column Address Saves on package pins, speeds RAM access for sequential bits! Read Cycle Read Row Row Address Latched Read Bit Within Row Column Address Latched Tri-state Outputs

10-53 Introduction Random Access Memory Write Cycle Timing (1) Latch Row Address Read Row (2) WE low (3) CAS low: replace data bit (4) RAS high: write back the modified row (5) CAS high to complete the memory cycle

10-54 Introduction Random Access Memory RAM Refresh Refresh Frequency: 4096 word RAM -- refresh each word once every 4 ms Assume 120ns memory access cycle This is one refresh cycle every 976 ns (1 in 8 DRAM accesses)! But RAM is really organized into 64 rows This is one refresh cycle every 62.5  s (1 in 500 DRAM accesses) Large capacity DRAMs have 256 rows, refresh once every 8  s 512 rows, refresh once every 16  s RAS-only Refresh (RAS cycling, no CAS cycling) External controller remembers last refreshed row Some memory chips maintain refresh row pointer CAS before RAS refresh: if CAS goes low before RAS, then refresh 4ms    ns x 64  x  s 500  s

10-55 Introduction Random Access Memory DRAM Variations Page Mode DRAM: read/write bit within last accessed row without RAS cycle RAS, CAS, CAS,..., CAS, RAS, CAS,... New column address for each CAS cycle Static Column DRAM: like page mode, except address bit changes signal new cycles rather than CAS cycling on writes, deselect chip or CAS while address lines are changing Nibble Mode DRAM: like page mode, except that CAS cycling implies next column address in sequence -- no need to specify column address after first CAS Works for 4 bits at a time (hence "nibble") RAS, CAS, CAS, CAS, CAS, RAS, CAS, CAS, CAS, CAS,...

10-56 Introduction

10-57 Introduction Chapter Summary # The Variety of Sequential Circuit Packages Registers, Shifters, Counters, RAMs # Counters as Simple Finite State Machines # Counter Design Procedure 1. Derive State Diagram 2. Derive State Transition Table 3. Determine Next State Functions 4. Remap Next State Functions for Target FF Types Using Excitation Tables; Implement Logic # Different FF Types in Counters J-K best for reducing gate count in packaged logic D is easiest design plus best for reducing wiring and area in VLSI # Asynchronous vs. Synchronous Counters Avoid Ripple Counters! State transitions are not sharp Beware of potential problems when cascading synchronous counters Offset counters: easy to design with synchronous load and clear Never use counters with asynchronous clear for this kind of application