Chapter 6. Synchronous Sequential Circuits

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

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

Example: vending machine

Models for representing sequential circuits

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

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

ECE380 Digital Logic. Synchronous sequential circuits

EECS150 - Digital Design Lecture 23 - FSMs & Counters

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

CprE 281: Digital Logic

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

CSC 322: Computer Organization Lab

FSM model for sequential circuits

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

EGR224 F 18 Assignment #4

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

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

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

FYSE420 DIGITAL ELECTRONICS

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

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

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

Analysis of clocked sequential networks

EECS150 - Digital Design Lecture 18 - Counters

EECS150 - Digital Design Lecture 18 - Counters

Finite State Machine. By : Ali Mustafa

Digital Design. Sequential Logic

Synchronous Sequential Circuit Design. Digital Computer Design

Register Transfer Level

Chapter 7. Synchronous Sequential Networks. Excitation for

Sequential logic and design

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

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

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

Generalized FSM model: Moore and Mealy

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

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

IE1204 Digital Design. L10: State Machines (Part 2) Masoumeh (Azin) Ebrahimi Elena Dubrova

Philadelphia University Student Name: Student Number:

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

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:

Lecture 10: Synchronous Sequential Circuits Design

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

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

EECS150 - Digital Design Lecture 16 Counters. Announcements

Laboratory Exercise #11 A Simple Digital Combination Lock

Synchronous Sequential Circuit Design

Digital Logic Design - Chapter 5

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

EECS 270 Midterm 2 Exam Answer Key Winter 2017

Logic and Computer Design Fundamentals. Chapter 8 Sequencing and Control

Finite State Machine (FSM)

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

Synchronous Sequential Logic. Chapter 5

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


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

Chapter 5 Synchronous Sequential Logic

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

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

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

Clocked Synchronous State-machine Analysis

Analysis and Design of Sequential Circuits: Examples

Mealy & Moore Machines

EE 209 Logic Cumulative Exam Name:

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

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

Let s now begin to formalize our analysis of sequential machines Powerful methods for designing machines for System control Pattern recognition Etc.

L10 State Machine Design Topics

6 Synchronous State Machine Design

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

Sequential Synchronous Circuit Analysis

( c) Give logic symbol, Truth table and circuit diagram for a clocked SR flip-flop. A combinational circuit is defined by the function

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

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

Sequential Circuit Design

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

Digital Design 2010 DE2 1

Review for B33DV2-Digital Design. Digital Design

Hanbat National University Prof. Lee Jaeheung

Synchronous Sequential Logic

Table of Content. Chapter 11 Dedicated Microprocessors Page 1 of 25

Chapter 7. VLSI System Components

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

EECS150 - Digital Design Lecture 25 Shifters and Counters. Recap

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

FSM Examples. Young Won Lim 11/6/15

Philadelphia University Student Name: Student Number:

Written reexam with solutions for IE1204/5 Digital Design Monday 14/

Written exam with solutions IE1204/5 Digital Design Friday 13/

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

Lecture (08) Synchronous Sequential Logic

10/12/2016. An FSM with No Inputs Moves from State to State. ECE 120: Introduction to Computing. Eventually, the States Form a Loop

14.1. Unit 14. State Machine Design

EXPERIMENT Traffic Light Controller

CSE 320: Spartan3 I/O Peripheral Testing

Topic 8: Sequential Circuits

Transcription:

Chapter 6 Synchronous Sequential Circuits

In a combinational circuit, the values of the outputs are determined solely by the present values of its inputs. In a sequential circuit, the values of the outputs depend on the past behavior of the circuit, as well as the present values of its inputs. A sequential circuit has states, which in conjunction with the present values of inputs determine its behavior.

Sequential circuits can be:! Synchronous where flip-flops are used to implement the states, and a clock signal is used to control the operation! Asynchronous where no clock is used

W Combinational circuit Flip-flops Q Combinational circuit Z Clock Figure 6.1. The general form of a synchronous sequential circuit.

