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

Similar documents
Chapter 6. Synchronous Sequential Circuits

Models for representing sequential circuits

Example: vending machine

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

EECS150 - Digital Design Lecture 23 - FSMs & Counters

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

Design of Datapath Controllers

EEE2135 Digital Logic Design

University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering

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

ECE/Comp Sci 352 Digital Systems Fundamentals. Charles R. Kime Section 2 Fall Logic and Computer Design Fundamentals

Total time is: 1 setup, 2 AND, 3 XOR, 1 delay = (1*1) + (2*2) + (3*3) + (1*1) = 15ns

CSC 322: Computer Organization Lab

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

Review: Designing with FSM. EECS Components and Design Techniques for Digital Systems. Lec09 Counters Outline.

EECS150 - Digital Design Lecture 11 - Shifters & Counters. Register Summary

Sequential logic and design

FSM model for sequential circuits

Lecture 10: Synchronous Sequential Circuits Design

Synchronous Sequential Circuit Design. Digital Computer Design

Register Transfer Level

Finite State Machine (FSM)

EECS150 - Digital Design Lecture 18 - Counters

EECS150 - Digital Design Lecture 18 - Counters

CprE 281: Digital Logic

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Sciences

FYSE420 DIGITAL ELECTRONICS

Review: Designing with FSM. EECS Components and Design Techniques for Digital Systems. Lec 09 Counters Outline.

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

EECS150 - Digital Design Lecture 17 - Sequential Circuits 3 (Counters)

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

ECE 448 Lecture 6. Finite State Machines. State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL Code. George Mason University

Logic and Computer Design Fundamentals. Chapter 8 Sequencing and Control

CSE140L: Components and Design Techniques for Digital Systems Lab. FSMs. Instructor: Mohsen Imani. Slides from Tajana Simunic Rosing

ECE380 Digital Logic. Synchronous sequential circuits

Generalized FSM model: Moore and Mealy

EGR224 F 18 Assignment #4

Sequential Circuit Design

Digital Design. Sequential Logic

Module 10: Sequential Circuit Design

Clocked Sequential Circuits UNIT 13 ANALYSIS OF CLOCKED SEQUENTIAL CIRCUITS. Analysis of Clocked Sequential Circuits. Signal Tracing and Timing Charts

Finite State Machine. By : Ali Mustafa

EECS 270 Midterm 2 Exam Answer Key Winter 2017

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

EECS150 - Digital Design Lecture 16 Counters. Announcements

Review Problem 1. should be on. door state, false if light should be on when a door is open. v Describe when the dome/interior light of the car

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

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

ELEC Digital Logic Circuits Fall 2014 Sequential Circuits (Chapter 6) Finite State Machines (Ch. 7-10)


Chapter 5 Synchronous Sequential Logic

Clocked Synchronous State-machine Analysis

Chapter 7. Synchronous Sequential Networks. Excitation for

Chapter 7. VLSI System Components

Counters. We ll look at different kinds of counters and discuss how to build them

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

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

ECE 341. Lecture # 3

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

FSM Optimization. Counter Logic Diagram Q1 Q2 Q3. Counter Implementation using RS FF 10/13/2015

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

Logical design of digital systems

FSM Examples. Young Won Lim 11/6/15

Synchronous Sequential Circuit Design

Laboratory Exercise #11 A Simple Digital Combination Lock

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

EE 209 Logic Cumulative Exam Name:

14.1. Unit 14. State Machine Design

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

Hanbat National University Prof. Lee Jaeheung

Analysis of clocked sequential networks

Adders allow computers to add numbers 2-bit ripple-carry adder

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

Sequential Logic Circuits

Philadelphia University Student Name: Student Number:

EECS150 - Digital Design Lecture 15 SIFT2 + FSM. Recap and Outline

Lecture 7: Logic design. Combinational logic circuits

Principles of Computer Architecture. Appendix B: Reduction of Digital Logic. Chapter Contents

Digital Logic Design - Chapter 5

14:332:231 DIGITAL LOGIC DESIGN

CITS2016, July6-8,Kunming,China

