Synchronous Sequential Logic Part I

Slides:



Advertisements
Similar presentations
State-machine structure (Mealy)
Advertisements

COE 202: Digital Logic Design Sequential Circuits Part 3
A. Abhari CPS2131 Sequential Circuits Most digital systems like digital watches, digital phones, digital computers, digital traffic light controllers and.
Princess Sumaya University
Sequential Circuits1 DIGITAL LOGIC DESIGN by Dr. Fenghui Yao Tennessee State University Department of Computer Science Nashville, TN.
Multiplexors Sequential Circuits and Finite State Machines Prof. Sin-Min Lee Department of Computer Science.
Module 12.  In Module 9, 10, 11, you have been introduced to examples of combinational logic circuits whereby the outputs are entirely dependent on the.
CSCE 211: Digital Logic Design. Chapter 6: Analysis of Sequential Systems.
Circuits require memory to store intermediate data
Sequential Circuit Analysis & Design Dr. Aiman H. El-Maleh Computer Engineering Department King Fahd University of Petroleum & Minerals Dr. Aiman H. El-Maleh.
CS 151 Digital Systems Design Lecture 21 Analyzing Sequential Circuits.
1 Lecture 23 More Sequential Circuits Analysis. 2 Analysis of Combinational Vs. Sequential Circuits °Combinational : Boolean Equations Truth Table Output.
Sequential Circuit Design
EECC341 - Shaaban #1 Lec # 14 Winter Clocked Synchronous State-Machines Such machines have the characteristics: –Sequential circuits designed.
Overview Sequential Circuit Design Specification Formulation
CS 151 Digital Systems Design Lecture 20 Sequential Circuits: Flip flops.
Sequential Circuit Analysis. 2 Synchronous vs. Asynch. Synchronous sequential circuit:  The behavior can be defined from knowledge of its signal at discrete.
Sequential Circuit Analysis. 2 Synchronous vs. Asynch. Synchronous sequential circuit:  the behavior can be defined from knowledge of its signal at discrete.
ECE 301 – Digital Electronics Introduction to Sequential Logic Circuits (aka. Finite State Machines) and FSM Analysis (Lecture #17)
ECE 331 – Digital Systems Design Introduction to Sequential Logic Circuits (aka. Finite State Machines) and FSM Analysis (Lecture #19)
1 Synchronous Sequential Circuit Analysis. 2 Synchronous Sequential Circuit State Memory – A set of n edge-triggered flip-flops that store the current.
Asynchronous and Synchronous Counters
Sequential Circuit  It is a type of logic circuit whose output depends not only on the present value of its input signals but on the past history of its.
So far, all of the logic circuits we have studied were basically based on the analysis and design of combinational digital circuits. The other major aspect.
Digital Logic Design CHAPTER 5 Sequential Logic. 2 Sequential Circuits Combinational circuits – The outputs are entirely dependent on the current inputs.
ETE Digital Electronics
Digital Computer Design Fundamental
COE 202: Digital Logic Design Sequential Circuits Part 1
Chapter 5 - Part Sequential Circuit Design Design Procedure  Specification  Formulation - Obtain a state diagram or state table  State Assignment.
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 9 Sequential.
(Sequential Logic Circuit)
Digital Design Lecture 10 Sequential Design. State Reduction Equivalent Circuits –Identical input sequence –Identical output sequence Equivalent States.
Synchronous Sequential Logic Part II
Chap 4. Sequential Circuits
Synchronous Sequential Logic Chapter 5. Digital Circuits Sequential Circuits Combinational circuits contains no memory elements the outputs depends.
Chap 4. Sequential Circuits
Introduction to Sequential Logic Design Flip-flops FSM Analysis.
Sequential Circuits. Two primary differences between combinational circuits and sequential circuits –Sequential circuits are synchronous (use a clock)
1 Lecture 22 Sequential Circuits Analysis. 2 Combinational vs. Sequential  Combinational Logic Circuit  Output is a function only of the present inputs.
Digital
Module : FSM Topic : types of FSM. Two types of FSM The instant of transition from the present to the next can be completely controlled by a clock; additionally,
Boolean Algebra and Logic Gates 1 Computer Engineering (Logic Circuits) Lec. # 10 (Sequential Logic Circuit) Dr. Tamer Samy Gaafar Dept. of Computer &
C HAPTER F IVE S YNCHRONOUS S EQUENTIAL L OGIC 1.
Princess Sumaya University
C HAPTER F IVE S YNCHRONOUS S EQUENTIAL L OGIC 1.
Synchronous Sequential Logic A digital system has combinational logic as well as sequential logic. The latter includes storage elements. feedback path.
Synchronous Sequential Logic Part I
Sahar Mosleh PageCalifornia State University San Marcos 1 More on Flip Flop State Table and State Diagram.
ENG241 Digital Design Week #7 Sequential Circuits (Part B)
Chapter5: Synchronous Sequential Logic – Part 1
Introduction to Sequential Logic Design Finite State-Machine Analysis.
CS151 Introduction to Digital Design Chapter 5: Sequential Circuits 5-1 : Sequential Circuit Definition 5-2: Latches 1Created by: Ms.Amany AlSaleh.
Synchronous Sequential Circuits by Dr. Amin Danial Asham.
State Machines (Closed Loop / Moore) Synch 2.1  Paul R. Godin Updated: January 2008.
Chapter 6 Analysis of Sequential Systems Sequential Memory Feedback.
TOPIC : Introduction to Sequential Circuits UNIT 1: Modeling and Simulation Module 4 : Modeling Sequential Circuits.
Week #7 Sequential Circuits (Part B)
Sequential Circuits Most digital systems like digital watches, digital phones, digital computers, digital traffic light controllers and so on require.
CISE204: Design of Digital Systems Lecture 18 : Sequential Circuits
Asynchronous Inputs of a Flip-Flop
ECE 301 – Digital Electronics
Assistant Prof. Fareena Saqib Florida Institute of Technology
ECE Digital logic Lecture 16: Synchronous Sequential Logic
Sequential logic circuits
INTRODUCTION TO LOGIC DESIGN Chapter 5 Synchronous Sequential Logic
MTE 202, Summer 2016 Digital Circuits Dr.-Ing. Saleh Hussin
Sequential circuit analysis: kale
Synchronous sequential
Synchronous Sequential
Sequential circuit analysis
Presentation transcript:

Synchronous Sequential Logic Part I Mantıksal Tasarım – BBM231 M. Önder Efe onderefe@cs.hacettepe.edu.tr

Sequential Logic Digital circuits we have learned, so far, have been combinational no memory, outputs are entirely defined by the “current” inputs However, many digital systems encountered everyday life are sequential (i.e. they have memory) the memory elements remember past inputs outputs of sequential circuits are not only dependent on the current input but also the state of the memory elements.

Sequential Circuits Model Combinational Circuit inputs outputs Memory Elements current state next state current state is a function of past inputs and initial state

Classification 1/2 Two types of sequential circuits Synchronous Signals affect the memory elements at discrete instants of time. Discrete instants of time requires synchronization. Synchronization is usually achieved through the use of a common clock. A “clock generator” is a device that generates a periodic train of pulses.

Classification 2/2 Synchronous Asynchronous The state of the memory elements are updated with the arrival of each pulse This type of logical circuit is also known as clocked sequential circuits. Asynchronous No clock behavior of an asynchronous sequential circuits depends upon the input signals at any instant of time and the order in which the inputs change. Memory elements in asynchronous circuits are regarded as time-delay elements

Clocked Sequential Circuits Memory elements are flip-flops which are logic devices, each of which is capable of storing one bit of information. Combinational Circuit Flip-Flops inputs outputs current state next clock

Clocked Sequential Circuits The outputs of a clocked sequential circuit can come from the combinational circuit, from the outputs of the flip-flops or both. The state of the flip-flops can change only during a clock pulse transition i.e. low-to-high and high-to-low clock edge When the clock maintains its value, the flip-flop output does not change The transition from one state to the next occurs at the clock edge.

Machine Machine( Inputs {X}, States {D}, Outputs {Z}, Output Function {F : XDZ}, Next State Function {G : XDD})

Representation with State Diagram x1 x2  xi xl d1 d2 di dj ,z dr-1 dr

Assign a Node to Each State xp/zp xk/zk di dj Machine is at state di, input xk comes, the next state will be di and the output is zk Machine is at state di, input xp comes, the next state will be dj and the output is zp

Notation Let Ik be an input sequence with length equals to k, i.e. Ik = x1x2…xk f(Ik,di) = z1z2…zk is an output sequence g(Ik,di) = di1di2…dik is a state sequence di Ik dik Follower of di after the input sequence Ik

Example - Fill out the rest 1 A E, 0 D, 1 B F, 0 D, 0 C B, 1 D B, 0 E C, 0 F, 1 F D C B F

Example Let I5=10110, find g(I5,C) and f(I5,C) I5 follower of C is F 1 A E, 0 D, 1 B F, 0 D, 0 C B, 1 D B, 0 E C, 0 F, 1 F I5 1 g(I5,C) C B F f(I5,C)

D Flip-Flop Characteristic equation Q(t+1) = D D Q(t+1) 1 D Q D FF D Q clk C Positive edge-triggered D Flip-Flop Characteristic equation Q(t+1) = D D Q(t+1) 1 Characteristic Table

Timing Diagram of D Flip-Flop

Other Flip-Flops D flip-flop is the most common since it requires the fewest number of gates to construct. Two other widely used flip-flops JK flip-flops T flip-flops Three FF operations Set Reset Complement

JK Flip-Flops Characteristic equation Q(t+1) = JQ’(t) + K’Q(t) J K next state Q(t) no change 1 Reset Set Q’(t) Complement J Q C K Characteristic Table Characteristic equation Q(t+1) = JQ’(t) + K’Q(t)

T (Toggle) Flip-Flop Complementing flip-flop Characteristic equation T Q(t+1) next state Q(t) no change 1 Q’(t) Complement T Q C Characteristic Table Characteristic equation Q(t+1) = T T J Q D Q C C K

Characteristic Equations The logical properties of a flip-flop can be expressed algebraically using characteristic equations D flip-flop Q(t+1) = D JK flip-flop Q(t+1) = JQ’(t) + K’Q(t) T flip-flop Q(t+1) = Q(t)  T

What if we have Q(t+1) and Q(t), and looking for J and K values? Q(t+1) Q(t)=0 X Q(t)=1 J= Q(t+1)’ Q(t)=1 X Q(t)=0 K= Q(t)Q(t+1) 00 01 11 10 0,X 1,X X,0 X,1 J,K

What if we have Q(t+1) and Q(t), and looking for D value? Q(t)Q(t+1) 00 01 11 10 1 D= Q(t+1)

What if we have Q(t+1) and Q(t), and looking for T value? Q(t)Q(t+1) 00 01 11 10 1 T= Q(t+1)  Q(t)

Asynchronous Inputs of Flip-Flops They are used to force the flip-flop to a particular state independent of clock “Preset” (direct set) set FF state to 1 “Clear” (direct reset) set FF state to 0 They are especially useful at startup. In digital circuits when the power is turned on, the state of flip-flops are unknown. Asynchronous inputs are used to bring all flip-flops to a known “starting” state prior to clock operation.

Asynchronous Inputs reset C D Q Q’ 1 X  data D Q C R reset clk D Q reset D Q C data reset R reset C D Q Q’ 1 X  Starting State

Analysis of Clocked Sequential Circuits Goal: to determine the behavior of clocked sequential circuits “Behavior” is determined from Inputs Outputs State of the flip-flops We have to obtain Boolean expressions for output and next state output & state equations (state) table (state) diagram

Analyze the circuit

Run it and check the timing diagram

State Equations Also known as “transition equations” Example specify the next state as a function of the present state and inputs Example D Q C A A’ B B’ x y clk A(t+1) B(t+1)

Output and State Equations B(t+1) = y = A(t+1) D Q A x C A’ B(t+1) D Q B C B’ y clk

Flip Flop Input Equations Flip-Flop input (excitation) equations Same as the state equations in D flip-flops

Example: State (Transition) Table B(t+1) = y = y B A x output Next state input Present state 1 1 1 1 A sequential circuit with m FFs and n inputs needs 2m+n rows in the transition table

Example: State Diagram Present state input Next state output A B x y 1 1/1 0/0 11 00 0/0 0/0 1/0 0/0 1/0 01 10 1/0 What is this circuit doing? State diagram provides the same information as state table

Analysis with JK Flip-Flops For a D flip-flop, the state equation is the same as the flip-flop input equation Q(t+1) = D For JK flip-flops, situation is different Goal is to find state equations Method determine flip-flop input equations List the binary values of each input equation Use the corresponding flip-flop characteristic table to determine the next state values in the state table

Example: Analysis with JK FFs JA KA JB KB x Q A J C K J D Q B Q clk C C 1 K y Flip-flop input equations JA = and KA = JB = and KB =

Example: Analysis with JK FFs JA = Bx and KA = x’+B JB = x and KB = 1 KB JB KA JA B A x FF inputs next state input present State 1 1 1 1 1

Example: Analysis with JK FFs Characteristic equations A(t+1) = JAA’ + K’AA B(t+1) = JBB’ + K’BB Input equations JA = Bx and KA = x’+B JB = x and KB = 1 State equations A(t+1) = = B(t+1) =

State Diagram 1/1 0/0 11 00 0/0 0/0 1/0 0/0 1/0 01 10 1/0 Present state input Next state output A B x y 1 00 0/0 0/0 1/0 0/0 1/0 01 10 1/0 What is the circuit doing?

Analysis with T Flip-Flops Method is the same Example TA = TB = TA TB T Q C D A B x clk reset y0 y1 y1 = A y0 = B

Example: Analysis with T Flip-Flops Characteristic equation A(t+1) = TA  A B(t+1) = TB  B Input equations TA = xB TB = x Output equations y1 = A y0 = B State equations A(t+1) = B(t+1) =

State Table & Diagram Present state input Next state output A B x y1 A(t+1) = xB  A B(t+1) = x  B y1 = A; y0 = B 00/00 1 01/01 Present state input Next state output A B x y1 y0 1 1 1 10/10 1 11/11

Mealy and Moore Models There are two models for sequential circuits They differ in the way the outputs are generated Mealy: output is a function of both present states and inputs output is a function of present state only

Example: Mealy and Moore Machines Q C x y S clock reset Mealy machine External inputs, x and y, are asynchronous Thus, outputs may have momentary (incorrect) values Inputs must be synchronized with clocks Outputs must be sampled only during clock edges

Example: Moore Machines T Q C D A B x clk reset y Outputs are already synchronized with clock. They change synchronously with the clock edge.

Design Example - 1 Implement the following state diagram with D FFs. 0/0 1 1/0 1/1 0/1

Design Example - 1 Implement the following state diagram with D FFs. Q(t) Q(t+1) D Z 1 1/0 0/0 1/1 1 0/1

Design Example - 1 Implement the following state diagram with D FFs. Q(t) Q(t+1) D Z 1 1/0 0/0 1/1 1 0/1

Design Example - 1 Implement the following state diagram with D FFs. Q(t) Q(t+1) D Z 1 1/0 0/0 1/1 1 0/1 x D Q Z clk

Design Example - 2 Design a sequential circuit that counts up (00, 01, 10, 11,00,…) when x=1, and counts down (00,11,10,01,00,…) when x=0. Use JK FFs.

Design Example - 2 00 01 10 11 x=1 x=0 Design a sequential circuit that counts up (00, 01, 10, 11,00,…) when x=1, and counts down (00,11,10,01,00,…) when x=0. Use JK FFs.

Design Example - 2 00 01 11 10 x=1 x=1 x=0 x=1 x=1 x A B A(t+1) B(t+1) JA KA JB KB 1 x=1 00 01 x=1 x=0 x=1 11 10 x=1

Design Example - 2 00 01 11 10 Q(t+1) Q(t)=0 J= X Q(t)=1 B A(t+1) B(t+1) JA KA JB KB 1 X x=1 00 01 x=1 x=0 x=1 11 10 x=1 Q(t+1) Q(t)=0 X Q(t)=1 J= Q(t+1)’ Q(t)=1 X Q(t)=0 K=

Design Example - 2 00 01 11 10 Q(t+1) Q(t)=0 J= X Q(t)=1 B A(t+1) B(t+1) JA KA JB KB 1 X x=1 00 01 x=1 x=0 x=1 11 10 x=1 Q(t+1) Q(t)=0 X Q(t)=1 J= Q(t+1)’ Q(t)=1 X Q(t)=0 K=

Design Example - 2 00 01 11 10 Q(t+1) Q(t)=0 J= X Q(t)=1 B A(t+1) B(t+1) JA KA JB KB 1 X x=1 00 01 x=1 x=0 x=1 11 10 x=1 Q(t+1) Q(t)=0 X Q(t)=1 J= Q(t+1)’ Q(t)=1 X Q(t)=0 K=

Design Example - 2 00 01 11 10 Q(t+1) Q(t)=0 J= X Q(t)=1 B A(t+1) B(t+1) JA KA JB KB 1 X x=1 00 01 x=1 x=0 x=1 11 10 x=1 Q(t+1) Q(t)=0 X Q(t)=1 J= Q(t+1)’ Q(t)=1 X Q(t)=0 K=

Design Example - 2 00 01 11 10 1 X X 1 x=1 x=1 x=0 x=1 x=1 x A B A(t+1) B(t+1) JA KA JB KB 1 X x=1 00 01 x=1 x=0 x=1 11 10 x=1 AB x 00 01 11 10 1 X AB x 00 01 11 10 X 1

Design Example - 2 JA=xB+x’B’ KA=xB+x’B’ JB=1 KB=1 Draw the circuit

Design Example - 3

Design Example - 3 000 001 010 011 100 101

Design Example - 3 Q(t+1) Q(t)=0 X Q(t)=1 J= Q(t+1)’ Q(t)=1 X Q(t)=0 A(t) B(t) C(t) A (t+1) B C z1 z2 z3 z4 z5 z6 JA KA JB KB JC KC 1   Q(t+1) Q(t)=0 X Q(t)=1 J= Q(t+1)’ Q(t)=1 X Q(t)=0 K= 000 001 010 011 100 101

Design Example - 3 Q(t+1) Q(t)=0 X Q(t)=1 J= Q(t+1)’ Q(t)=1 X Q(t)=0 A(t) B(t) C(t) A (t+1) B C z1 z2 z3 z4 z5 z6 JA KA JB KB JC KC 1   Q(t+1) Q(t)=0 X Q(t)=1 J= Q(t+1)’ Q(t)=1 X Q(t)=0 K= 000 001 010 011 100 101

Design Example - 3 Q(t+1) Q(t)=0 X Q(t)=1 J= Q(t+1)’ Q(t)=1 X Q(t)=0 A(t) B(t) C(t) A (t+1) B C z1 z2 z3 z4 z5 z6 JA KA JB KB JC KC 1   X  X Q(t+1) Q(t)=0 X Q(t)=1 J= Q(t+1)’ Q(t)=1 X Q(t)=0 K= 000 001 010 011 100 101

Design Example - 3 Q(t+1) Q(t)=0 X Q(t)=1 J= Q(t+1)’ Q(t)=1 X Q(t)=0 A(t) B(t) C(t) A (t+1) B C z1 z2 z3 z4 z5 z6 JA KA JB KB JC KC 1   X  X  0  1 Q(t+1) Q(t)=0 X Q(t)=1 J= Q(t+1)’ Q(t)=1 X Q(t)=0 K= 000 001 010 011 100 101

Design Example - 3 Q(t+1) Q(t)=0 X Q(t)=1 J= Q(t+1)’ Q(t)=1 X Q(t)=0 A(t) B(t) C(t) A (t+1) B C z1 z2 z3 z4 z5 z6 JA KA JB KB JC KC 1  X X  0  1 Q(t+1) Q(t)=0 X Q(t)=1 J= Q(t+1)’ Q(t)=1 X Q(t)=0 K= 000 001 010 011 100 101

Design Example - 3 1 X X JA=BC KA=C A(t) B(t) C(t) z1 z2 z3 z4 z5 z6 JB KB JC KC 1  X X  0  1 BC A 00 01 11 10 1 X BC A 00 01 11 10 X 1 JA=BC KA=C

Design Example - 3 1 X X 1 JB=A’C KB=C A(t) B(t) C(t) z1 z2 z3 z4 z5 JA KA JB KB JC KC 1  X X  0  1 BC A 00 01 11 10 1 X BC A 00 01 11 10 X 1 JB=A’C KB=C

Design Example - 3 1 X X 1 JC=1 KC=1 A(t) B(t) C(t) z1 z2 z3 z4 z5 z6 JA KA JB KB JC KC 1  X X  0  1 BC A 00 01 11 10 1 X BC A 00 01 11 10 X 1 JC=1 KC=1

Design Example - 3 JA QA C KA JB QB C KB JC QC C KC

Design Example - 3 JA=BC KA=C JB=A’C KB=C JC=1 KC=1 A(t) B(t) C(t) z1 1 JA=BC KA=C JB=A’C KB=C JC=1 KC=1

Design Example - 3 JA=BC A(t+1)=BCA’+C’A KA=C JB=A’C B(t+1)=A’CB’+C’B C(t) A (t+1) B C z1 z2 z3 z4 z5 z6 JA KA JB KB JC KC 1 JA=BC A(t+1)=BCA’+C’A KA=C JB=A’C B(t+1)=A’CB’+C’B KB=C JC=1 C(t+1)=C’ KC=1

Design Example - 3 000 001 010 011 100 101 111 110 A(t) B(t) C(t) z1 JA KA JB KB JC KC 1 000 001 010 011 100 101 111 110

Design Example - 3 Repeat your design with D FFs

Design Example - 3 A(t+1)=BCA’+C’A = DA B(t+1)=A’CB’+C’B = DB C(t) A (t+1) B C z1 z2 z3 z4 z5 z6 DA DB DC 1 A(t+1)=BCA’+C’A = DA B(t+1)=A’CB’+C’B = DB C(t+1)=C’ = DC

Design Example - 4 Design a logic circuit that detects the sequence 1011 and outputs 1 in that case, 0 otherwise.

Design Example - 4 1/1 0/0 1/0 0/0 1/0 I.C. 1 10 101 0/0 1/0 0/0

Design Example - 4 1/1 0/0 1/0 0/0 1/0 00 01 10 11 0/0 1/0 0/0

Design Example - 4 x(t) A(t) B(t) A (t+1) B Z JA KA JB KB   1

Design Example - 4 x(t) A(t) B(t) A (t+1) B Z JA KA JB KB X  X 1  1  0

Design Example - 4 1 X X 1 X X 1 JA=x’B KA=xB+x’B’ JB=x KB=x’ AB x 00 01 11 10 1 X AB x 00 01 11 10 X 1 JA=x’B KA=xB+x’B’ AB x 00 01 11 10 X 1 AB x 00 01 11 10 X 1 JB=x KB=x’

Design Example - 4 JA QA C KA JB QB C KB

Design Example - 4 DA QA DB QB C C