If the outputs depend only on the present state, the circuit is said to be of Moore type. If the outputs depend on both the present state and the present values of the inputs, the circuit is said to be of Mealy type.

Clockcycle: t 0 t 1 t 2 t 3 t 4 t 5 t 6 t 7 t 8 t 9 t 10 w : 0 1 0 1 1 0 1 1 1 0 1 z : 0 0 0 0 0 1 0 0 1 1 0 Figure 6.2. Sequences of input and output signals.

Reset w = 0 A z = 0 w = 1 w = 0 B z = 0 w = 0 w = 1 C z = 1 w = 1 Figure 6.3. State diagram of a simple sequential circuit.

Present Next state Output state w = 0 w = 1 z A A B 0 B A C 0 C A C 1 Figure 6.4. State table for the sequential circuit in Figure 6.3.

w Combinational circuit Y 1 y 1 Combinational circuit z Y 2 y 2 Clock Figure 6.5. A general sequential circuit with input w, output z, state flip-flops. and two

The present state variables, y 1 and y 2, determine the present state of the circuit. The next state variables, Y 1 and Y 2, determine the state into which the circuit will go after the next active edge of the clock signal.

Present Next state state w = 0 w = 1 Output z y y Y Y Y Y 2 1 2 1 2 1 A 00 00 01 0 B 01 00 10 0 C 10 00 10 1 11 dd dd d Figure 6.6. State-assigned table for the sequential circuit in Figure 6.4.

y 2 y 1 w 00 01 11 10 Ignoring don't cares Using don't cares 0 0 0 d 0 Y = wy y 1 1 2 Y = wy y 1 1 2 1 1 0 d 0 w y 2 y 1 00 01 11 10 0 0 0 d 0 Y = wy y + wy y 2 1 2 1 2 Y = wy + wy 2 1 2 1 0 1 d 1 = w ( y + y ) 1 2 y 1 y 2 0 1 0 0 0 z = y y 1 2 z = y 2 1 1 d Figure 6.7. Derivation of logic expressions for the sequential circuit in Figure 6.6.

Figure 6.8. Final implementation of the sequential circuit derived in Figure 6.7.

Clock w y 1 y 2 z 1 0 1 0 1 0 1 0 1 0 t 0 t 1 t 2 t 3 t 4 t 5 t 6 t 7 t 8 t 9 t 10 Figure 6.9. Timing diagram for the circuit in Figure 6.8.

Design steps: 1. Obtain the specification of the desired circuit. 2. Derive a state diagram. 3. Derive the corresponding state table. 4. Reduce the number of states if possible. 5. Decide on the number of state variables. 6. Choose the type of flip-flops to be used. 7. Derive the logic expressions needed to implement the circuit.

Figure 6.10. System for Example 6.1.

w = 0 A No transfer Reset w = 1 B R 2 out = 1, R 3 in = 1 w = 0 w = 1 w = 0 w = 1 C R 1 out = 1, R 2 in = 1 w = 0 w = 1 D R 3 out = 1, R 1 in = 1, Done = 1 Figure 6.11. State diagram for Example 6.1.

Present Next state Outputs state w = 0 w = 1 A A B 0 0 0 0 0 0 0 B C C 0 0 1 0 0 1 0 C D D 1 0 0 1 0 0 0 D A A 0 1 0 0 1 0 1 Figure 6.12. State table for Example 6.1.

Present state Next state Outputs A 00 00 0 1 0 0 0 0 0 0 0 B 01 10 1 0 0 0 1 0 0 1 0 C 10 11 1 1 1 0 0 1 0 0 0 D 11 00 0 0 0 1 0 0 1 0 1 Figure 6.13. State-assigned table for the sequential circuit in Figure 6.12.

w y 2 y 1 00 01 11 10 0 1 1 1 1 Y 1 = wy 1 + y 1 y 2 w y 2 y 1 00 01 11 10 0 1 1 1 1 1 Y 2 = y 1 y 2 + y 1 y 2 Figure 6.14. Derivation of next-state expressions for the sequential circuit in Figure 6.13.

