Section 6.8 Synthesis of Sequential Logic Page 1 of 8

Similar documents
Chapter 5 Synchronous Sequential Logic

More design examples, state assignment and reduction. Page 1

CSE Latches and Flip-flops Dr. Izadi. NOR gate property: A B Z Cross coupled NOR gates: S M S R Q M

ECE 301 Digital Electronics

1. a) For the circuit shown in figure 1.1, draw a truth table showing the output Q for all combinations of inputs A, B and C. [4] Figure 1.

Chapter 5 Sequential Circuits

Combinational / Sequential Logic

1. Convert the decimal number to binary, octal, and hexadecimal.

problem maximum score 1 28pts 2 10pts 3 10pts 4 15pts 5 14pts 6 12pts 7 11pts total 100pts

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute

Department of Electrical and Computer Engineering Mid-Term Examination Winter 2012

CHAPTER 4: Logic Circuits

DIGITAL TECHNICS. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute

ELCT201: DIGITAL LOGIC DESIGN

Chapter 5: Synchronous Sequential Logic

EE292: Fundamentals of ECE

Chapter 11 State Machine Design

MC9211 Computer Organization

Chapter. Synchronous Sequential Circuits

UNIT IV. Sequential circuit

Digital Design, Kyung Hee Univ. Chapter 5. Synchronous Sequential Logic

UNIT III. Combinational Circuit- Block Diagram. Sequential Circuit- Block Diagram

Chapter 4. Logic Design

Computer Architecture and Organization

CHAPTER 4: Logic Circuits

EECS 270 Midterm 2 Exam Closed book portion Fall 2014

Sequential Logic Circuits

Final Exam review: chapter 4 and 5. Supplement 3 and 4

WEEK 10. Sequential Circuits: Analysis and Design. Page 1

The reduction in the number of flip-flops in a sequential circuit is referred to as the state-reduction problem.

EXPERIMENT: 1. Graphic Symbol: OR: The output of OR gate is true when one of the inputs A and B or both the inputs are true.

Other Flip-Flops. Lecture 27 1

Logic and Computer Design Fundamentals. Chapter 7. Registers and Counters

D Latch (Transparent Latch)

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

EECS150 - Digital Design Lecture 19 - Finite State Machines Revisited

Chapter 3. Boolean Algebra and Digital Logic

Unit 11. Latches and Flip-Flops

MODULE 3. Combinational & Sequential logic

The word digital implies information in computers is represented by variables that take a limited number of discrete values.

Flip-Flops and Sequential Circuit Design

Decade Counters Mod-5 counter: Decade Counter:

Find the equivalent decimal value for the given value Other number system to decimal ( Sample)

Asynchronous (Ripple) Counters

YEDITEPE UNIVERSITY DEPARTMENT OF COMPUTER ENGINEERING. EXPERIMENT VIII: FLIP-FLOPS, COUNTERS 2014 Fall

Chapter 6. Flip-Flops and Simple Flip-Flop Applications

R13 SET - 1 '' ''' '' ' '''' Code No: RT21053

Sequential Design Basics

CS8803: Advanced Digital Design for Embedded Hardware

ME 515 Mechatronics. Introduction to Digital Electronics

SEMESTER ONE EXAMINATIONS 2002

Digital Logic Design I

Synchronous Sequential Logic

REPEAT EXAMINATIONS 2002

MODEL QUESTIONS WITH ANSWERS THIRD SEMESTER B.TECH DEGREE EXAMINATION DECEMBER CS 203: Switching Theory and Logic Design. Time: 3 Hrs Marks: 100

Digital Logic Design Sequential Circuits. Dr. Basem ElHalawany

R13. II B. Tech I Semester Regular Examinations, Jan DIGITAL LOGIC DESIGN (Com. to CSE, IT) PART-A

St. MARTIN S ENGINEERING COLLEGE

CPS311 Lecture: Sequential Circuits

Logic Design II (17.342) Spring Lecture Outline

CS6201 UNIT I PART-A. Develop or build the following Boolean function with NAND gate F(x,y,z)=(1,2,3,5,7).

RS flip-flop using NOR gate


UNIT 1: DIGITAL LOGICAL CIRCUITS What is Digital Computer? OR Explain the block diagram of digital computers.

EECS 270 Final Exam Spring 2012

1.b. Realize a 5-input NOR function using 2-input NOR gates only.

Vignana Bharathi Institute of Technology UNIT 4 DLD

EECS 270 Midterm Exam Spring 2011