Reg. No. Question Paper Code : B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER Second Semester. Computer Science and Engineering

EECS150 - Digital Design Lecture 25 Shifters and Counters. Recap

課程名稱 : 數位邏輯設計 P-1/ /6/11

Digital Control of Electric Drives

State & Finite State Machines

CpE358/CS381. Switching Theory and Logical Design. Class 16

Different encodings generate different circuits

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

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

Chapter 4. Sequential Logic Circuits

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

CSE140: Design of Sequential Logic

Design at the Register Transfer Level

CSE 140 Midterm 3 version A Tajana Simunic Rosing Spring 2015

Ch 9. Sequential Logic Technologies. IX - Sequential Logic Technology Contemporary Logic Design 1

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

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

Synchronous Sequential Logic

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

Transcription:

W Combinational circuit Flip-flops Combinational circuit Z cycle: t t t 2 t 3 t 4 t 5 t 6 t 7 t 8 t 9 t : : Figure 8.. The general form of a sequential circuit. Figure 8.2. Sequences of input and output signals. = = A = = B = ext state Output state = = = = C = A A B B A C C A C = Figure 8.3. State diagram of a simple sequential circuit. Figure 8.4. State table. Combinational circuit Y Y 2 y Combinational circuit ext state state = = Output y Y Y 2 Y Y 2 A B C dd dd d Figure 8.5. A general sequential circuit. Figure 8.6. A state-assigned table.

y Ignoring don't cares Using don't cares d d Y = y y 2 Y = y y 2 Y 2 y d d Y = y y + y 2 2 Y = y + 2 = ( y + y ) 2 Y y y d = y y 2 = n Figure 8.7. erivation of logic expressions. Figure 8.8. Sequential circuit derived in Figure 8.7. t t t 2 t 3 t 4 t 5 t 6 t 7 t 8 t 9 t y Control circuit R out R in R 2 out R 2 in R 3 out R 3 in one Figure 8.9. Timing diagram. Figure 8.. Signals needed in Example 8.. = A o transfer = = = B R 2 out =, R 3 in = = = C R out =, R 2 in = ext state Outputs state = = A A B B C C C A A = = R 3 out =, R in =, one = Figure 8.. State diagram. Figure 8.2. State table.

state extstate Outputs y Y = y + y A B C y Y 2 = y + y Figure 8.3. State-assigned table. Figure 8.4. erivation of next-state expressions. Y y R in R 3 out y one R out ext state state = = Output y Y 2 Y Y 2 Y Y 2 R 2 in A B C dd dd d R 2 out R 3 in Figure 8.5. Sequential circuit derived in Figure 8.4. Figure 8.6. Improved state assignment for the sequential circuit in Figure 8.4. Y 2 state extstate Outputs Y y A B C n Figure 8.7. Final circuit for the improved state assignment. Figure 8.8. Improved state assignment for the sequential circuit in Figure 8.2.

y y Y = + y Y 2 = y extstate state = = Output y 3 y Y 3 Y 2 Y Y 3 Y 2 Y A B C Figure 8.9. erivation of next-state expressions. Figure 8.2. One-hot state assignment for the sequential circuit in Figure 8.4. state extstate Outputs cycle: t t t 2 t 3 t 4 t 5 t 6 t 7 t 8 t 9 t : : Figure 8.2. One-hot state assignment for the sequential circuit in Figure 8.2. Figure 8.22. Sequences of input and output signals. = = ext state Output state = = = = = = A B = = A A B B A B = = Figure 8.23. State diagram. Figure 8.24. State table.