Figure 6.15. Final implementation of sequential circuit in Figure 6.13.

Next state Present state w = 0 w = 1 Output z y 2 y 1 Y 2 Y 1 Y 2 Y 1 A 00 00 01 0 B 01 00 11 0 C 11 00 11 1 10 dd dd d Figure 6.16. Improved state assignment for the sequential circuit 6.4. in Figure

Y 2 D Q y 2 z Q w Y 1 D Q y 1 Clock Q Resetn Figure 6.17. Final circuit for the improved state assignment in Figure 6.16.

Present state Nextstate Outputs A 00 0 0 01 0 0 0 0 0 0 0 B 01 1 1 11 0 0 1 0 0 1 0 C 11 1 0 10 1 0 0 1 0 0 0 D 10 0 0 00 0 1 0 0 1 0 1 Figure 6.18. Improved state assignment for the sequential circuit in Figure 6.12.

w y 2 y 1 00 01 11 10 0 1 1 1 1 Y 1 = wy 2 + y 1 y 2 w y 2 y 1 00 01 11 10 0 1 1 1 1 1 Y 2 = y 1 Figure 6.19. Derivation of next-state expressions for the sequential circuit in Figure 6.18.

Present Nextstate state w = 0 w = 1 Output y 3 y 2 y z 1 Y 3 Y 2 Y 1 Y 3 Y 2 Y 1 A 001 001 010 0 B 010 001 100 0 C 100 001 100 1 Figure 6.20. One-hot state assignment for the sequential circuit 6.4. in Figure

Present state Nextstate Outputs A 0 001 0001 0010 0 0 0 0 0 0 0 B 0 010 0100 0100 0 0 1 0 0 1 0 C 0 100 1000 1000 1 0 0 1 0 0 0 D 1 000 0001 0001 0 1 0 0 1 0 1 Figure 6.21. One-hot state assignment for the sequential Figure 6.12. circuit in

Clock cycle: t 0 t 1 t 2 t 3 t 4 t 5 t 6 t 7 t 8 t 9 t 10 w : 0 1 0 1 1 0 1 1 1 0 1 z : 0 0 0 0 1 0 0 1 1 0 0 Figure 6.22. Sequences of input and output signals.

Reset w = 1 z = 0 w = 0 z = 0 A B w = 1 z = 1 w = 0 z = 0 Figure 6.23. State diagram of an FSM that realizes the task in 6.22. Figure

Present Next state Output z state w = 0 w = 1 w = 0 w = 1 A A B 0 0 B A B 0 1 Figure 6.24. State table for the FSM in Figure 6.23.

Present Next state Output state w = 0 w = 1 w = 0 w = 1 y Y Y z z A 0 0 1 0 0 B 1 0 1 0 1 Figure 6.25. State-assigned table for the FSM in Figure 6.24.

z w D Q y Clock Q Resetn (a) Circuit Clock w y z 1 0 1 0 1 0 1 0 t 0 t 1 t 2 t 3 t 4 t 5 t 6 t 7 t 8 t 9 t 10 (b) Timing diagram Figure 6.26. Implementation of FSM in Figure 6.25.

Figure 6.27. Circuit that implements the specification in Figure 6.2.

w = 0 A Reset w = 1 R2 out = 1, R3 in = 1 B w = 0 w = 1 R1 out = 1, R2 in = 1 C w = 0 w = 1 R3 out = 1, R1 in = 1, Done = 1 Figure 6.28. State diagram for Example 6.4.

module simple (Clock, Resetn, w, z); input Clock, Resetn, w; output z; reg [2:1] y, Y; parameter [2:1] A = 2'b00, B = 2'b01, C = 2'b10; // Define the next state combinational circuit always @(w, y) case (y) A: if (w) Y = B; else Y = A; B: if (w) Y = C; else Y = A; C: if (w) Y = C; else Y = A; default: Y = 2'bxx; endcase // Define the sequential block always @(negedge Resetn, posedge Clock) if (Resetn = = 0) y <= A; else y <= Y; // Define output assign z = (y = = C); endmodule Figure 6.29. Verilog code for the FSM in Figure 6.3.

