Sequential Circuit Design

Similar documents
The Design Procedure. Output Equation Determination - Derive output equations from the state table

Synchronous Sequential Circuit Design

Ch 7. Finite State Machines. VII - Finite State Machines Contemporary Logic Design 1

Sequential Synchronous Circuit Analysis

ELE2120 Digital Circuits and Systems. Tutorial Note 10

Synchronous Sequential Circuit Design. Dr. Ehab A. H. AL-Hialy Page 1

Module 10: Sequential Circuit Design

Chapter 7. Synchronous Sequential Networks. Excitation for

Different encodings generate different circuits

Week-5. Sequential Circuit Design. Acknowledgement: Most of the following slides are adapted from Prof. Kale's slides at UIUC, USA.

Chapter 5 Synchronous Sequential Logic

Finite State Machine (FSM)

Analysis and Design of Sequential Circuits: Examples

Example: vending machine

Computers also need devices capable of Storing data and information Performing mathematical operations on such data

3. Complete the following table of equivalent values. Use binary numbers with a sign bit and 7 bits for the value

SYNCHRONOUS SEQUENTIAL CIRCUITS

Chapter 4 Part 2 Sequential Circuits

Synchronous Sequential Logic

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 7 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

Synchronous Sequential Logic Part I. BME208 Logic Circuits Yalçın İŞLER

Synchronous Sequential Circuit Design. Digital Computer Design

Sequential Circuit Analysis

Digital Logic and Design (Course Code: EE222) Lecture 19: Sequential Circuits Contd..

Synchronous Sequential Logic Part I

Synchronous Sequential Logic. Chapter 5

Digital Design. Sequential Logic

ENGG 1203 Tutorial. Solution (b) Solution (a) Simplification using K-map. Combinational Logic (II) and Sequential Logic (I) 8 Feb Learning Objectives

Introduction EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 6: Sequential Logic 3 Registers & Counters 5/9/2010

or 0101 Machine

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING BENG (HONS) ELECTRICAL & ELECTRONICS ENGINEERING EXAMINATION SEMESTER /2017

Topic 8: Sequential Circuits

EGR224 F 18 Assignment #4

5 State Minimisation. university of applied sciences hamburg. Digital Systems. Prof. Dr. J. Reichardt Prof. Dr. B. Schwarz

Q: Examine the relationship between X and the Next state. How would you describe this circuit? A: An inverter which is synched with a clock signal.

ELE2120 Digital Circuits and Systems. Tutorial Note 9

Finite State Machine. By : Ali Mustafa

Generalized FSM model: Moore and Mealy

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

Last lecture Counter design Finite state machine started vending machine example. Today Continue on the vending machine example Moore/Mealy machines

CPE100: Digital Logic Design I

Chapter 7 Sequential Logic

Timing Constraints in Sequential Designs. 63 Sources: TSR, Katz, Boriello & Vahid

COE 202: Digital Logic Design Sequential Circuits Part 3. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Lecture (08) Synchronous Sequential Logic

ELCT201: DIGITAL LOGIC DESIGN

COE 202: Digital Logic Design Sequential Circuits Part 3. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

14.1. Unit 14. State Machine Design

EEE2135 Digital Logic Design

Chapter 4. Sequential Logic Circuits

Time Allowed 3:00 hrs. April, pages

FSM model for sequential circuits

Mealy & Moore Machines

Example: A vending machine

11.1 As mentioned in Experiment 10, sequential logic circuits are a type of logic circuit where the output of

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING COMPUTER SCIENCES DEPARTMENT UNIVERSITY OF WISCONSIN-MADISON

Analysis of Clocked Sequential Circuits

Sequential Logic Circuits

Parity Checker Example. EECS150 - Digital Design Lecture 9 - Finite State Machines 1. Formal Design Process. Formal Design Process

Overview of Chapter 4

Models for representing sequential circuits

Topic 8: Sequential Circuits. Bistable Devices. S-R Latches. Consider the following element. Readings : Patterson & Hennesy, Appendix B.4 - B.

ELCT201: DIGITAL LOGIC DESIGN

FYSE420 DIGITAL ELECTRONICS

Chapter 14 Sequential logic, Latches and Flip-Flops

EECS Components and Design Techniques for Digital Systems. FSMs 9/11/2007

Digital Electronics Sequential Logic

Lecture 10: Synchronous Sequential Circuits Design