Sequential Circuits. Output depends only and immediately on the inputs Have no memory (dependence on past values of the inputs)

Subject : EE6301 DIGITAL LOGIC CIRCUITS

Lecture 11: Synchronous Sequential Logic

CHAPTER1: Digital Logic Circuits

Analogue Versus Digital [5 M]

Solution to Digital Logic )What is the magnitude comparator? Design a logic circuit for 4 bit magnitude comparator and explain it,

NH 67, Karur Trichy Highways, Puliyur C.F, Karur District UNIT-III SEQUENTIAL CIRCUITS

Universidad Carlos III de Madrid Digital Electronics Exercises

Synchronous Sequential Logic

Switching Theory And Logic Design UNIT-IV SEQUENTIAL LOGIC CIRCUITS

Logic Design ( Part 3) Sequential Logic- Finite State Machines (Chapter 3)

Software Engineering 2DA4. Slides 9: Asynchronous Sequential Circuits

B.Tech CSE Sem. 3 15CS202 DIGITAL SYSTEM DESIGN (Regulations 2015) UNIT -IV

The basic logic gates are the inverter (or NOT gate), the AND gate, the OR gate and the exclusive-or gate (XOR). If you put an inverter in front of

Sequential Digital Design. Laboratory Manual. Experiment #3. Flip Flop Storage Elements

Introduction to Microprocessor & Digital Logic

EECS150 - Digital Design Lecture 15 Finite State Machines. Announcements

ELE2120 Digital Circuits and Systems. Tutorial Note 8

Module -5 Sequential Logic Design

ELCT201: DIGITAL LOGIC DESIGN

CS8803: Advanced Digital Design for Embedded Hardware

Introduction to Digital Logic Missouri S&T University CPE 2210 Exam 2 Logistics

Chapter 5 Synchronous Sequential Logic

Sequential Digital Design. Laboratory Manual. Experiment #7. Counters

Counter dan Register

ELEN Electronique numérique

Flip Flop. S-R Flip Flop. Sequential Circuits. Block diagram. Prepared by:- Anwar Bari

How to Design a Sequential Counter

Experiment 8 Introduction to Latches and Flip-Flops and registers

Chapter 5. Introduction

Principles of Computer Architecture. Appendix A: Digital Logic

INTRODUCTION TO SEQUENTIAL CIRCUITS

Transcription:

Section 6.8 Synthesis of Sequential Logic Page of 8 6.8 Synthesis of Sequential Logic Steps:. Given a description (usually in words), develop the state diagram. 2. Convert the state diagram to a next-state / output tables. 3. Minimize the number of states. 4. Encode inputs, states, and outputs. Assign different n-tuples of its flip-flop values to the states. 5. Generate the binary form of the next-state and output equations. 6. Choose memory elements (flip-flop types). 7. Derive excitation equations for each flip-flop input. 8. Optimize the logic implementation of the excitation and output equations. 9. Draw logic schematic that serves as a basis for the generation of a timing diagram.. Simulating the logic schematic.. Verify the functionality and timing. 6.9 FSM Model Capture Step. Generate a state diagram from a description. Example 6.4: Derive the state diagram for a modulo-3 up/down-counter. The counter has two inputs: count enable (C) and count direction (D). When C=, the counter will count in the direction specified by D, and it will stop counting when C=. The counter will count up when D= and down when D=. The counter has one output Y, which will be asserted when the counter reaches 2 while counting up or when it reaches while counting down. Solution: Requires at least 2 ffs, since it must remember three digits:,, and 2. Need two sequences: up sequence with three states (u, u, and u2) and down sequence with three states (d2, d, d). As long as CD =, the counter counts from u, u, u2 and returning to u. When CD =, the counter proceeds from d to d2 to d and returns to d. Need to account for the possibility that the counter might change direction while it is counting. Need to consider when the counter is disabled by a change of C from to. CD= CD=X CD=X CD=X CD= CD= u u u2 CD= CD= CD= CD= CD= CD= d CD= d CD= d2 CD=X CD=X CD=X Although this state diagram is complete, it does not contain the minimal number of states. CD=