Please see portrait orientation PowerPoint file for Chapter 6 Figure 6.30. Implementation of the FSM of Figure 6.3 in a CPLD.

Resetn w Gnd Clock 7 4 1 44 39 10 36 13 EPM7032 z 16 19 22 25 28 V DD Figure 6.31. The circuit from Figure 6.30 in a small CPLD.

Figure 6.32. Simulation results for the circuit in Figure 6.30.

module simple (Clock, Resetn, w, z); input Clock, Resetn, w; output reg z; reg [2:1] y, Y; parameter [2:1] A = 2'b00, B = 2'b01, C = 2'b10; // Define the next state combinational circuit always @(w, y) begin case (y) A: if (w) Y = B; else Y = A; B: if (w) Y = C; else Y = A; C: if (w) Y = C; else Y = A; default: Y = 2'bxx; endcase z = (y = = C); //Define output end // Define the sequential block always @(negedge Resetn, posedge Clock) if (Resetn = = 0) y <= A; else y <= Y; endmodule Figure 6.33. Second version of code for the FSM in Figure 6.3.

module simple (Clock, Resetn, w, z); input Clock, Resetn, w; output z; reg [2:1] y; parameter [2:1] A = 2'b00, B = 2'b01, C = 2'b10; // Define the sequential block always @(negedge Resetn, posedge Clock) if (Resetn = = 0) y <= A; else case (y) A: if (w) y <= B; else y <= A; B: if (w) y <= C; else y <= A; C: if (w) y <= C; else y <= A; default: y <= 2'bxx; endcase // Define output assign z = (y = = C); endmodule Figure 6.34. Third version of code for the FSM in Figure 6.3.

Please see portrait orientation PowerPoint file for Chapter 6 Figure 6.35. Verilog code for the FSM in Figure 6.11.

Please see portrait orientation PowerPoint file for Chapter 6 Figure 6.36. Verilog code for the Mealy machine of Figure 6.23.

Figure 6.37. Simulation results for the Mealy machine.

Figure 6.38. Potential problem with asynchronous inputs to a Mealy FSM.

A Shift register a Adder FSM s Shift register Shift register b Sum = A + B B Clock Figure 6.39. Block diagram for the serial adder.

Reset ( ab s ) 11 0 00 0 01 1 10 1 G H 01 0 10 0 11 1 00 1 G: H: carry-in = 0 carry-in = 1 Figure 6.40. State diagram for the serial adder FSM.

Present Next state Output s state ab =00 01 10 11 00 01 10 11 G G G G H 0 1 1 0 H G H H H 1 0 0 1 Figure 6.41. State table for the serial adder FSM.

Next state Output Present state ab =00 01 10 11 00 01 10 11 y Y s 0 0 0 0 1 0 1 1 0 1 0 1 1 1 1 0 0 1 Figure 6.42. State-assigned table for Figure 6.41.

a b Full adder Y carry-out D Q y s Clock Q Reset Figure 6.43. Circuit for the adder FSM in Figure 6.39.

Reset 00 G 0 s = 0 11 H 0 s = 0 01 10 01 10 00 00 11 11 01 10 01 10 G 1 s = 1 00 H 1 s = 1 11 Figure 6.44. State diagram for the Moore-type serial adder FSM.

Present Nextstate Output state ab =00 01 10 11 s G 0 G 0 G 1 G 1 H 0 0 G 1 G 0 G 1 G 1 H 0 1 H 0 G 1 H 0 H 0 H 1 0 H 1 G 1 H 0 H 0 H 1 1 Figure 6.45. State table for the Moore-type serial adder FSM.

