General Sequential Design

Slides:



Advertisements
Similar presentations
Chapter #8: Finite State Machine Design 8
Advertisements

Counters Discussion D8.3.
Finite State Machines (FSMs)
COUNTERS Counters with Inputs Kinds of Counters Asynchronous vs
Registers and Counters
TOPIC : Finite State Machine(FSM) and Flow Tables UNIT 1 : Modeling Module 1.4 : Modeling Sequential circuits.
Give qualifications of instructors: DAP
COE 202: Digital Logic Design Sequential Circuits Part 3
A. Abhari CPS2131 Sequential Circuits Most digital systems like digital watches, digital phones, digital computers, digital traffic light controllers and.
Digital Logic Chapter 5 Presented by Prof Tim Johnson
Sequential Logic Computer Organization Ellen Walker Hiram College Figures from Computer Organization and Design 3ed, D.A. Patterson & J.L. Hennessey, Morgan.
Circuits require memory to store intermediate data
Sequential Circuit Analysis & Design Dr. Aiman H. El-Maleh Computer Engineering Department King Fahd University of Petroleum & Minerals Dr. Aiman H. El-Maleh.
1 Lecture 23 More Sequential Circuits Analysis. 2 Analysis of Combinational Vs. Sequential Circuits °Combinational : Boolean Equations Truth Table Output.
CS 151 Digital Systems Design Lecture 37 Register Transfer Level
1 Sequential logic networks I. Motivation & Examples  Output depends on current input and past history of inputs.  “State” embodies all the information.
Sequential Logic Design
Contemporary Logic Design Sequential Case Studies © R.H. Katz Transparency No Chapter #7: Sequential Logic Case Studies 7.1, 7.2 Counters.
Sequential Logic Design
Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Chapter #8: Finite State Machine Design Finite State.
ECE 301 – Digital Electronics Introduction to Sequential Logic Circuits (aka. Finite State Machines) and FSM Analysis (Lecture #17)
ECE 331 – Digital Systems Design Introduction to Sequential Logic Circuits (aka. Finite State Machines) and FSM Analysis (Lecture #19)
Sequential circuit design
Lecture 21 Overview Counters Sequential logic design.
EE24C Digital Electronics Projects
SEQUENTIAL CIRCUITS Introduction
COE 202: Digital Logic Design Sequential Circuits Part 1
Chapter 10 State Machine Design. 2 State Machine Definitions State Machine: A synchronous sequential circuit consisting of a sequential logic section.
Introduction to Sequential Logic Design Finite State-Machine Design.
2017/4/24 CHAPTER 6 Counters Chapter 5 (Sections )
1 Lecture 22 Sequential Circuits Analysis. 2 Combinational vs. Sequential  Combinational Logic Circuit  Output is a function only of the present inputs.
 Counters are sequential circuits which "count" through a specific state sequence. They can count up, count down, or count through other fixed sequences.
1 © 2014 B. Wilkinson Modification date: Dec Sequential Logic Circuits Previously, we described the basic building blocks of sequential circuits,
Counters. In class excercise How to implement a “counter”, which will count as 0,3,1,4,5,7,0,3,1,…… Q2Q1Q0D2D1D
Review of Digital Logic Design Concepts OR: What I Need to Know from Digital Logic Design (EEL3705)
BR 1/991 Dice Game Implementation Why was dice game implemented in three 22V10 PLDs? What are the resources needed by the Dice Game? –Outputs: 6 for dice.
2017/4/24 1.
© BYU 13 COUNTERS Page 1 ECEn 224 COUNTERS Counters Transition Tables Moore Outputs Counter Timing.
DLD Lecture 26 Finite State Machine Design Procedure.
1 A counter counts Number of elements in counter determines how many different states we need For example, an eight-state counter can count eight steps.
Hamming Code,Decoders and D,T-flip flops Prof. Sin-Min Lee Department of Computer Science.
Digital System Design using VHDL
Counters Transition Tables Moore Outputs Counter Timing

Sahar Mosleh PageCalifornia State University San Marcos 1 More on Flip Flop State Table and State Diagram.
Chapter5: Synchronous Sequential Logic – Part 1
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
EMT 351/4 DIGITAL IC DESIGN Verilog Behavioral Modeling  Finite State Machine -Moore & Mealy Machine -State Encoding Techniques.
Lecture #17: Clocked Synchronous State-Machine Analysis
LATCHED, FLIP-FLOPS,AND TIMERS
Chapter #6: Sequential Logic Design
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
Learning Outcome By the end of this chapter, students are expected to refresh their knowledge on sequential logic related to HDL.
FIGURE 5.1 Block diagram of sequential circuit
Sequential Circuit: Counter
29th Oct Review Session 8.
Sequential Circuits Most digital systems like digital watches, digital phones, digital computers, digital traffic light controllers and so on require.
Assistant Prof. Fareena Saqib Florida Institute of Technology
FINITE STATE MACHINES (FSMs)
Sequential circuit design
29-Nov-18 Counters Chapter 5 (Sections ).
CSE 370 – Winter Sequential Logic-2 - 1
Sequential circuit design
CSE 370 – Winter Sequential Logic-2 - 1
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
SYEN 3330 Digital Systems Chapter 6 – Part 3 SYEN 3330 Digital Systems.
Counters.
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
EGR 2131 Unit 12 Synchronous Sequential Circuits
CSE 370 – Winter Sequential Logic-2 - 1
Presentation transcript:

General Sequential Design So far we have, we have looked at basic latches, FFs and common sequential building blocks. All of these can be represented by a general block diagram: m Inputs n Outputs Combinational Logic Circuit k-bit Present State Value k-bit Next State Value Memory Element k k BR 8/99

Counter drawn as general sequential system. C Combinational Logic LD S DIN 1 EN N Y EN Y DIN N Incrementer Next State D Present State N Q N Counter drawn as general sequential system. C R CLK DFF Memory BR 8/99

Describing Sequential Systems So far we have used Truth Tables to describe sequential systems Can also use Bubble Diagrams and Algorithmic State Machine Charts (ASM) to describe a sequential system. Another name for a sequential system is a Finite State Machine (FSM). A sequential system with N flip-Flop has 2N possible states, so the number of possible states is FINITE. BR 8/99

DFF as a Finite State Machine A DFF is a finite state machine with two possible states. Lets call these states S0 and S1. (state enumeration). Furthermore, lets say when the Q output = ‘0’, then we are in State S0, and that when Q output = ‘1’, we are in State S1. This is called the State Encoding. 1 S0 q=0 S1 q=1 1 Bubble Diagram: States represented by bubbles. State transitions represented by arrows. Labeling on arrows represent input values (in this case, the D-input!). Labeling inside bubbles represent output values. BR 8/99

Algorithmic State Machine Chart for DFF Q = 0 A Finite State Machine (FSM) can be described via either a Bubble diagram or an ASM chart. ASM charts are better for complex FSMs. We will use ASM charts in this class. State S0 is usually the asynchronous Reset state. D 1 S1 Q = 1 1 D BR 8/99

Algorithmic State Chart (ASM) An ASM chart can be used to describe FSM behavior Only three action signals can appear within an ASM chart: State box. Each box represents a state. Outputs within a state box is an UNCONDITIONAL output (always asserted in this state). Decision box. A condition in this box will decide next state condition. Conditional output box. If present, will always follow a decision box; output within it is conditional. BR 8/99

Algorithmic State Machine Chart for JKFF Q = 0 00 or 01 JK? 10 or 11 S1 Q = 1 00 or 10 JK? 01 or 11 BR 8/99

Finite State Machine Implementation Given an Algorithmic State Machine chart that describes a Finite State Machine, how do we implement it????? Step #1: Decide on the State Encoding (how many Flip Flips do I use and how what should the FF outputs be for EACH state). The problem definition may decide the state encoding for you. Step #2: Decide what kind of FFs to use! (We will always use DFFs in this class, but you could use JKFFs or TFFs if you wanted to). Step #3: Write the State Transition Table. Step #4: Write the FF input equations, and general output equations from the state transistion table. BR 8/99

Problem Definition Design a Modulo three counter. The count sequence is: “00”  “01”  “10”  “00”  “01”  “10”, etc. There is an “en” input that should control counting (count when en=1, hold value when en=0). Assume ACLR line used to reset counter to “00”. How many states do we need? Well, we have three unique output values, so lets go with three states. EN Y[1:0] CLK ACLR BR 8/99

ASM Chart for Modulo Three Counter Y = 00 EN? 1 S1 Y = 01 EN? 1 S2 Y = 10 EN? 1 BR 8/99

State Transition Table State transition table shows next state, output values for present state, input values. Inputs(EN) Present State Next State Y 0 S0 S0 00 0 S1 S1 01 0 S2 S2 10 1 S0 S1 00 1 S1 S2 01 1 S2 S0 10 BR 8/99

Decisions State encoding - will be based on number of FFs we use. Three states means the minimum number of FFs we can use two FFs (log2(3) = 2). If we use two FFs, then could pick a state encodings like: S0: 00, S1: 01, S2: 10 (binary counting order) S0: 01, S1:01, S2: 11 (gray code - may result in less combinational logic) Could also use 1 FF per state (3 FFs) and use one hot encoding S0:001, S1: 010, S2: 100 (may result in less combinational logic) BR 8/99

Decisions (cont.) What type of FF to use? DFF - most common type, always available in programmable logic JKFF - sometimes available, will usually result in less combinational logic (more complex FF means less combinational logic external to FF) Lets use two FFs with state encoding S0=00, S1=01, S2=10. Lets use DFFs. BR 8/99

New State Transition Table Modify State Transition table to show what FF inputs need to be in order to get to that state. Also, use actual state encodings Inputs(EN) Present Next D1D0 Y State State (Q1Q0) (Q1Q)* 0 00 00 00 00 0 01 01 01 01 0 10 10 10 10 1 00 01 01 00 1 01 10 10 01 1 10 00 00 10 For DFFs, D inputs are simply equal to next state!!!! BR 8/99

D-input Equations, Y equations Unoptimized equations: D0 = EN’ Q1’Q0 + EN Q1’Q0’ D1 = EN’ Q1 Q0’ + EN Q1’ Q0 Y0 = Q0 Y1 = Q1 The output Y is simply the DFF outputs! Here is one case where state encoding is affected by problem definition (does not make much sense to use a different state encoding, even though we could do it). BR 8/99

DFF Implementation EN D0 = EN’ Q1’Q0 + EN Q1’Q0’ Y0 D0 Q0 D Q C R Y1 D1 Q1 D Q C CLK ACLR R BR 8/99

What if we used JKFFs? Need to change State Transistion table to reflect JK input values. Inputs Present Next J1 K1 J0 K0 Y EN State State (Q1Q0) (Q1Q0)* 0 00 00 0 X 0 X 00 0 01 01 0 X X 0 01 0 10 10 X 0 0 X 10 1 00 01 0 X 1 X 00 1 01 10 1 X X 1 01 1 10 00 X 1 0 X 10 JK FF Q transitions: 00 (J=0, K=X); 01 (J=1, K=X); 11 (J=X, K=0); 10 (J=X, K=1); BR 8/99

JK Input Equations, Output Equations Unoptimized equations J0 = EN Q1’ Q0’ K0 = EN Q1’ Q0 J1 = EN Q1’ Q0 K1 = EN Q1 Q0’ Y0 = Q0 Y1 = Q1 Using JK FFs will mean simpler external optimized combinational logic because FFs are more complex (provide more functionality). BR 8/99

JK FF Implementation EN J0 = EN Q1’ Q0’ K0 = EN Q1’ Q0 Y0 Q J C K0 K Y1 Q1 J1 Q J CLK C K1 K ACLR input to JKFFs not shown. BR 8/99

3 DFFs and One Hot Encoding State encoding: S0 = 001, S1 = 010, S2 = 100 Inputs Present Next D2D1D0 Y EN State State (Q2Q1Q0) (Q2Q1Q0)* 0 001 001 001 00 0 010 010 010 01 0 100 100 100 10 1 001 010 010 00 1 010 100 100 01 1 100 001 001 10 BR 8/99

DFF input equations, Output Equations D0 = EN’Q0 + ENQ2 D1 = EN’Q1 + ENQ0 D2 = EN’Q2 + ENQ1 Y0 = EN’Q1 + EN Q1 = Q1 Y1 = EN’Q2 + EN Q2 = Q2 In equations, because a FF Q will only be ‘1’ in a single state, do not have to include all FFs to define state!! ( Q2’Q1’Q0 = Q0!!, Q2’Q1Q0’ = Q1!, Q2Q1’Q0’ = Q2!!) This is one of the advantages of one-hot encoding! BR 8/99

Generic Next State Equations Generic next state equations can be written directly from the ASM chart as an alternative to the Transition table S* = (conditions to remain in this state) + (conditions to enter state) From ASM chart of modulo three counter: S0* = EN’ S0 + EN S2 S1* = EN’ S1 + EN S0 S2* = EN’S2 + EN S1 If One hot encoding and DFFs are used, then Generic Next State equations ARE the specific next State Equations!! D0 = EN’Q0 + EN Q2 D1 = EN’Q1 + EN Q0 D2 = EN’ Q2 + EN Q1 BR 8/99