Appendix B. Review of Digital Logic. Baback Izadi Division of Engineering Programs

15.1 Elimination of Redundant States

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

Digital Logic Design. Midterm #2

CprE 281: Digital Logic

Lecture 14 Finite state machines

ENGG 1203 Tutorial _03 Laboratory 3 Build a ball counter. Lab 3. Lab 3 Gate Timing. Lab 3 Steps in designing a State Machine. Timing diagram of a DFF

CSE 140: Components and Design Techniques for Digital Systems. Lecture 9: Sequential Networks: Implementation

BER KELEY D AV IS IR VINE LOS AN GELES RIVERS IDE SAN D IEGO S AN FRANCISCO

Sequential logic and design

Digital Logic Design. Midterm #2

Sequential Circuits Sequential circuits combinational circuits state gate delay

Chapter 6 Introduction to state machines

6. Finite State Machines

Asynchronous sequence circuits

EECS150 - Digital Design Lecture 23 - FSMs & Counters

Sequential Logic. Rab Nawaz Khan Jadoon DCS. Lecturer COMSATS Lahore Pakistan. Department of Computer Science

Memory Elements I. CS31 Pascal Van Hentenryck. CS031 Lecture 6 Page 1

Final Exam. ECE 25, Spring 2008 Thursday, June 12, Problem Points Score Total 90

Finite State Machine (1A) Young Won Lim 6/9/18

Fundamentals of Digital Design

Outcomes. Unit 14. Review of State Machines STATE MACHINES OVERVIEW. State Machine Design

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 9 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

Sequential Logic Optimization. Optimization in Context. Algorithmic Approach to State Minimization. Finite State Machine Optimization

COE 202: Digital Logic Design Sequential Circuits Part 4. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Lecture 8: Sequential Networks and Finite State Machines

Present Next state Output state w = 0 w = 1 z A A B 0 B A C 0 C A C 1

Chapter 5 Synchronous Sequential Logic

Chapter 2. Review of Digital Systems Design

L10 State Machine Design Topics

Appendix A: Digital Logic. Principles of Computer Architecture. Principles of Computer Architecture by M. Murdocca and V. Heuring

CSE140: Components and Design Techniques for Digital Systems. Midterm Information. Instructor: Mohsen Imani. Sources: TSR, Katz, Boriello & Vahid

Transcription:

Sequential Circuit esign

esign Procedure. Specification 2. Formulation Obtain a state diagram or state table 3. State Assignment Assign binary codes to the states 4. Flip-Flop Input Equation etermination Select flip-flop types and derive flip-flop equations from next state entries in the table 5. Output Equation etermination erive output equations from output entries in the table 6. Optimization Optimize the equations 7. Technology Mapping Find circuit from equations and map to flip-flops and gate technology 8. Verification Verify correctness of final design 2

Mealy Machine Typical Sequential Circuit x(t) present inputs C s(t+) next state State Register s(t) present state C2 z(t) clock 3

Typical Sequential Circuit x Q A Example Next State C Q A Q B CP C Q' y Output 4

Sequence etector sequence etector = Z = (time: 2 3 4 5 6 7 8 9 2 3 4 5) 5

esign of Sequence etector State iagram: 6

esign of Sequence etector State iagram (final): 7

esign of Sequence etector State Table: Present state S S S 2 AB Present Next State Output = = = = S S S 2 S S State Table with State Assignment: A B S A + B + Z = = = = 8

esign of Sequence etector erive Boolean Equations: A B A A B A B B A =.B B = A B A Z =.A B 9

esign of Sequence etector Compare with Typical Mealy Machine x(t) present inputs C s(t+) next state clock State Register s(t) present state C2 z(t)

esign of Sequence etector A Moore Sequence etector: x(t) present inputs C s(t+) next state State Register s(t) present state C2 z(t) clock

Sequence etector sequence etector = Z = (time: 2 3 4 5 6 7 8 9 2 3 4 5) 2

esign of a Sequence etector S : start S : got S 2 : got S 3 : got 3

esign of a Sequence etector S : start S : got S 2 : got S 3 : got 4

esign of a Sequence etector State Table Transition Table with State assignment Prese nt state Next State = = Present Output (Z) AB A B A + B + = = Z S S S 2 S 3 S S 2 S S 2 S S S 3 S 5