Nextstate Present state ab =00 01 10 11 Output y 2 y 1 s Y 2 Y 1 00 0 0 01 0 1 10 0 01 0 0 01 0 1 10 1 10 0 1 10 1 0 11 0 11 0 1 10 1 0 11 1 Figure 6.46. State-assigned table for Figure 6.45.

a b Full adder Sum bit Carry-out Y 1 D Q Q y 1 s Y 2 D Q y 2 Clock Q Reset Figure 6.47. Circuit for the Moore-type serial adder FSM.

module shiftrne (R, L, E, w, Clock, Q); parameter n = 8; input [n-1:0] R; input L, E, w, Clock; output reg [n-1:0] Q; integer k; always @(posedge Clock) if (L) Q <= R; else if (E) begin for (k = n-1; k > 0; k = k-1) Q[k-1] <= Q[k]; Q[n-1] <= w; end endmodule Figure 6.48. Code for a left-to-right shift register with an enable input.

Please see portrait orientation PowerPoint file for Chapter 6 Figure 6.49. Verilog code for the serial adder.

Please see portrait orientation PowerPoint file for Chapter 6 Figure 6.50. Synthesized serial adder.

Equivalence of states Two states S i and S j are said to be equivalent if and only if for every possible input sequence, the same output sequence will be produced regardless of whether S i or S j is the initial state.

Present Next state Output state w = 0 w = 1 z A B C 1 B D F 1 C F E 0 D B G 1 E F C 0 F E D 0 G F G 0 Figure 6.51. State table for Example 6.6.

Present Nextstate Output state w = 0 w = 1 z A B C 1 B A F 1 C F C 0 F C A 0 Figure 6.52. Minimized state table for Example 6.6.

Clock sense N sense D N D (a) Timing diagram N sense N D Q D Q Clock Q Q (b) Circuit that generates N Figure 6.53. Signals for the vending machine.

DN DN DN S1 0 Reset DN DN D N DN S4 1 N S2 0 S3 0 D S7 1 D DN N S5 1 S6 0 DN DN N D S8 1 S9 1 Figure 6.54. State diagram for Example 6.7.

Present Next state Output state DN =00 01 10 11 z S1 S1 S3 S2 0 S2 S2 S4 S5 0 S3 S3 S6 S7 0 S4 S1 1 S5 S3 1 S6 S6 S8 S9 0 S7 S1 1 S8 S1 1 S9 S3 1 Figure 6.55. State table for Example 6.7.

Present Next state Output state DN =00 01 10 11 z S1 S1 S3 S2 0 S2 S2 S4 S5 0 S3 S3 S2 S4 0 S4 S1 1 S5 S3 1 Figure 6.56. Minimized state table for Example 6.7.

DN S1 0 DN N D S3 0 DN N DN DN S2 0 D S5 1 N S4 1 D Figure 6.57. Minimized state diagram for Example 6.7.

DN 0 S1 N 0 D 1 DN 0 N 1 S3 D 0 N 0 D 1 S2 DN 0 Figure 6.58. Mealy-type FSM for Example 6.7.

Present Next state Output z state w = 0 w = 1 w = 0 w = 1 A B C 0 0 B D 0 C F E 0 1 D B G 0 0 E F C 0 1 F E D 0 1 G F 0 Figure 6.59. Incompletely specified state table for Example 6.8.

w = 0 w = 0 w = 0 w = 0 w = 1 w = 1 w = 1 A/0 B/1 C/2 D/3 w = 1 w = 1 H/7 w = 1 G/6 w = 1 F/5 w = 1 E/4 w = 0 w = 0 w = 0 w = 0 Figure 6.60. State diagram for the counter.

Present Next state state w = 0 w = 1 Output A A B 0 B B C 1 C C D 2 D D E 3 E E F 4 F F G 5 G G H 6 H H A 7 Figure 6.61. State table for the counter.