y ext state Output state = = = = n y Y Y (a) Circuit A B y t t t 2 t 3 t 4 t 5 t 6 t 7 t 8 t 9 t (b) Timing diagram Figure 8.25. State-assigned table. Figure 8.26. Implementation of FSM in Figure 8.25. Z y = n (a) Circuit A = R2 out =, R3 in = y Z t t t 2 t 3 t 4 t 5 t 6 t 7 t 8 t 9 t B = = C = = R out =, R2 in = R3 out =, R in =, one = (b) Timing diagram Figure 8.27. Circuit that implements the specification in Figure 8.2. Figure 8.28. State diagram for Example 8.4. module simple (, n,, ); input, n, ; output ; reg [2:] y, Y; parameter [2:] A = 2'b, B = 2'b, C = 2'b; n Gnd // efine the next state combinational circuit alays @( or y) case (y) A: if () Y = B; else Y = A; B: if () Y = C; else Y = A; C: if () Y = C; else Y = A; default: Y = 2'bxx; endcase 7 3 4 44 EPM732 39 36 // efine the sequential block alays @(negedge n or posedge ) if (n == )y <= A; elsey <= Y; // efine output assign = (y == C); endmodule 6 9 22 25 28 V Figure 8.29. Verilog code for the FSM in Figure 8.3. Figure 8.3. An FSM circuit in a small CPL.

module simple (, n,, ); input, n, ; output ; reg ; reg [2:] y, Y; parameter [2:] A = 2'b, B = 2'b, C = 2'b; // efine the next state combinational circuit alays @( or y) begin case (y) A: if () Y = B; else Y = A; B: if () Y = C; else Y = A; C: if () Y = C; else Y = A; default: Y = 2'bxx; endcase = (y == C); //efine output end // efine the sequential block alays @(negedge n or posedge ) if (n == ) y <= A; else y <= Y; Figure 8.32. Simulation results. endmodule Figure 8.33. Second version of code for the FSM in Figure 8.3. module simple (, n,, ); input, n, ; output ; reg [2:] y; parameter [2:] A = 2'b, B = 2'b, C = 2'b; // efine the sequential block alays @(negedge n or posedge ) if (n == ) y <= A; else case (y) A: if () y <= B; else y <= A; B: if () y <= C; else y <= A; C: if () y <= C; else y <= A; default: y <= 2'bxx; endcase // efine output assign = (y == C); endmodule Figure 8.34. Third version of code for the FSM in Figure 8.3. Figure 8.37. Simulation results for the Mealy machine. A Shift register Shift register B a b Adder FSM s Shift register Sum = A + B Figure 8.38. Potential problem ith asynchronous inputs to a Mealy FSM. Figure 8.39. Block diagram of a serial adder.

G ( ab s ) H ext state Output s state ab = G G G G H H G H H H G: H: carry-in = carry-in = Figure 8.4. State diagram for the serial adder. Figure 8.4. State table for the serial adder. ext state Output state ab = y Y s a b Full adder Y carry-out y s Figure 8.42. State-assigned table for the serial adder. Figure 8.43. Circuit for the adder FSM. G s = H s = extstate Output state ab = s G G G G H G G G G H H G H H H H G H H H G s = H s = Figure 8.44. State diagram for the Moore-type serial adder FSM. Figure 8.45. State table for the Moore-type serial adder FSM.

extstate state ab = Output y s Y 2 Y a b Full adder Sum bit Carry-out Y y s Y 2 Figure 8.46. State-assigned table for the Moore-type serial adder FSM. Figure 8.47. Circuit for the Moore-type serial adder FSM. module shiftrne (R, L, E,,, ); parameter n = 8; input [n-:] R; input L, E,, ; output [n-:] ; reg [n-:] ; integer k; a 7 a L E L E 3 2 Counter 3 2 alays @(posedge ) if (L) <= R; else if (E) begin for (k = n-; k > ; k = k-) [k-] <= [k]; [n-] <= ; end b 7 b L E Adder FSM Run L E endmodule Sum 7 Sum Figure 8.48. Code for a left-to-right shift register ith an enable input. Figure 8.5a. Synthesied serial adder. ext state Output state = = A B C B F C F E B G E F C F E G F G Figure 8.5b. Simulation results for the synthesied serial adder. Figure 8.5. State table for Example 8.6.

