`COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES Concordia University

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

Chapter 5: Synchronous Sequential Logic

ECE 25 Introduction to Digital Design. Chapter 5 Sequential Circuits ( ) Part 1 Storage Elements and Sequential Circuit Analysis

D Latch (Transparent Latch)

Chapter 5 Sequential Circuits

Chapter 5 Sequential Circuits

Chapter 5 Synchronous Sequential Logic

CHAPTER 4: Logic Circuits

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

Synchronous Sequential Logic. Chapter 5

CHAPTER 4: Logic Circuits

Chapter 3 Unit Combinational

Digital Logic Design Sequential Circuits. Dr. Basem ElHalawany

Sequential Logic Circuits

Sequential Circuits: Latches & Flip-Flops

Chapter 5 Sequential Systems. Introduction

Problems with D-Latch

Digital Logic Design I

Chapter. Synchronous Sequential Circuits

Flip-Flops. Because of this the state of the latch may keep changing in circuits with feedback as long as the clock pulse remains active.

Part II. Chapter2: Synchronous Sequential Logic

Unit 11. Latches and Flip-Flops

ELCT201: DIGITAL LOGIC DESIGN

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

Lecture 8: Sequential Logic

Synchronous Sequential Logic

Sequential Circuits. Introduction to Digital Logic. Course Outline. Overview. Introduction to Digital Logic. Introduction to Sequential Circuits

Chapter 5 Synchronous Sequential Logic

Sequential Logic. E&CE 223 Digital Circuits and Systems (A. Kennings) Page 1

Other Flip-Flops. Lecture 27 1

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

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

Overview of Chapter 4

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

Chapter 5 Sequential Circuits

Synchronous Sequential Logic

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

Synchronous Sequential Logic

Engr354: Digital Logic Circuits

ELCT201: DIGITAL LOGIC DESIGN

Chapter 6 Sequential Circuits

Spring 2017 EE 3613: Computer Organization Chapter 5: The Processor: Datapath & Control - 1

Introduction to Sequential Circuits

Synchronous Sequential Logic

Logic Design. Flip Flops, Registers and Counters

CHAPTER1: Digital Logic Circuits

EE292: Fundamentals of ECE

6. Sequential Logic Flip-Flops

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

RS flip-flop using NOR gate

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

MC9211 Computer Organization

CPS311 Lecture: Sequential Circuits

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

Lecture 11: Synchronous Sequential Logic

Combinational / Sequential Logic

Sequential Circuits. Building Block: Flip-Flops

Synchronous Sequential Logic

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

Chapter 8 Sequential Circuits

Flip-Flops and Sequential Circuit Design

LATCHES & FLIP-FLOP. Chapter 7

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

IT T35 Digital system desigm y - ii /s - iii

Experiment 8 Introduction to Latches and Flip-Flops and registers

Page 1. Some Definitions. Chapter 3: Sequential Logic. Sequential Logic. The Combinational Logic Unit. A NOR Gate with a Lumped Delay

Sri Vidya College of Engineering And Technology. Virudhunagar Department of Electrical and Electronics Engineering

RS flip-flop using NOR gate

Asynchronous (Ripple) Counters

ECE 341. Lecture # 2

Digital Circuits ECS 371

CS T34-DIGITAL SYSTEM DESIGN Y2/S3

Analysis of Clocked Sequential Circuits

Chapter 9 Counters. Clock Edge Output Q 2 Q 1 Q

Review of digital electronics. Storage units Sequential circuits Counters Shifters

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

EMT 125 Digital Electronic Principles I CHAPTER 6 : FLIP-FLOP

Unit 9 Latches and Flip-Flops. Dept. of Electrical and Computer Eng., NCTU 1

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

Course Administration

Vignana Bharathi Institute of Technology UNIT 4 DLD

Digital Logic Design ENEE x. Lecture 19

CHAPTER 1 LATCHES & FLIP-FLOPS

Combinational vs Sequential

ECE 3401 Lecture 12. Sequential Circuits (II)

Clocks. Sequential Logic. A clock is a free-running signal with a cycle time.

UNIT-3: SEQUENTIAL LOGIC CIRCUITS

L4: Sequential Building Blocks (Flip-flops, Latches and Registers)

UNIT IV. Sequential circuit

Last time, we saw how latches can be used as memory in a circuit

The outputs are formed by a combinational logic function of the inputs to the circuit or the values stored in the flip-flops (or both).

(CSC-3501) Lecture 7 (07 Feb 2008) Seung-Jong Park (Jay) CSC S.J. Park. Announcement

Digital Circuit And Logic Design I. Lecture 8

Digital Circuit And Logic Design I

Chapter 5. Introduction

ELCT201: DIGITAL LOGIC DESIGN

Logic Design II (17.342) Spring Lecture Outline

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

Chapter 4. Logic Design

Chapter 3. Boolean Algebra and Digital Logic

Transcription:

`OEN 32 IGITL SYSTEMS ESIGN - LETURE NOTES oncordia University hapter 5: Synchronous Sequential Logic NOTE: For more eamples and detailed description of the material in the lecture notes, please refer to the main tetbook: igital esign 3rd Edition, y Morris Mano, Publisher Prentice Hall, 4th Edition ll eamples used in the lecture notes are from the above reference. Sequential ircuits - sequential circuit consists of a combinational circuit and a feedback through the storage elements in the circuit. Inputs ombinational ircuit Outputs Memory Element - Sequential circuits can be categorized as being synchronous or asynchronous. - synchronous sequential circuit usually has a clock pulse (clocked sequential circuits). - Flip-flops are storage elements which are used in clocked sequential circuits. - Each flip-flop can store one bit. - synchronous clocked sequential circuit is shown below: Inputs ombinational ircuit lock Pulse Outputs Memory Element lock Pulse Latches - Latches are the basic types of flip-flops. - The SR latch is a latch with two inputs S (set) and R (reset), and an output Q. - Q = (Q = ) represents the set state and Q = (Q = ) represents the reset state. Lecture Notes Prepared by mir G. ghdam