Next state Present Count state w = 0 w = 1 y 2 y 1 y 0 z 2 z 1 z 0 Y 2 Y 1 Y 0 Y 2 Y 1 Y 0 A 000 000 001 000 B 001 001 010 001 C 010 010 011 010 D 011 011 100 011 E 100 100 101 100 F 101 101 110 101 G 110 110 111 110 H 111 111 000 111 Figure 6.62. State-assigned table for the counter.

y 1 y 0 y 1 y 0 wy 2 wy 2 00 01 11 10 00 01 11 10 00 0 1 1 0 00 0 0 1 1 01 0 1 1 0 01 0 0 1 1 11 1 0 0 1 11 0 1 0 1 10 1 0 0 1 10 0 1 0 1 Y 0 = wy 0 + wy 0 Y 1 = wy 1 + y 1 y 0 + wy 0 y 1 y 1 y 0 wy 2 00 01 11 10 00 0 0 0 0 01 1 1 1 1 11 1 1 0 1 10 0 0 1 0 Y 2 = wy 2 + y 0 y 2 + y 1 y 2 + w y 0 y 1 y 2 Figure 6.63. Karnaugh maps for D flip-flops for the counter.

Please see portrait orientation PowerPoint file for Chapter 6 Figure 6.64. Circuit diagram for the counter implemented with D flip-flops.

Flip-flop inputs Present Count state w = 0 w = 1 y 2 y 1 y 0 z 2 z 1 z 0 Y 2 Y 1 Y 0 J 2 K 2 J 1 K 1 J 0 K 0 Y 2 Y 1 Y 0 J 2 K 2 J 1 K 1 J 0 K 0 A 000 000 0d 0d 0d 001 0d 0d 1d 000 B 001 001 0d 0d d0 010 0d 1d d1 001 C 010 010 0d d0 0d 011 0d d0 1d 010 D 011 011 0d d0 d0 100 1d d1 d1 011 E 100 100 d0 0d 0d 101 d0 0d 1d 100 F 101 101 d0 0d d0 110 d0 1d d1 101 G 110 110 d0 d0 0d 111 d0 d0 1d 110 H 111 111 d0 d0 d0 000 d1 d1 d1 111 Figure 6.65. Excitation table for the counter with JK flip-flops.

Please see portrait orientation PowerPoint file for Chapter 6 Figure 6.66. Karnaugh maps for JK flip-flops in the counter.

w J Q y 0 K Q J Q y 1 K Q J Q y 2 K Q Clock Resetn Figure 6.67. Circuit diagram using JK flip-flops.

w J Q y 0 K Q J Q y 1 K Q J Q y 2 K Q Clock Resetn Figure 6.68. Factored-form implementation of the counter.

Present Next Output state state z 2 z 1 z 0 A B 000 B C 100 C D 010 D E 110 E F 001 F G 101 G H 011 H A 111 Figure 6.69. State table for the counterlike example.

Present Next Output state state y 2 y 1 y 0 Y 2 Y 1 Y 0 z 2 z 1 z 0 000 100 000 100 010 100 010 110 010 110 001 110 001 101 001 101 011 101 011 111 011 111 000 111 Figure 6.70. State-assigned table for Figure 6.69.

D Q z 2 Q D Q z 1 Q D Q z 0 w Q Figure 6.71. Circuit for Figure 6.70.

Reset 000 Idle 0xx 1xx gnt1 g 1 = 1 x0x 1xx 01x gnt2 g 2 = 1 xx0 x1x 001 gnt3 g 3 = 1 xx1 Figure 6.72. State diagram for the arbiter.

Reset r 1 r 2 r 3 Idle r 1 r 1 gnt1 g 1 = 1 r 2 r 1 r 1 r 2 gnt2 g 2 = 1 r 3 r 2 r 1 r 2 r 3 gnt3 g 3 = 1 r 3 Figure 6.73. Alternative style of state diagram for the arbiter.

Please see portrait orientation PowerPoint file for Chapter 6 Figure 6.74. Verilog code for the arbiter.

Y 1 D Q y 1 z w Q Y 2 D Q y 2 Clock Q Resetn Figure 6.75. Circuit for Example 6.9.

