Symbolic State Minimization

Similar documents
CprE 281: Digital Logic

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

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

Generalized FSM model: Moore and Mealy

Example: vending machine

ECE380 Digital Logic

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

CprE 281: Digital Logic

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

Module 10: Sequential Circuit Design

Example: A vending machine

Different encodings generate different circuits

Asynchronous sequence circuits

12. Finite State Machine Design

EGR224 F 18 Assignment #4

Synchronous Sequential Circuit Design

Sequential Circuit Design

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

ASYNCHRONOUS SEQUENTIAL CIRCUITS

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

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

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

Synchronous Sequential Circuit Design. Digital Computer Design

Digital Design. Sequential Logic

Models for representing sequential circuits

CPE100: Digital Logic Design I

Lecture 14 Finite state machines

EECS150 - Digital Design Lecture 23 - FSMs & Counters

Chapter 3. Chapter 3 :: Topics. Introduction. Sequential Circuits

15.1 Elimination of Redundant States

Sequential logic and design

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

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

FYSE420 DIGITAL ELECTRONICS

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

CPE100: Digital Logic Design I

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

Lecture 10: Synchronous Sequential Circuits Design

ECE380 Digital Logic. Synchronous sequential circuits

Vending machine A design-example by Ingo Sander

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

Digital Electronics Sequential Logic

State Graphs FSMs. Page 1

EE 209 Spiral 1 Exam Solutions Name:

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

Sequential Synchronous Circuit Analysis

Chapter 9 Asynchronous Sequential Logic

Clocked Synchronous State-machine Analysis

ELE2120 Digital Circuits and Systems. Tutorial Note 10

or 0101 Machine

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

Synchronous Sequential Logic

ELE2120 Digital Circuits and Systems. Tutorial Note 9

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

Sequential Logic Design: Controllers

CSE140: Design of Sequential Logic

Boolean cubes EECS150. Mapping truth tables onto cubes. Simplification. The Uniting Theorem. Three variable example

Chapter 6. Synchronous Sequential Circuits

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

Appendix A: Digital Logic. CPSC 352- Computer Organization

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

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

Chapter 3. Digital Design and Computer Architecture, 2 nd Edition. David Money Harris and Sarah L. Harris. Chapter 3 <1>

Digital Circuits and Systems

CSE 311 Lecture 23: Finite State Machines. Emina Torlak and Kevin Zatloukal

Chapter 2. Review of Digital Systems Design

GRADE LEVEL: THIRD SUBJECT: MATH DATE: CONTENT STANDARD INDICATORS SKILLS ASSESSMENT VOCABULARY ISTEP

CHAPTER 9: SEQUENTIAL CIRCUITS

COMBINATIONAL LOGIC FUNCTIONS

14.1. Unit 14. State Machine Design

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

Chapter 7. Synchronous Sequential Networks. Excitation for

Mealy & Moore Machines

Overview of Chapter 4

EE201l Homework # 6. Microprogrammed Control Unit Design

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

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

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

INTEGRATED CIRCUITS. For a complete data sheet, please also download:


ECE 341. Lecture # 3

Synchronous 4 Bit Counters; Binary, Direct Reset

Digital Logic Design - Chapter 5

Math 8 Notes Units 1B: One-Step Equations and Inequalities

Problem Set 9 Solutions

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

Department of Electrical & Electronics EE-333 DIGITAL SYSTEMS

Combinational vs. Sequential. Summary of Combinational Logic. Combinational device/circuit: any circuit built using the basic gates Expressed as

Philadelphia University Student Name: Student Number:

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

CSE370 HW6 Solutions (Winter 2010)

CPE100: Digital Logic Design I

74LS195 SN74LS195AD LOW POWER SCHOTTKY

ENEL Digital Circuit Design. Final Examination

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

Chapter 5. Digital systems. 5.1 Boolean algebra Negation, conjunction and disjunction

ALU, Latches and Flip-Flops

Time Allowed 3:00 hrs. April, pages

Written exam for IE1204/5 Digital Design with solutions Thursday 29/

EECS 270 Midterm 2 Exam Answer Key Winter 2017

Transcription:

CSE 27 Introduction to igital Systems Supplementary Reading Symbolic State inimization and An Example Symbolic State inimization In constructing state diagrams, it often occurs that the number of symbolic states that we use is not the minimum possible to perform the required function. When a designer has to design a more complex FS, it is likely that the initial attempt will result in a state diagram with more symbolic states than actually required. inimizing the number of states is of interest because fewer flip-flops may be needed to represent the symbolic states and the complexity of the combinational circuit needed in the FS may be reduced. If the number of symbolic states can be reduced, then some symbolic states in the original state diagram must be equivalent to other symbolic states in their contribution to the overall behavior of the FS. Let us express this more formally by introducing the following definition. efinition. Two symbolic 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. It is possible to define a minimization procedure that searches for any symbolic states that are equivalent. However such a procedure is quite tedious. In the following, we will present an alternative approach, which is much more efficient but not quite as broad in scope. Instead of trying to show that some symbolic states in a given state diagram are equivalent, it is often easier to show that some symbolic states are definitely not equivalent. Let us exploit this idea to define a simple minimization procedure. Suppose that a FS has a single input W. Then if the input signal W = is applied to this machine in symbolic state S i and the result is that the machine moves to symbolic state S u, we will say that S u is a -successor of S i. Similarly, if W = is applied in S i and it causes the machine to move to symbolic state S v, we will say that S v is a -successor of S i. In general, we will refer to the successors of S i as k-successors. When the FS has only one input, k can be either or. But if there are multiple inputs to the FS, then k represents the set of all possible combinations (valuations) of the inputs. From the above definition, it follows that if the symbolic states S i and S j are equivalent, then their corresponding k-successors (for all k) are also equivalent. sing this fact, we can formulate a minimization procedure that involves considering the symbolic states of the machine as a set and then breaking the set into partitions that comprise subsets that are definitely not equivalent. efinition. A partition consists of one or more blocks, where each block comprises a subset of symbolic states that may be equivalent, but the symbolic states in a given block are definitely not equivalent to the symbolic states in other blocks. Let us assume initially that all symbolic states are equivalent; this forms the initial partition, P,in which all symbolic states are in the same block. As the next step, we will form the partition P 2 in which the set of symbolic states is partitioned into blocks such that the symbolic states in each block generate the same output values. Obviously, the symbolic states that generate different outputs cannot possibly be equivalent. Then we will continue to form new partitions by testing whether the k-successors of the symbolic states in each block are contained in one block. Those symbolic states whose k-successors are in different blocks cannot be in one block. Thus new blocks are formed in each new partition. The process ends when a new partition is the same as the previous partition. Then all symbolic states in any one block are equivalent. In the following, we will consider an example to illustrate the procedure.

A Vending achine esign Example As an example of minimization, let us consider the design of a simple vending machine. Suppose that a coin-operated vending machine dispenses candy under the following conditions: The machine accepts nickels and dimes. It takes 5 cents for a piece of candy to be released from the machine. If 2 cents is deposited, the machine will not return the change, but it will credit the buyer with 5 cents and wait for the buyer to make a second purchase. All electronic signals in the vending machine are synchronized to the positive edge of a clock signal, named Clock. Assume that the clock period is ns. The vending machine s coin-receptor mechanism generates two signals, sense and sense, which are asserted when a dime or a nickel is detected. Because the coin receptor is a mechanical device and thus very slow compared to an electronic circuit, inserting a coin causes sense or sense to be set to for a large number of clock cycles. We will assume that the coin receptor also generates two other signals, named and. The signal is set to for one clock cycle after sense becomes, and is set to for one clock cycle after sense becomes. The timing relationships between Clock, sense, sense,, and are illustrated in Figure. The hash marks on the waveforms indicate that sense or sense may be for many clock cycles. Also, there may be an arbitrarily long time between the insertion of two consecutive coins. ote that since the coin receptor can accept only one coin at a time, it is not possible to have both and set to at once. Figure 2 illustrates how the signal may be generated from the sense signal. Clock sense sense Time Figure. A timing diagram for the inputs of the vending machine. sense Clock Figure 2. A circuit that generates. Based on the above descriptions of the functionality of the vending machine, we can choose the inputs and output of the FS as shown in the following table (the meaning of and for each input and output is also listed). 2

Inputs Output Z -adimeissensed -anickelissensed - sufficient money to release candy -adimeisnotsensed -anickelisnotsensed - insufficient money We can then develop an initial state diagram in a fairly straightforward manner, as indicated in Figure 3. The inputs to the FS are and, and the starting symbolic state is S. As long as = =,the machine remains in symbolic state S, which is indicated by the arc labeled. Inserting a dime leads to symbolic state S2, while inserting a nickel leads to symbolic state S3. In both cases the deposited amount is less than 5 cents, which is not sufficient to release the candy. This is indicated by the output, Z, being equal to, as in S2/ and S3/. The machine will remain in state S2 or S3 until another coin is deposited because = =. In state S2 a nickel will cause a transition to S4 andadimetos5. In both of these states, sufficient money is deposited to activate the output mechanism that releases the candy; hence the state nodes have the labels S4/ and S5/. In S4 the deposited amount is 5 cents, which means that on the next active clock edge the machine should return to the reset state S. The condition on the arc leaving S4 is guaranteed to be true because the machine remains in state S4 for only ns, which is far too short a time for a new coin to have been deposited. Reset (state/z) S/ S4/ S2/ S3/ S7/ S5/ S6/ S8/ S9/ Figure 3. A state diagram for the vending machine. The state S5 denotes that an amount of 2 cents has been deposited. The candy is released, and on the next clock edge the FS makes a transition to state S3, which represents a credit of 5 cents. A similar reasoning when the machine is in state S3 leads to states S6 through S9. This completes the state diagram for the desired FS. Remark. In Figure 3, the transition arc from S/ tos3/ is labeled by. Tobemoreaccurate,itshould be labeled by. However, since is impossible to occur, here we simply label the transition by (which indicates that a nickel has been detected) without causing any confusion. Such simplified labeling is often used in drawing state diagrams in digital design. nder the assumption that is impossible, when constructing the state table, we will still translate the transition labeled by as the information in the cell corresponding to = while leaving the cell corresponding to = asdon tcare. A state table for the state diagram in Figure 3 is given below. 3