sense sense extstate Output state = = A B C B A F C F C F C A (a) Timing diagram sense (b) Circuit that generates Figure 8.52. Minimied state table for Example 8.6. Figure 8.53. Signals for the vending machine. S4 S2 S5 S S3 S6 S7 ext state Output state = S S S3 S2 S2 S2 S4 S5 S3 S3 S6 S7 S4 S S5 S3 S6 S6 S8 S9 S7 S S8 S S9 S3 S8 S9 Figure 8.54. State diagram for Example 8.7. Figure 8.55. State table for Example 8.7. ext state Output state = S S S3 S2 S2 S2 S4 S5 S3 S3 S2 S4 S4 S S5 S3 S S3 S2 S5 S4 Figure 8.56. Minimied state table for Example 8.7. Figure 8.57. Minimied state diagram for Example 8.7.

S ext state Output state = = = = S3 A B C B C F E B G E F C F E G F S2 Figure 8.58. Mealy-type FSM for Example 8.7. Figure 8.59. Incompletely specified state table for Example 8.8. = = = = = = = = A/ B/ C/2 /3 H/7 = = G/6 = = F/5 = = E/4 = = ext state state = = Output A A B B B C C C 2 E 3 E E F 4 F F G 5 G G H 6 H H A 7 Figure 8.6. State diagram for a counter. Figure 8.6. State table for the counter. ext state Count state = = y y 2 Y 2 Y Y Y 2 Y Y A B C E F G H y y y y y y Y = y + y Y = y + y y + y y Y 2 = + y + y + y y Figure 8.62. State-assigned table for the counter. Figure 8.63. arnaugh maps for flip-flops for the counter.

J y Flip-flop inputs Count state = = y y 2 Y 2 Y Y J 2 2 J J Y 2 Y Y J 2 2 J J d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d J J y n Figure 8.65. Excitation table for the counter ith J flip-flops. Figure 8.67. Circuit diagram using J flip-flops. J y ext Output state state 2 J J y A B B C C E E F F G G H H A n Figure 8.68. Factored-form implementation of the counter. Figure 8.69. State table for the counterlike example. ext Output state state 2 y y Y 2 Y Y 2 Figure 8.7. State-assigned table. Figure 8.7. Circuit for the counterlike example.

r r 2 r 3 Idle Idle xx xx r r gnt g = gnt g = xx xx x r 2 r r r 2 gnt2 g 2 = gnt2 g 2 = xx xx r 3 r 2 r r 2 r 3 gnt3 g 3 = gnt3 g 3 = xx r 3 Figure 8.72. State diagram for the arbiter. Figure 8.73. Alternative style of state diagram for the arbiter. Figure 8.75. Simulation results for the arbiter circuit. Figure 8.76. Output delays in the arbiter circuit. Y y Y 2 n Figure 8.77. Output delay hen using one-hot encoding. Figure 8.78. Circuit for Example 8.9.

ext State Output state = = y Y 2 Y Y 2 Y ext state Output state = = J J y (a) State-assigned table A A B B A C C A A (b) State table J 2 2 J n Figure 8.79. Tables for the circuit in Example 8.9. Figure 8.8. Circuit for Example 8.. Flip-flop inputs state = = Output y J 2 2 J J 2 2 J y T 2 T n Figure 8.8. Excitation table for the circuit in Figure 8.8. Figure 8.82. Circuit for Example 8.. State name Flip-flop inputs state = = Output y T 2 T 2 Output signals or actions (Moore type) (a) State box (False) Condition (True) expression Conditional outputs or actions (Mealy type) (b) ecision box (c) Conditional output box Figure 8.83. Excitation table for the circuit in Figure 8.82. Figure 8.84. Elements used in ASM charts.

A Idle r gnt g r B r 2 gnt2 g 2 r 2 r 3 gnt3 g 3 r 3 Figure 8.86. ASM chart for the FSM in Figure 8.23. Figure 8.87. ASM chart for the arbiter. Inputs n Combinational circuit m Outputs ext state state = = Output y Y 2 Y Y 2 Y y k Y k -state variables ext-state variables y Y Figure 8.88. The general model for a sequential circuit. Figure P8.. State-assigned table for problems 8. and 8.2. Figure P8.2. Circuit for problem 8.29.