Next State Present Output state w = 0 w = 1 y 2 y 1 z Y 2 Y 1 Y 2 Y 1 0 0 0 0 01 0 0 1 0 0 10 0 1 0 0 0 11 0 1 1 0 0 11 1 Present Next state Output state w = 0 w = 1 z A A B 0 B A C 0 C A D 0 D A D 1 (a) State-assigned table (b) State table Figure 6.76. Tables for the circuit in Example 6.75.

w J 1 J Q y 1 z K 1 K Q Clock J 2 K 2 J K Q Q y 2 Resetn Figure 6.77. Circuit for Example 6.10.

Present Flip-flop inputs state w = 0 w = 1 Output y 2 y 1 z J 2 K 2 J 1 K 1 J 2 K 2 J 1 K 1 00 01 0 1 0 0 1 1 0 01 01 0 1 1 0 1 1 0 10 01 0 1 0 0 1 0 0 11 01 0 1 1 0 1 0 1 Figure 6.78. The excitation table for the circuit in Figure 6.77.

w D 1 D Q y 1 z Q T 2 T Q y 2 Clock Q Resetn Figure 6.79. Circuit for Example 6.11.

Present Flip-flop inputs Output state w = 0 w = 1 y 2 y 1 z T 2 D 1 T 2 D 1 0 0 0 0 01 0 0 1 0 0 10 0 1 0 1 0 01 0 1 1 1 0 01 1 Figure 6.80. Excitation table for the circuit in Figure 6.79.

State name Output signals or actions (Moore type) 0 (False) Condition 1 (True) expression (a) State box (b) Decision box Conditional outputs or actions (Mealy type) (c) Conditional output box Figure 6.81. Elements used in ASM charts.

Please see portrait orientation PowerPoint file for Chapter 6 Figure 6.82. ASM chart for the FSM in Figure 6.3.

Reset A 0 w 1 B z 0 1 w Figure 6.83. ASM chart for the FSM in Figure 6.23.

Reset Idle r 1 1 0 gnt1 g 1 1 r 1 0 r 2 1 0 gnt2 g 2 1 r 2 0 0 1 r 3 gnt3 g 3 1 r 3 0 Figure 6.84. ASM chart for the arbiter FSM in Figure 6.73.

w 1 z 1 Inputs w n Combinational circuit z m Outputs y k Y k Present-state variables Next-state variables y 1 Y 1 Figure 6.85. The general model for a sequential circuit.

Figure 6.86. State diagram for Example 6.12.

Figure 6.87. State table for the FSM in Figure 6.86.

Figure 6.88. State-assigned table for the FSM in Figure 6.87.

Figure 6.89. An improved state assignment for the FSM in Figure 6.87.

Figure 6.90. FSM that detects a sequence of two zeros.

Figure 6.91. State diagram for Example 6.14.

Figure 6.92. State table for the FSM in Figure 6.91.

Figure 6.93. State-assigned table for the FSM in Figure 6.92.

Figure 6.94. Excitation table for the FSM in Figure 6.89 with JK flip-flops.

Please see portrait orientation PowerPoint file for Chapter 6 Figure 6.95. Verilog code for the FSM in Figure 6.86.

Please see portrait orientation PowerPoint file for Chapter 6 Figure 6.96. Verilog code for the FSM in Figure 6.91.

Figure 6.97. Parallel-to-serial converter.

Please see portrait orientation PowerPoint file for Chapter 6 Figure 6.98. FSM for parity generation.

Present Next state state w = 0 w = 1 Output y 2 y 1 Y 2 Y 1 Y 2 Y 1 z 0 0 1 0 1 1 0 0 1 0 1 0 0 0 1 0 1 1 0 0 0 1 1 1 0 0 1 1 Figure P6.1. State-assigned table for Problems 6.1 and 6.2.

w D Q z Clock Q D Q Q Figure P6.2. Circuit for Problem 6.29.