Present ext State Output State = Z 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 In the above table, note that the condition = = is denoted as don t care. ote also other don t cares in states S4, S5, S7, S8, and S9. They correspond to cases where there is no need to check the and signals because the machine changes to another state in an amount of time that is too short for a new coin to have been inserted. The state diagram in Figure 3 obviously contains more states than necessary. ow let us apply the minimization procedure to obtain the following partitions P = (S,S2,S3,S4,S5,S6,S7,S8,S9) P 2 = (S,S2,S3,S6)(S4,S5,S7,S8,S9) P 3 = (S)(S3)(S2,S6)(S4,S5,S7,S8,S9) P 4 = (S)(S3)(S2,S6)(S4,S7,S8)(S5,S9) P 5 = (S)(S3)(S2,S6)(S4,S7,S8)(S5,S9) The final partition has five blocks. Let S2 denote its equivalent to S6, let S4 denote the same with respect to S7 and S8, and let S5 represent S9. This leads to the minimized state diagram shown in Figure 4 below. Reset (state/z) S/ S3/ S2/ S5/ S4/ Figure 4. inimized state diagram for the vending machine. The state table for the state diagram in Figure 4 is given below. 4

Present ext State Output State = Z S S S3 S2 S2 S2 S4 S5 S3 S3 S2 S4 S4 S S5 S3 Looking at the optimized state diagram in Figure 4, it can be seen that for this example, it may have been quite feasible to derive the optimized state diagram directly, using the following reasoning. Suppose that the symbolic states correspond to the various amounts of money deposited. In particular, the symbolic states, S, S3, S2, S4, and S5 correspond to the amounts of, 5,, 5, and 2 cents, respectively. With this interpretation of the states, it is not difficult to derive the transition arcs that define the desired FS as in Figure 4. In practice, the designer can often produce initial designs that do not have a large amount of superfluous states. In the following, let us design an FS based on the optimized state diagram (or, equivalently, the minimized state table shown above). We will apply two methods to accomplish the design. ethod (sing inimum State Variables). In view of the state table, there are 5 symbolic states. Therefore the minimum number of state variables needed is 3. Let us adopt the following state assignment table. Symbolic State = 2 S S2 S3 S4 S5 Such state assignments consequently lead to the following state-assigned table. Present State ext State = 2 Output = 2 = Z Based on the above state-assigned table, we can use Espresso to obtain the following next-state and output expressions (it may be better to use a separate Espresso file for each expression) = = 2 2 = Z = 2 and then implement the vending machine by the circuit shown in Figure 5. 5

Z 2 2 Clock Reset Figure 5. A circuit for the vending machine with asynchronous active low Reset. ethod 2 (One-Hot Encoding). Another method for implementing the circuit is to use the one-hot encoding of the states, which is based the following state assignment table. Symbolic State = 5 4 3 2 S S2 S3 S4 S5 ote that here we choose 5 state variables as, 2, 3, 4,and 5 (instead of,, 2, 3, 4 )so that the subscript in each state variable name is the same as the numbering of the corresponding symbolic states. As discussed in class, in the one-hot encoding method, we can derive the next-state and output expressions simply by inspecting the state diagram in Figure 4 (hence it is not necessary to write out the state-assigned table and resort to K-maps or Espresso to derive the expressions). The next-state and output expressions can be obtained as = 4 2 = 2 3 3 = 3 5 4 = 2 3 5 = 2 Z = 4 5 which leads to the implement the vending machine by the circuit shown in Figure 6. 6

s Z 2 s 2 3 s 3 4 s 4 Reset Clock 5 s 5 Figure 6. A one hot encoded circuit for the vending machine with synchronous active low Reset. Remark. The inspection method used in the case of one-hot encoding can quickly lead to expressions of next-state and output. However, the expressions thus obtained may not be the optimal ones. To optimize the expression, we still need to write the state-assigned table as below. Present State ext State = 5 4 3 2 Output = 5 4 3 2 = Z The remaining 27 valuations of the state variables are not used and hence not shown in the above table. They can be treated as don t cares in the derivation of the next-state and output expressions. sing Espresso, It should be noted that the inspection method corresponds to one specfic instance of assigning s and s to the don t cares. However, it may not necessarily provide us with the optimal expressions. 7

we can obtain the following optimized next-state and output expressions. = 5 3 2 2 = 2 3 3 = 3 5 4 = 2 3 5 = 2 Z = 4 5 For this example, it appears that the optimization of the expressions does not introduce big advantages over the inspection method. 8