2 - The SR latch can be implemented by NOR gates or NN gates. R Q S R Q Q (Set state) S Q (fter S=, R=) (Reset state) (fter S=, R=) (Undefined) - ssume S= and R= in the above circuit. Then the output of the bottom gate (Q ) is definitely (note that the output of a NOR gate is zero if at least one of its inputs is ). This means that the output of the top gate (Q) is, as both of its inputs are. This is called the set state. - ssume now that right after the above state, S becomes. Since from the previous state we have Q=, hence the output of the bottom gate stays at and consequently the output of the top gate also stays at, as both of its inputs are equal to. - Similarly, if S= and R=, then we will have Q= and Q =, which is the reset state (this can be concluded from the symmetrical configuration of the circuit as well). gain, if R becomes right after the reset state, the outputs will remain unchanged (Q= and Q =). - fter any change in the input, it has to go to zero so that the circuit becomes ready for the net state. - In undefined state the net output is not predictable when both inputs go back to zero (it depends whether the S or R input goes to zero first). - NN gate implementation: Lecture Notes Prepared by mir G. ghdam

3 S R Q Q S R Q Q (fter S=, R=) (fter S=, R=) (Undefined) - ssume S= and R= in the above circuit. Then the output of the top gate (Q) is definitely (note that the output of a NN gate is if at least one of its inputs is ). This means that the output of the bottom gate (Q ) is, as both of its inputs are. - ssume now that right after the above state, S becomes. Since from the previous state we have Q=, hence the output of the bottom gate stays at and consequently the output of the top gate also stays at, as one of its inputs is equal to. - One should make sure that both inputs are not connected to zero simultaneously. - SR latch with control input is shown below: S (ontrol input) R Q Q S R Net state of Q No change No change Q= (Reset state) Q= (Set state) Undefined - latch (data latch) is an element which holds data in its internal storage and the output becomes equal to each time enables the circuit (by changing to ). Lecture Notes Prepared by mir G. ghdam

4 Q Q Net State of Q No change Q= (Reset state) Q= (Set state) - latch is also called a transparent latch. - lock diagram of latches are shown below. S R SR latch (NOR gate implementation) S R SR latch (NN gate implementation) latch Flip-Flops - The problem with the latch is that it responds to a change during a positive level (or a negative level) of a clock pulse but in a sequential circuit we need to trigger the element only at a signal transition instant. Positive-edge response Negative-edge response - Two different ways to construct a flip-flop from latches are shown below. Lecture Notes Prepared by mir G. ghdam