Section 6.8 Synthesis of Sequential Logic Page 2 of 8 6. State Minimization The purpose of state minimization is to reduce the number of states in a sequential circuit so that the circuit requires fewer flip-flops. Reducing a FSM from six states originally to five states will not reduce the number of flip-flops. State minimization is based on the concept of the behavioral equivalence of FSMs. We say that two FSMs are equivalent if they produce the same sequence of output symbols for every sequence of input symbols. They may have different number of states and may also transition through a different sequence of states for every input sequence. We can reduce the number of states in the FSM by merging those states that are equivalent. State equivalence. Two states, s j and s k, in an FSM are said to be equivalent, s j s k, iff the following two conditions are true.. Both states s j and s k produce the same output symbol for every input symbol i: that is, h(s j, i) = h(s k, i). 2. Both states have equivalent next states for every input symbol i: that is, f(s j, i) = f(s k, i). State minimization procedure requires partitioning all the states in an FSM into equivalence classes and constructing the minimal-state FSM in which each state will represent one equivalence class. Example 6.5: Derive the minimal-state FSM for the modulo-3 counter. Solution: Step. Start with the next-state / output table obtained from the state diagram of example 6.4. Present Next State State CD = x CD = CD = u u / u / d2 / u u / u2 / d / u2 u2 / u / d / d d / u / d2 / d d / u2 / d / d2 d2 / u / d / (a) Initial state / output table Step 2. Determine the output values for each combination of input values and states. Output values u u u2 d d d2 CD=x (b) Output values Step 3. Combine states into groups in such a way that all states in the same group generate the same output symbol for each input symbol. Step 4. Determine the next state for each state in the groups and for every input symbol. Next State G ={u,d} G ={u,d} G 2 ={u2,d2} CD=x G G G G G 2 G 2 G G G 2 G 2 G G G 2 G 2 G G G G (c) Partitioning into equivalence classes. Step 3. The column labels. Step 4. The table entries.

Section 6.8 Synthesis of Sequential Logic Page 3 of 8 Step 5. Since each group represents a class of equivalent states, we can rename the groups (G, G, G 2 ) as states (s, s, s 2 ). Present Next State State CD = x CD = CD = s s / s / s2 / s s / s2 / s / s2 s2 / s / s / (d) Final next-state / output table

Section 6.8 Synthesis of Sequential Logic Page 4 of 8 6. State Encoding To determine how many binary variables are required to represent the states in the state table, and to assign a specific combination to each named state. The total number of states in a machine with n flip-flops is 2 n, so the number of flip-flops needed to code s states is log 2 s, the smallest integer greater than or equal to log 2 s. For example, a four-state FSM with states s, s, s2, and s3 could be implemented with two flip-flops that contain values,,, or. In this case, there would be 4! = 24 possible encodings of the four states to flip-flop values. The simplest assignment of s coded states to 2 n possible states is to use the first s binary integers in binary counting order. However, this does not always lead to the simplest excitation equations, output equations, and resulting logic circuit. # s s s2 s3 2 3 24 Three most popular heuristics: minimum bit change, prioritized adjacency, and one-hot encoding. Minimum bit change assigns Boolean values to the states in such a way that the total number of bit changes for all state transitions is minimized. In other words, if every arc in the state diagram has a weight that is equal to the number of bits by which the source and destination encodings differ, this strategy would select the one that minimizes the sum of all these weights. Example: 2 2 Encoding with 6 bit changes. Minimum-bit change encoding with only 4 bit changes. Prioritized adjacency assigns adjacent encodings, i.e. encodings which differ in one bit only, to all states that have (in the following order of priority): priority : a common destination i.e. states that have the same next state for a given input value. priority 2: a common source i.e. next states of the same state. priority 3: a common output i.e. states that have the same output value for the same input values. / s s / /, / / / s3 s2 Initial state diagram Priority : (s, s2) the input value of will move both states into the same state s3. Priority 2: (s, s2) they are both next states of the state s. Priority 3: (s, s), and (s2, s3) states s and s have the same output value for the same input value. / / /, / / / One possible encoding One-hot encoding uses redundant encoding in which one flip-flop is assigned to each state. i.e. each state is distinguishable by its own flip-flop having a value of while all others have a value of.