State iagram evelopment To develop a sequence recognizer state diagram:. Construct some sample input and output sequences to make sure that you understand the problem statement. 2. Begin in an initial state in which NONE of the initial portion of the sequence has occurred (typically reset state). 3. Add a state that recognizes that the first symbol has occurred. 4. Add states that recognize each successive symbol occurring. 5. Each time you add an arrow to the state graph, determine it can go to one of the previously defined states or whether a new state must be added 6. The final state represents the input sequence occurrence. 7. Add state transition arcs which specify what happens when a symbol not in the proper sequence has occurred. 8. Check your state graph for completeness and non-redundant arcs. 9. When your state graph is complete, test it by applying the input sequences formulated in part and make to be sure the output sequences are correct 6

State Assignment Each of the m states must be assigned a unique code Minimum number of bits required is n such that n log2 m where x is the smallest integer x There are 2 n - m unused states 7

Sequence etector Example: sequence efine states for the sequence to be recognized: assuming it starts with first symbol, continues through each symbol in the sequence to be recognized, and uses output to mean the full sequence has occurred, with output otherwise. Starting in the initial state (Arbitrarily named "A"): / A B Add a state that recognizes the first "." State "A" is the initial state, and state "B" is the state which represents the fact that the "first" one in the input subsequence has occurred. The output symbol "" means that the full recognized sequence has not yet occurred. 8

Sequence etector After one more, we have: C is the state obtained when the input sequence has two ""s. Finally, after and a, we have: A / B A / B / / C / C / Output on the arc from means the sequence has been recognized To what state should the arc from state go? Remember:? Note that is the last state but the output occurs for the input applied in. This is the case when a Mealy model is assumed. 9

etector A / B / / C / Clearly the final in the recognized sequence is a sub-sequence of. It follows a which is not a sub-sequence of. Thus it should represent the same state reached from the initial state after a first is observed. We obtain: A / B / / C / 2

etector A / B / C / / The states have the following abstract meanings: A: No proper sub-sequence of the sequence has occurred. B: The sub-sequence has occurred. C: The sub-sequence has occurred. : The sub-sequence has occurred. The / on the arc from to B means that the last has occurred and thus, the sequence is recognized. 2

etector The other arcs are added to each state for inputs not yet listed. Which arcs are missing? A / B / C / Answer: "" arc from A "" arc from B "" arc from C "" arc from. / 22

etector / / A / / B C / / / / Note that the arc from state C to state C implies that State C means two or more 's have occurred. 23

etector From the State iagram, we can fill in the State Table. There are 4 states, one input, and one output. We will choose the form with four rows, one for each current state. From State A, the and input transitions have been filled in along with the outputs. A / / Present State A B C / / B / C / / / Next State x= x= Output x= x= A B 24

etector: State Table / / A / B / C / Present Next State Output State x= x= x= x= A A B B A C C C A B / / / What would the state diagram and state table look like for the Moore model? 25

Sequence etector: Moore Model For the Moore Model, outputs are associated with states. We need to add a state "E" with output value for the final in the recognized input sequence. This new state E, though similar to B, would generate an output of and thus be different from B. The Moore model for a sequence recognizer usually has more states than the Mealy model. 26

Sequence etector: Moore Model We mark outputs on states for Moore model Arcs now show only state transitions Add a new state E to produce the output E produces the same behavior in the future as state B. But it gives a different output at the present time. A/ B/ C/ / E/ 27

Sequence etector: Moore Model The state table is shown below More state in the Moore model: Moore is More. Present State Next State x= x= A A B B A C C C A E E A C Output y A/ B/ C/ / E/ 28

State Assignment: Example Present State Next State x= x= Output x= x= A A B B A C C C A B How may assignments of codes with a minimum number of bits? 4 3 2 = 24 oes code assignment make a difference in cost? 29

State Assignment: Example 2 Present State Next State x= x= Output x= x= A A B B A B How may assignments of codes with a minimum number of bits? Two A =, B = or A =, B = oes it make a difference? Only in variable inversion, so small, if any. 3

State Assignment: Example 2 Assignment : A =, B =, C =, = The resulting coded state table: Present State Next State x = x = Output x = x = 3

State Assignment: Example 2 Assignment 2: A =, B =, C =, = The resulting coded state table: Present State Next State x = x = Output x = x = 32

A B Flip-Flop Input and Output Equations: Example 2 (version ) Assume flip-flops Interchange the bottom two rows of the state table, to obtain K-maps for A, B, and Z: A A B A A = A.B +.A.B B B B =.A.B +.A.B +.A.B 33