5. X latch (master) Y latch (slave) Q LK - The value of is being transferred to Y during LK = but it is being transferred to Q only when LK changes from to. - One can change the position of the inverter to make the circuit a positive-edge triggered flip-flop. LK X Y Q 2. More efficient construction (using three SR latches) Y S Q LK R Q Z Lecture Notes Prepared by mir G. ghdam

6 - S and R are equal to while LK = (which causes no change in the output). - If = when LK becomes, R changes to (Since S =, Z =, LK = ) and this resets the flip-flop, making Q =. - Now if changes its value (while LK = ), since R =, we will still have Z = and it will not change the value of R. - When clock goes to, R goes to which is a normal condition (as S is still ), causing no change in the output. - Now if = when LK goes to, it makes Z = ( =, R = ) and it causes Y = and since LK =, Y =, so S becomes, and this sets the output (S =, R = ) - ny change in while LK = does not affect the output. - Setup time is the minimum time the input is required to stay at a constant value prior to the net clock change. - Hold time is the minimum time the input is required to stay unchanged after the clock change. - Propagation delay is the interval between the trigger edge and the stabilization of the output to a new state. - The symbols for flip-flop are shown in the following figures. Positive-edge triggered flip-flop Negative-edge triggered flip-flop - There are three operations that can be performed with a flip-flop: set, reset, or complement the output. JK Flip-Flop: - The JK flip-flop can be derived from the flip-flop using the oolean function = J. Q + K. Q as follows: Lecture Notes Prepared by mir G. ghdam

7 J K LK Q Q - The symbol for JK flip flop is shown in the following figure. J K - ll three operations set, reset, and complement can be performed by a JK flip-flop. - When J= and K=, then =Q, which implies that the output remains unchanged (after the net clock edge). - When J= and K=, then =, which implies that the output is reset (after the net clock edge). - When J= and K=, then =, which implies that the output is set (after the net clock edge). - When J= and K=, then =Q, which implies that the output is complemented (after the net clock edge). - The characteristic table and the characteristic equation describe the operation of a flip-flop through a table and an algebraic equation, respectively. - The characteristic table of the flip-flop and the JK flip-flop are as follows: Net state (one clock later) Q(t+) J K Q(t+) Q(t) No change Reset Set Q (t) ompliment Lecture Notes Prepared by mir G. ghdam

8 - The characteristic equation of the flip-flop and the JK flip-flop are as follows: Q(t+)=, Q(t+)=J.Q (t)+k.q(t) T Flip-Flop - The T (toggle) flip-flop can be derived from the flip-flop using the oolean function = T Q = T. Q + T. Q as follows. T Q Q - It can also be derived from a JK flip-flop as follows. T J K Q Q - When T=, then is equal to Q, which means that the output remains unchanged after the net clock edge. - When T=, then becomes equal to Q, which implies that the output is complemented after the net clock edge. - The characteristic equation of the T flip-flop can be obtained as follows. = T Q = T. Q' + T '. Q Q( t + ) = T. Q' + T '. Q - The characteristic table of the T flip-flop is given below. T Q(t+) Q(t) No change Q (t) ompliment - The graphic symbol of the T flip-flop is as follows. T Lecture Notes Prepared by mir G. ghdam

9 - irect inputs: Sometimes asynchronous inputs are used to change the state of a flipflop to a preset (direct set) or clear (direct reset) state at any desired time (regardless of clock pulses). Preset y LK S R Q Q lear - Start with S = R = (normal condition). ssume that lear =. Then Q =, and since S = and Preset =, it resets the flip-flop (Q = ). - Start again with S = R = (normal condition). ssume now that Preset =. Then Q will be equal to, and since R = and lear =, thus Q goes to zero, which sets the flip-flop (Q = ). - Thus, if lear is zero, the flip-flop will be cleared to zero, i.e. Q =, and if Preset is equal to, it forces the flip-flop into Q =. - In general case, we will have the following representation of the flip-flop with direct reset ( represents the positive edge of the LK). ata LK Reset R Q Q Reset Q Q X X Lecture Notes Prepared by mir G. ghdam

