Outputs Combinational circuit. Next state. Fig. 4-1 Block Diagram of a Sequential Circuit

Similar documents
ECE 3401 Lecture 12. Sequential Circuits (II)

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

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

Flip-flop and Registers

Chapter 5 Sequential Circuits

`COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES Concordia University

Chapter 5 Sequential Circuits

Digital Logic Design Sequential Circuits. Dr. Basem ElHalawany

Chapter. Synchronous Sequential Circuits

Registers & Counters. BME208 Logic Circuits Yalçın İŞLER

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

ECE 3401 Lecture 11. Sequential Circuits

Problems with D-Latch

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

Chapter 5 Sequential Circuits

EECS 3201: Digital Logic Design Lecture 9. Ihab Amer, PhD, SMIEEE, P.Eng.

LAB #4 SEQUENTIAL LOGIC CIRCUIT

Chapter 5 Synchronous Sequential Logic

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

Introduction to Sequential Circuits

Outline. CPE/EE 422/522 Advanced Logic Design L04. Review: 8421 BCD to Excess3 BCD Code Converter. Review: Mealy Sequential Networks

HDL & High Level Synthesize (EEET 2035) Laboratory II Sequential Circuits with VHDL: DFF, Counter, TFF and Timer

Chapter 3 Unit Combinational

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

Logic Design. Flip Flops, Registers and Counters

Unit 11. Latches and Flip-Flops

Flip-Flops and Registers

Sequential Circuits: Latches & Flip-Flops

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

Synchronous Sequential Logic

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

Engr354: Digital Logic Circuits

ACS College of Engineering. Department of Biomedical Engineering. HDL pre lab questions ( ) Cycle-1

Chapter 5. Introduction

Unit-5 Sequential Circuits - 1

D Latch (Transparent Latch)

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

Registers, Register Transfers and Counters Dr. Fethullah Karabiber

Combinational / Sequential Logic

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

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

Laboratory Exercise 7

Digital Logic Design I

Other Flip-Flops. Lecture 27 1

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

ELE2120 Digital Circuits and Systems. Tutorial Note 7

Feedback 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.

ELCT201: DIGITAL LOGIC DESIGN

LATCHES & FLIP-FLOP. Chapter 7

Ryerson University Department of Electrical and Computer Engineering EES508 Digital Systems

DEPARTMENT OF ELECTRICAL &ELECTRONICS ENGINEERING DIGITAL DESIGN

Sequential logic. Circuits with feedback. How to control feedback? Sequential circuits. Timing methodologies. Basic registers

Sequential Design Basics

EECS150 - Digital Design Lecture 19 - Finite State Machines Revisited

Synchronous Sequential Logic

CHAPTER 11 LATCHES AND FLIP-FLOPS

CHAPTER1: Digital Logic Circuits

Synchronous Sequential Logic

Sequential Logic Circuits

Lecture 8: Sequential Logic

Flip-Flops and Sequential Circuit Design

Chapter 6 Sequential Circuits

ELCT201: DIGITAL LOGIC DESIGN

Sequential circuits. Same input can produce different output. Logic circuit. William Sandqvist

Chapter 1: Switching Algebra Chapter 2: Logical Levels, Timing & Delays. Introduction to latches Chapter 9: Binary Arithmetic

California State University, Bakersfield Computer & Electrical Engineering & Computer Science ECE 3220: Digital Design with VHDL Laboratory 7

RS flip-flop using NOR gate

Synchronous Sequential Logic. Chapter 5

Synchronous Sequential Logic

Chapter 5 Synchronous Sequential Logic

ECE 341. Lecture # 2

Chapter 8 Sequential Circuits

CHAPTER 4: Logic Circuits

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

6. Sequential Logic Flip-Flops

DIGITAL CIRCUIT LOGIC UNIT 11: SEQUENTIAL CIRCUITS (LATCHES AND FLIP-FLOPS)

Experiment 8 Introduction to Latches and Flip-Flops and registers

ECE 263 Digital Systems, Fall 2015

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

Overview of Chapter 4

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


Introduction to Digital Logic Missouri S&T University CPE 2210 Flip-Flops

ENGR 303 Introduction to Logic Design Lecture 10. Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

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

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

Chapter 9. Design of Counters

Universal Asynchronous Receiver- Transmitter (UART)

P U Q Q*

Registers & Counters. Logic and Digital System Design - CS 303 Erkay Savaş Sabanci University

Modeling Latches and Flip-flops

LAB 7. Latches & Flip Flops

ASYNCHRONOUS SEQUENTIAL CIRCUIT CONCEPTS

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

Outline. CPE/EE 422/522 Advanced Logic Design L03. Review: Clocked D Flip-Flop with Rising-edge Trigger. Sequential Networks

CHAPTER 4: Logic Circuits

Experiment # 12. Traffic Light Controller

Note that none of the above MAY be a VALID ANSWER.

Synchronous Sequential Logic

Transcription:

4- Inputs Outputs ombinational circuit Next state Storage elements Present state Fig. 4- Block Diagram of a Sequential ircuit 2 Prentice Hall, Inc.

4-2 (a) t pd (b) t pd 2 t pd (d) 2 t pd (c) t pd Fig. 4-2 Logic Structures for Storing Information 2 Prentice Hall, Inc.

4-3 Inputs ombinational circuit Flip-flops Outputs lock pulses (a) Block diagram (b) Timing diagram of clock pulses Fig. 4-3 Synchronous locked Sequential ircuit 2 Prentice Hall, Inc.

4-4 R (Reset) S R Set state S (Set) Reset state Undefined (a) Logic diagram Fig. 4-4 SR Latch with NOR Gates (b) Function table 2 Prentice Hall, Inc.

4-5. ns 2ns 3ns 4ns 5ns 6ns 7ns 8ns i i o o S R _B s s s Fig. 4-5 Logic Simulation of SR Latch Behavior 2 Prentice Hall, Inc.

4-6 S (Set) S R Set state R (Reset) Reset state Undefined (a) Logic diagram (b) Function table Fig. 4-6 SR Latch with NND Gates 2 Prentice Hall, Inc.

4-7 S S R Next state of No change No change = ; Reset state R = ; Set state Undefined (a) Logic diagram Fig. 4-7 SR Latch with ontrol Input (b) Function table 2 Prentice Hall, Inc.

4-8 D S R (a) Logic diagram D Next state of No change = ; Reset state = ; Set state (b) Function table Fig. 4-8 D Latch 2 Prentice Hall, Inc.

4-9 D TG TG Fig. 4-9 D Latch with Transmission Gates 2 Prentice Hall, Inc.

4- S S Y S R R Y R Fig. 4- SR Master-Slave Flip-Flop 2 Prentice Hall, Inc.

4-. 5ns ns 5ns 2ns i is ir oy o s s s Fig. 4- Logic Simulation of a Master-Slave Flip-Flop 2 Prentice Hall, Inc.

4-2 J K S R S R (a) J K (b) Next State of Fig. 4-2 Master-Slave JK Flip-Flop 2 Prentice Hall, Inc.

4-3 D D S R Fig. 4-3 D-Type Positive Edge-Triggered Flip-Flop 2 Prentice Hall, Inc.

4-4 J K D S R Fig. 4-4 Positive Edge-Triggered JK Flip-Flop 2 Prentice Hall, Inc.

4-5 S S D D R R SR SR D with ontrol D with ontrol (a) Latches S R S R J K J K Triggered SR Triggered SR Triggered JK Triggered JK (b) Master-Slave Flip-Flops D D J K J K Triggered D Triggered D Triggered JK Triggered JK (c) Edge-Triggered Flip-Flops Fig. 4-5 Standard Graphic Symbols for Latch and Flip-Flops 2 Prentice Hall, Inc.

4-6 TBLE 4- Flip-Flop haracteristic Tables (a) JK Flip-Flop (b) SR Flip-Flop J K (t ) Operation S R (t ) Operation (t) No change (t) No change Reset Reset Set Set t () omplement? Undefined (c) D Flip-Flop (d) T Flip-Flop D (t ) Operation T (t ) Operation Reset (t) No change Set t () omplement Table 4- Flip-Flop haracteristic Tables 2 Prentice Hall, Inc.

4-7 S J K R (a) Graphic symbols S R J K (b) Function table Undefined No change omplement Fig. 4-6 JK Flip-Flop with Direct Set and Reset 2 Prentice Hall, Inc.

4-8 B Y J K lock Fig. 4-7 Implementing Input Equations 2 Prentice Hall, Inc.

4-9 D D B B lock Y Fig. 4-8 Example of a Sequential ircuit 2 Prentice Hall, Inc.

2 Prentice Hall, Inc. 4-2 TBLE 4-2 State Table for ircuit of Figure 4-8 Present State Input Next State Output B B Y Table 4-2 State Table for ircuit of Figure 4-8

4-2 TBLE 4-3 Two-Dimensional State Table for the ircuit in Figure 4-8 Present state Next state Output B B B Y Y Table 4-3 Two-Dimensional State Table for the ircuit in Figure 4-8 2 Prentice Hall, Inc.

2 Prentice Hall, Inc. 4-22 (b) State table Z Output Next state Inputs Y Present state lock D Z Y (a) Fig. 4-9 Logic Diagram and State Table for D Y =

2 Prentice Hall, Inc. 4-23 TBLE 4-4 State Table for ircuit with JK Flip-Flops Present state Input Next state Flip-flop inputs B B J K J B K B Table 4-4 State Table for ircuit with JK Flip-Flops

4-24 / / / / / /, / / (a), / / (b),, Fig. 4-2 State Diagrams 2 Prentice Hall, Inc.

4-25 / B / B / (a) (b) / B / / / D (c) / / / B / / D / / (d) / Fig. 4-2 onstruction of a State Diagram 2 Prentice Hall, Inc.

4-26 TBLE 4-5 State Table for State Diagram in Figure 4-2 Present State Next State Output Z B D D B B Table 4-5 State Table for State Diagram in Figure 4-2 2 Prentice Hall, Inc.

2 Prentice Hall, Inc. 4-27 TBLE 4-6 Sequence Tables for ode onverter Example Sequences in Order of Digits Represented Sequences in Order of ommon Prefixes BD Input Excess-3 Output BD Input Excess-3 Output 2 3 4 2 3 4 2 3 4 2 3 4 Table 4-6 Sequence Tables for ode onverter Example

4-28 Init Init / / / / B= B= B= B= (a) / / / or / B2= B2= B2= (b) Init Init / / / or / / / / or / / or / B= / / B= / or / / or / B= / / B= / or / B2= B2= B2= B2= B2= B2= / or / / / / / B3= B3= B3= B3= (c) Fig. 4-22 onstruction of a State Diagram 2 Prentice Hall, Inc. (d)

4-29 TBLE 4-7 Table 4-5 with Names Replaced by Binary odes Next State Output Z Present State Table 4-7 Table 4-5 with Names Replaced by Binary odes 2 Prentice Hall, Inc.

2 Prentice Hall, Inc. 4-3 TBLE 4-8 State Table for Design Example Present State Input Next State Output B B Y Table 4-8 State Table for Design Example

4-3 / / / / / / / / Fig. 4-23 State Diagram for Design Example 2 Prentice Hall, Inc.

4-32 B B B B B B D = B + B D B = + B + B Fig. 4-24 Maps for Input Equations and Output Y Y = B 2 Prentice Hall, Inc.

4-33 D D B B lock Fig. 4-25 Logic Diagram for Sequential ircuit with D Flip-Flops Y 2 Prentice Hall, Inc.

2 Prentice Hall, Inc. 4-34 TBLE 4-9 State Table for Second Design Example Present State Input Next State B B Table 4-9 State Table for Second Design Example

4-35 B B D = + B + B D B = + B D = Fig. 4-26 Maps for Simplifying Input Equations 2 Prentice Hall, Inc.

2 Prentice Hall, Inc. 4-36 TBLE 4- Flip-Flop Excitation Tables (a) JK Flip-Flop (b) SR Flip-Flop (t ) (t ) J K (t) (t ) S R (c) D Flip-Flop (d) T Flip-Flop (t) (t ) D (t) (t ) T Table 4- Flip-Flop Excitation Tables

2 Prentice Hall, Inc. 4-37 TBLE 4- State Table with JK Flip-Flop Inputs Present State Input Next State Flip-Flop Inputs B B J K J B K B Table 4- State Table with JK Flip-Flop Inputs

4-38 B B B B J = B K = B B B B B J B = K B = + = Fig. 4-27 Maps for J and K Input Equations 2 Prentice Hall, Inc.

4-39 Y ND2 INV ND2 FJK ND2 FJK INV B NOR2 LK R Fig. 4-28 Logic Diagram for Sequential ircuit with JK Flip-Flops 2 Prentice Hall, Inc.

4-4 R: : : * * B: * * Y: * * * These responses are asynchronous with the clock and thus do not w ait for the next positive clock edge. (a) ircuit test and expected results. 2ns 4ns 6ns 8ns ns 2ns 4ns 6ns 8ns 2ns 22ns 24ns 26ns 28ns ilk ir i o o B o Y s s s (b) Simulation results Fig. 4-29 Logic Simulation Verification for the ircuit in Figure 4-28 2 Prentice Hall, Inc.

4-4 -- Positive Edge-Triggered D Flip-Flop with Reset: -- VHDL Process Description library ieee; use ieee.std_logic_64.all; entity dff is port(lk, RESET, D : in std_logic; : out std_logic); end dff; architecture pet_pr of dff is -- Implements positive edge-triggered bit state storage -- with asynchronous reset. begin process (LK, RESET) begin if (RESET = '') then <= ''; elsif (LK'event and LK = '') then <= D; end if; end if; end process; end; Fig. 4-3 VHDL Process Description of Positive Edge-Triggered Flip-Flop with Reset 2 Prentice Hall, Inc.

4-42 -- Sequence Recognize r: VHDL Process Description -- (See Figure 4-2 f or state diagram) library ieee; use ieee.std_logic_ 64.all; entity seq_rec is port(lk, RESET, : in std_logic; Z: out std_logic); end seq_rec; architecture process_3 of seq_rec is type state_type is (, B,, D); signal state, next_state : state_t ype; begin -- Process - state_ register: implements positive edge-triggered -- state storage with asynchronous reset. state_register: process (LK, RESET) begin if (RESET = '') then state <= ; elsif (LK event and LK = '') then state <= n ext_state; end if; end if; end process; -- Process 2 - next_s tate_function: implements next state as -- a function of inpu t and state. next_state_func: process (, state) begin case state is when => if = '' then next_state <= B ; else next_state <= ; end if; when B => if = '' then next_state <= ; else next_state <= ; end if; Fig. 4-3 VHDL Process Description of a Sequence Recognizer 2 Prentice Hall, Inc.

4-43 -- Sequence Recognizer: VHDL Process Description (continued) when => if = '' then next_state <= ; else next_state <= D; end if; when D => if = '' then next_state <= B; else next_state <= ; end if; end case; end process; -- Process 3 - output_function: implements output as function -- of input and state. output_func: process (, state) begin case state is when => Z <= ''; when B => Z <= ''; when => Z <= ''; when D => if = '' then Z <= ''; else Z <= ''; end if; end case; end process; end; Fig. 4-32 VHDL Process Description of a Sequence Recognizer (continued) 2 Prentice Hall, Inc.

4-44 TBLE 4-2 Illustration of generation of storage in VHDL Inputs RESET = LK = LK event ction FLSE FLSE FLSE Unspecified FLSE FLSE TRUE Unspecified FLSE TRUE FLSE Unspecified FLSE TRUE TRUE <= D TRUE <= '' Table 4-2 Illustration of generation of storage in VHDL 2 Prentice Hall, Inc.

4-45 // Positive Edge-Triggered D Flip-Flop with Reset: // Verilog Process Description module dff_v(lk, RESET, D, ); input LK, RESET, D; output ; reg ; always @(posedge LK or posedge RESET) begin if (RESET) <= ; else <= D; end endmodule Fig. 4-33 Verilog Process Description of Positive Edge-Triggered Flip-Flop with Reset 2 Prentice Hall, Inc.

4-46 // Sequence Recognizer: Verilog Process Description // (See Figure 4-2 f or state diagram) module seq_rec_v(lk, RESET,, Z); input LK, RESET, ; output Z; reg [:] state, next_state; parameter = 2'b, B = 2'b, = 2 'b, D = 2'b; reg Z; // state register: im plements positive edge-triggered // state storage with asynchronous reset. always @(posedge LK or posedge RESET) begin if (RESET == ) state <= ; else state <= next_state; end // next state functio n: implements next state as funct ion // of and state always @( or state) begin case (state) : if ( == ) next_state <= B; else next_state <= ; B: if() next_state <= ;else next_state <= ; : if() next_state <= ;else next_state <= D; D: if() next_state <= B;else next_state <= ; endcase end // output function: i mplements output as function // of and state always @( or state) begin case (state) : Z <= ; B: Z <= ; : Z <= ; D: Z <=? : ; endcase end endmodule Fig. 4-34 Verilog Process of a Sequence Recognizer 2 Prentice Hall, Inc.

4-47 TBLE 4-3 Illustration of generation of storage in Verilog Inputs ction posegdge RESET and RESET = posedge LK FLSE FLSE Unspecified FLSE TRUE <= D TRUE FLSE <= TRUE TRUE <= Table 4-3 Illustration of generation of storage in Verilog 2 Prentice Hall, Inc.