Flip-Flop Input and Output Equations: Example 2 (version ) A B A B Z = A.B. Gate Input Cost = 22 34

A B Flip-Flop Input and Output Equations: Example 2 (version 2) Assume flip-flops Interchange the bottom two rows of the state table, to obtain K-maps for A, B, and Z: A A B A B B A = A.B +.B B = 35

Flip-Flop Input and Output Equations: Example 2 (version 2) A B A B Z = A.B. Gate Input Cost = 9 Select this state assignment 36

Library: Flip-flops with Reset (not inverted) NAN gates with up to 4 inputs and inverters Implementation Initial Circuit: C R Y Y 2 Z Clock C R Reset 37

Technology Mapping Y C R Z Y 2 Clock Reset C R 38

Example : Vending Machine General Machine Concept: eliver package of gum after 5 cents deposited Single coin slot for dimes ( ), nickels (5 ) No change 39

Example : Vending Machine Step : Understand the problem: raw a picture Coin Sensor 5 Reset Vending Machine FSM Open Gum Release Mechanism Clk 4

Example : Vending Machine Step 2: raw state diagram: All possible sequences Inputs: N,, reset Reset S Output: open N S S2 ime: Nickel: 5 Notes: If neither N nor, goes to itself. Both N and is not possible. N S7 [open] N N S3 S4 S5 S6 [open] [open] [open] S8 [open] 4

Example : Vending Machine Step 3: State minimization: reuse states whenever possible Reset N ime: 5 Nickel: 5 N N, 5 [open] 42

Example : Vending Machine Step 4: Symbolic State table: Present State Inputs N Next State Output Open Reset N 5 N N, 5 [open] 5 5 5 5 5 5 5 5 From 5 state, you may want to go to reset state 43

Example : Vending Machine Step 5: State Encoding: Present State Q Q Inputs N Next State Output Open 44

Example : Vending Machine Step 6: Choose FF for implementation: FF easiest Q Q Q N Q Q N Q Q Q N Q N N N Q K-map for Q K-map for Q K-map for Open Q N N \Q Q Q CLK Q R \reset Q \Q OPEN = Q + + Q N = N Q + Q N + Q N + Q Q \N Q N Q Q CLK Q R \reset Q \Q OPEN = Q Q 8 Gates 45

Equivalence of Moore and Mealy Machines Moore Machine Reset N + Reset Reset/ (N + Reset)/ Mealy Machine Reset [] N Reset/ N/ N 5 [] N / 5 / N N/ [] N+ N / N+/ N / 5 5 [] Reset Reset/ Outputs are associated with State Outputs are associated with Transitions 46

Using Other FFs for esign Characteristic Table: defines the next state of the flip-flop in terms of flip-flop inputs and current state. Used in Circuit Analysis Excitation Table: defines the flip-flop input variable values as function of the current state and next state. Used in Circuit esign 47

Characteristic Table: SR FF Tables S R Q(t +) Operation Q(t) No change Reset Set? Undefined Excitation Table: Q(t) Q(t+ ) S R Operation No change / Reset Set Reset No change / Set 48

Characteristic Table: FF Tables Q(t ) + Operation Reset Set Excitation Table: Q(t) Q(t +) Operation x Reset Set 49

Characteristic Table: JK FF Tables J K Q(t+) Operation Q(t) Q(t) No change Reset Set Complement Excitation Table: Q(t) Q(t+) J K Operation No change / Reset Set / Toggle Reset / Toggle No Change / Set 5

Characteristic Table: T FF Tables T Q(t+) Q(t) Q(t) Operation No change Complement Excitation Table: Q(t) Q(t+) T Operation No change Toggle Toggle No Change 5

esign by FF Example 52

Example A(t + ) = A(A,B,) = m(2,4,5,6) B(t + ) = B(A,B,) = m(,3,5,6) Y(A,B,) = m(,5) A B A B A = AB + B B = A + B + AB A B Y = B 53

Example Logic iagram for Circuit with Flip-Flops 54

Example esign by JK FF Q(t) Q(t+) J K Operation No change/reset Set/Toggle Reset/Toggle No Change/set on t cares lead to simpler combinational circuit 55

Example: Boolean Equations JA = B JB = KA = B KB = A + A 56

Example: Logic iagram 57