nalysis of locked Sequential ircuits - clocked sequential circuit can be analyzed by using: (i) The state equation obtained by replacing flip-flop input equations in its characteristic equation, or (ii) a state table. - nalysis with flip-flops: Write the oolean epression for each flip-flop input, which is, in fact, the flip-flop output right after the net active clock edge. - Eample: LK y - State equation can be written as: ( t + ) = ( t + ) = ( t). ( t) + ( t). ( t) ( t). ( t) - or simply: ( t + ) = ( t + ) =. +.. - The output is given by: y ( t) = [ ( t) + ( t)]. ( t) - or simply: y = [ + ]. - State table or transition table lists all possible binary combinations of present state and inputs. Lecture Notes Prepared by mir G. ghdam

m flip-flops n inputs.+... +. 2 m+ n rows Present state Input Net state Output y - For some applications (like state reduction) we may use the following form of the state table: Net state Output Present state = = = = y y - State diagram: Present state Net state Input/output - The state diagram follows directly from the state table. - For the previous eample: Lecture Notes Prepared by mir G. ghdam

2 / / / / / / / / Fig. 5. - Flip-flop input equations or ecitation equations (for a circuit with flip-flops, it is the same as the state equation): =. +. =. - Each interconnection with the corresponding initial and final states can be built by using a combinational circuit. - Eample (analysis with flip-flop): In the circuit below, we have = y y LK Present state inputs Net state y Lecture Notes Prepared by mir G. ghdam

3 - When the output is not specified, we assume that the output is the output of the flipflop.,,,, - nalysis with JK flip-flops: It is desired to find the state table (or transition table), from which one can easily obtain the state diagram. To this end, one can find the flipflop input equations (from the combination circuit which generates the input signals) and replace them in the characteristic equation to find state equation (or transition equation). Then, net state and also output(s) can be obtained for different values of the input. lternatively, one can add some additional columns to the transition table (one for each flip-flop input) and find the elements of these added columns for different values of the input (and present state). The values of the net state can then be obtained directly from the flip-flop inputs. - Eample: J K J K LK J J = = K K =. = =. +. (5.) Lecture Notes Prepared by mir G. ghdam

4 Present state Input Net State Flip-Flop inputs J K J K These are obtained from the boolean epressions (just like ordinary truth table) based on the present states. Note that this is not part of the table. - One can also find the net state from the state equations by substituting the input equations into the flip-flop characteristic equations, as pointed out earlier. - haracteristic equation for the JK flip-flop is: ( t + ) = J ( t + ) = J. + K. + K - Substituting the flip-flop input equations given in (5.) into the above equations: state equations : ' '.. ( t + ) =. + (. ). =. +. +. ( t + ) =. + ( ). =. +.. +.. - Net states in the table can now be obtained directly (no need for the flip-flop inputs). Fig. 5.2 Lecture Notes Prepared by mir G. ghdam

5 - nalysis with T flip-flops: Similar to the analysis with JK flip-flops, the state table can be obtained by using state equation, or by adding flip-flop input columns to the table. - Eample: y T R T R T T LK reset =. = y =. - haracteristic equations: ( t + ) = T ( t + ) = T - Substituting the input equations into the characteristic equations: ( t + ) = (. ). + (. ). =. +. +.. ( t + ) = Present state Input Net State Output y Lecture Notes Prepared by mir G. ghdam

6 - The state diagram will be: / / / / Fig. 5.3 - The output is only a function of current state, not the input, and that is why the output is written inside state circles. - Mealy model: Mealy model is the one that the output is a function of both input and current states. For eample Figure 5.. - Moore model: Moore model is the one that the output is a function of the present state only, For eample, Figures 5.2 and 5.3. - If the output(s) are not shown in the circuits, the flip-flop states are the outputs. - Note that since in a Moore model the outputs are functions of only flip-flop states, the outputs are synchronized with the clock. - However, in a Mealy model, the outputs may change asynchronously. This can occur when the inputs change during the constant value of the clock cycle. - In a Mealy model momentary false values may occur in the output as a result of the flip-flop delays. State Reduction and ssignment - The number of states reduces by reducing the number of flip-flops. - Eample: Lecture Notes Prepared by mir G. ghdam