Section 6.8 Synthesis of Sequential Logic Page 5 of 8 Best encoding strategy. To determine the encoding with the minimum cost and delay, we need to: ) generate Karnaugh maps for next-state and output functions. 2) derive excitation equations from the next-state map. 3) derive output equations from the output functions map. 4) implement above equations using two-level NAND gates, ignoring a variable s true and complemented values. 5) calculate cost and delay. Example 6.7: Using the following next-state / output table for the modulo-3 counter and the three encoding schemes, find the best encoding scheme: Present Next State State CD = x CD = CD = s s / s / s2 / s s / s2 / s / s2 s2 / s / s / Next-state / output table Min bit change Prioritized Adj One-hot State Q Q Q Q Q Q s s s2 Possible state encodings ) Next-state map and output function map for the minimum bit change encoding strategy. CD QQ 4 5 2 3 5 4 X X X X X X X X 8 9 Q (next), Q (next) 3 2 7 6 CD QQ 4 5 2 3 5 4 X X X X Y 8 9 3 2 7 6 Ex. If current state is s= and the input CD=, then the next state is =s2. Thus, for the minimumbit change encoding, s= and s2=. So we have the entry in row and column. 2&3) Excitation and output equations. Q = Q C + Q CD + CD Q (next) (next) = Q C + Q CD + CD Y = Q CD + CD 4) Implementation using NAND gates..4.8 2.2 Cost (Q) = 24 Delay (Q) = 4..4.8 Q next.8 2.2.8 Q next.8 Cost (Q) = 24 Delay (Q) = 4. 2.2.4 Cost (Y) = 8 Delay (Y) = 3.6 Y 5) Cost and delay Encoding A Encoding B Encoding C Total cost 24+24+8 = 66 24+24+6 = 64 22+22+22+6 = 82 Maximum input delay max(4.,4.) = 4.ns max(4.,4.) = 4.ns max(3.6, 3.6, 3.6) = 3.6 Output delay 3.6ns 3.2ns 3.2ns Comment easy to encode least expensive fastest, most expensive

Section 6.8 Synthesis of Sequential Logic Page 6 of 8 6. Choice of Memory Elements We now choose the proper type of flip-flop for implementation of the state encodings. As we know, there are four types of flip-flops: Flip-Flop Usage Advantage Disadvantage counter-type circuits in which - requires fewer connections T the flip-flops must flip from than SR & JK to and back with great - better suited for VLSI frequency implementation D SR JK applications where input data must be stored for some time and then used later situations where different signals set and reset the flipflops whenever we need to combine the behavior of a T and an SR flip-flop - requires fewer connections than SR & JK - better suited for VLSI implementation - most useful - reduce the cost of the input logic - most useful - reduce the cost of the input logic - requires twice as many connections as T and D ffs - requires twice as many connections as T and D ffs Example 6.8: Given the modulo-3 counter with encoding A, select the type of flip-flop that will minimize the cost and/or delay of the input logic. Step. Write down the excitation tables for the various flip-flops. Following example is for the JK flip-flop. Start with the truth table. Expand to the characteristic table. Switch columns, combine the don t cares, and delete duplicate rows to form excitation table. J K Q next Q Q Q J K Q next JK characteristic table Q Q next J K X X X X JK excitation table The excitation tables for the SR, JK, T, & D flip-flops are summarized below: Q Q next S R J K T D X X X X X X Flip-Flop excitation table

Section 6.8 Synthesis of Sequential Logic Page 7 of 8 Step 2. Generate the implementation map. Take each pair of present and next states from the next-state map and replace their next-state values with the required input values from the excitation table. The next-state map from example 6.7 is duplicated here on the left: CD QQ 4 5 2 3 5 4 X X X X X X X X 8 9 3 2 7 6 Q (next), Q (next) Next-state map. e.g. From the next-state map, the entry for CD= and Q = is Q (next) =. Therefore, we look up Q Q (next) = in the excitation table to get JK=X. Thus, the implementation with JK ff for that entry is X. CD QQ xx xx 4 5 xx xx 2 3 5 4 xxxx xxxx xxxx xxxx 8 9 xx xx 3 2 xx xx 7 6 xx xx xx xx J, K J, K JK implementation map. Step 3. From the implementation map, we can derive minimal expressions for that flip-flop type. J K J K = Q CD + CD = Q CD + CD + Q C + CD D = C( + D )( Q = C( Q D) ( D ) = ( C + Q D + D ) = C = Q CD + CD = Q CD + CD + Q C + CD D = C( Q + D )( + D) = C( D) ( Q D ) = ( C + D + Q D ) = C + D) Step 4. Finally, cost and delay can be calculated from the equations obtained from step 3 above. Mapping The next step in a sequential logic synthesis would consist of mapping the input and output logic to the components in the given library.

Section 6.8 Synthesis of Sequential Logic Page 8 of 8 Schematic Drawing After mapping, we can draw the schematic to visualize all the counter s gates and connections. The following is the logic schematic for the JK implementation. C D Q' Q 2.4 J K Clk Q 4. Q'.8.4 y 2.2 clk Q Q' 2.4 J K Clk Q 4. Q' 6.3 Optimization and Timing The final step in the process of sequential synthesis consists of deriving a timing diagram from the schematic and the given gate and flip-flop delays.