7 / a / / / / b / c / / g / d / / / e / f / - In Particular, for the input sequence and assuming that the initial state is a, we will have: State a a b c d e f f g f g a Input Output - State reduction means to reduce the number of states in a sequential circuit with an identical input-output relationship. - The easiest way of state reduction is through state table as follows: Lecture Notes Prepared by mir G. ghdam

8 Present Net state Output state = = = = a a b b c d c a d d e f e a f f g f g a f - Two states are equivalent if for identical inputs they give eactly the same output and result in a transition to the same state (or an equivalent state). - If two states are equivalent, one of them can be removed without changing the inputoutput operation of the circuit. - We have to find a pair of equivalent states and delete one. - States g and e are equivalent and we can delete g and replace it with e. Present Net state Output state = = = = a a b b c d c a d d e f e a f f e f - Now we can see that d and f also have similar rows associated with them. - Reduced table: Lecture Notes Prepared by mir G. ghdam

9 Present Net state Output state = = = = a a b b c d c a d d e d e a d / / / a / e / b / / / c / d / - Reducing the number of states does not necessarily mean a circuit with fewer gates and/or flip-flops. - For the above reduced diagram and the input sequence that was given before, we will have: a a b c d e d d e d e a - Note that state reduction in general may lead to a circuit with more gates than the original system (for the combinational circuit which provides inputs to the flip-flops). Lecture Notes Prepared by mir G. ghdam

2 - State assignment using coded binary values is required for designing a sequential circuit. - The number of bits (n) in the code must be such that 2 n m, where m is the number of states. state ssignement inary ssignement 2 Gray code ssignement 3 One-hot a b c d e - Using binary assignment, the previous simplified state table will be: Present Net state Output state = = = = esign Procedure. Translating the design specifications to the state diagram 2. State reduction 3. ssigning binary values to the states 4. Obtaining binary coded state table 5. hoosing the type of flip-flop 6. eriving the simplified flip-flop input equations and output equations 7. rawing the logic diagram Lecture Notes Prepared by mir G. ghdam

2 - Eample: esign a circuit that detects three or more consecutive s in a string of bits coming through an input line. S / S / S 3 / S 2 / - Note that this is a Moore model as the output only depends on the states. Synthesis using Flip-Flops - We have to find the state table first. Present state Input Net State Output y - Find the flip-flop input equations: ( t + ) = ( t + ) = y(,, ) = (,, ) = (,, ) = (6,7) (3,5,7) (,5,7) Lecture Notes Prepared by mir G. ghdam

22 - Simplify using K-map: =. +. =. +. Lecture Notes Prepared by mir G. ghdam

23 y =. LK y - esign with other types of flip-flops is not straightforward as the net state cannot directly be related to the input equations. - In such cases we should use ecitation tables, which list the required input for a given change of state. Lecture Notes Prepared by mir G. ghdam

24 Q(t) Q(t+) J K Q(t) Q(t+) T Ecitation table of a JK flip-flop Ecitation table of a T flip-flop Synthesis using JK Flip-Flops - Eample: onsider the sequential circuit given by the following table: Present state Input Net State - ssume that it is desired to design this sequential circuit using JK flip-flops. - Using the ecitation table of JK flip-flops, we will have: Lecture Notes Prepared by mir G. ghdam

25 Present state Input Net State Flip-Flop Inputs J K J K J =. K =. J = = ( ) K Lecture Notes Prepared by mir G. ghdam

26 - The logic diagram can be obtained from the input equations given above: J K J K LK Synthesis using T Flip-Flops: - Eample: onsider a 3-bit binary counter shown in the following diagram: - In fact the only input to the circuit is the clock and the output is the present state of the flip-flops. - The state table for this eample is as follows: Lecture Notes Prepared by mir G. ghdam

27 Present State Net State From Ecitation table Flip-Flop Inputs 2 2 2 T T T - The most efficient way to construct a binary counter is by using T flip-flops, because of their complement property. 2 2 2 T = 2. Lecture Notes Prepared by mir G. ghdam

28 2 2 2 T = 2 2 2 - Logic diagram of the counter: T = 2 T T T LK Lecture Notes Prepared by mir G. ghdam

29 Reference: [] igital esign 3rd Edition, y Morris Mano, Publisher Prentice Hall, 4th Edition. Lecture Notes Prepared by mir G. ghdam