ECE 3401 Lecture 12. Sequential Circuits (II)

Similar documents
ECE 3401 Lecture 11. Sequential Circuits

Chapter 6 Sequential Circuits

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

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

Problems with D-Latch

Chapter 5 Sequential Circuits

Flip-flop and Registers

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

Registers, Register Transfers and Counters Dr. Fethullah Karabiber

Chapter 3 Unit Combinational

`COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES Concordia University

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

D Latch (Transparent Latch)

Lecture 8: Sequential Logic

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

Logic Design. Flip Flops, Registers and Counters

CHAPTER 4: Logic Circuits

ELEN Electronique numérique

Review of digital electronics. Storage units Sequential circuits Counters Shifters

CSC Computer Architecture and Organization

Ryerson University Department of Electrical and Computer Engineering EES508 Digital Systems

Synchronous Sequential Logic

Digital Logic Design ENEE x. Lecture 19

Overview of Chapter 4

Chapter 5 Sequential Circuits

Sequential Logic Circuits

CHAPTER 4: Logic Circuits

Advanced Devices. Registers Counters Multiplexers Decoders Adders. CSC258 Lecture Slides Steve Engels, 2006 Slide 1 of 20

ASYNCHRONOUS SEQUENTIAL CIRCUIT CONCEPTS

Chapter 5 Sequential Systems. Introduction

Asynchronous (Ripple) Counters

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

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

Counters

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

Digital Logic Design I

Eng. Mohammed Samara. Fall The Islamic University of Gaza. Faculty of Engineering. Computer Engineering Department

Chapter 6. sequential logic design. This is the beginning of the second part of this course, sequential logic.

6. Sequential Logic Flip-Flops

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

Chapter 5 Synchronous Sequential Logic

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

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

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

Flip-Flops and Registers

download instant at

Chapter 5: Synchronous Sequential Logic

Logic Design II (17.342) Spring Lecture Outline

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

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

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

CHAPTER1: Digital Logic Circuits

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

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

ECE 263 Digital Systems, Fall 2015

Feedback Sequential Circuits

Sequential Logic Counters and Registers

ECE 545 Digital System Design with VHDL Lecture 2. Digital Logic Refresher Part B Sequential Logic Building Blocks

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

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

Synchronous Sequential Logic

Switching Theory And Logic Design UNIT-IV SEQUENTIAL LOGIC CIRCUITS

Digital Logic Design Sequential Circuits. Dr. Basem ElHalawany

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

Digital Circuits ECS 371

Fundamentals of Computer Systems

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

ELCT201: DIGITAL LOGIC DESIGN

ELCT201: DIGITAL LOGIC DESIGN

Combinational / Sequential Logic

Multiplexor (aka MUX) An example, yet VERY useful circuit!

Chapter 5 Sequential Circuits

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

2 Sequential Circuits

Engr354: Digital Logic Circuits

Counter dan Register

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

Figure 30.1a Timing diagram of the divide by 60 minutes/seconds counter

COMP sequential logic 1 Jan. 25, 2016

DEPARTMENT OF ELECTRICAL &ELECTRONICS ENGINEERING DIGITAL DESIGN

Agenda. EE 260: Introduction to Digital Design Counters and Registers. Asynchronous (Ripple) Counters. Asynchronous (Ripple) Counters

Introduction. NAND Gate Latch. Digital Logic Design 1 FLIP-FLOP. Digital Logic Design 1

Unit 11. Latches and Flip-Flops

Synchronous Sequential Logic. Chapter 5

RS flip-flop using NOR gate

Registers and Counters

RS flip-flop using NOR gate

More on Flip-Flops Digital Design and Computer Architecture: ARM Edition 2015 Chapter 3 <98> 98

Synchronous Sequential Logic

Synchronous Sequential Logic

Chapter. Synchronous Sequential Circuits

Sequencing. Lan-Da Van ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C. Fall,

PEEL 18CV8-5/-7/-10/-15/-25 CMOS Programmable Electrically Erasable Logic Device

Synchronous Sequential Logic

MC9211 Computer Organization

Experiment 8 Introduction to Latches and Flip-Flops and registers

ECE 545 Digital System Design with VHDL Lecture 1B. Digital Logic Refresher Part B Sequential Logic Building Blocks

CSE115: Digital Design Lecture 23: Latches & Flip-Flops

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

UNIT IV. Sequential circuit

Transcription:

EE 34 Lecture 2 Sequential ircuits (II) Overview of Sequential ircuits Storage Elements Sequential circuits Storage elements: Latches & Flip-flops Registers and counters ircuit and System Timing Sequential circuit analysis and description: State tables & State diagrams

ounters ounter: a special type of register that incorporates an incrementer or decrementer, which allows it to count upward or downward. We shall examine VHL code for the following counters: Up counter own counter VHL for Up-ounter Library ieee; USE ieee.std_logic_64.all; USE ieee.std_logic_unsigned.all; ENTITY upcount IS GENERI ( N : INTEGER := 4 ); PORT ( lock, Resetn, Enable : IN ST_LOGI; Q: BUFFER ST_LOGI_VETOR (N- OWNTO )); EN upcount; RHITETURE cnt OF upcount IS SIGNL count : ST_LOGI_VETOR (N- OWNTO ); BEGIN PROESS (Resetn, lock) BEGIN IF Resetn = '' THEN count <= ( OTHERS => ); ELSIF (lock'event N lock = '') THEN IF Enable = '' THEN count <= count +; ELSE count <= count; EN IF; EN IF; EN PROESS; Q <= count; EN cnt; 2

Timing iagram for Up-ounter Synchronous ounters Internal Logic Incrementer: Q+ or Q+ ontraction of a ripple carry adder with one operant fixed at X Symbol for Synchronous ounter TR 4 Incrementer 2 EN Q Q 3 Q 2 Q 3 O Symbol 3

Synchronous ounters (ontd.) ontraction of carry-lookahead adder Reduce path delays alled parallel gating Lookahead can be used on Os and ENs to prevent long paths in large counters EN Q Q Q 2 2 Q 3 3 O Logic iagram-parallel Gating ounter with Parallel Load Load ount ction Load Hold Stored Value ount Up Stored Value X Load ount Q dd path for input data enabled for Load = Load TR4 Q dd logic to: When Load = disable count logic (feedback from outputs) When Load = and ount = enable count logic ount 2 3 Q Q Q 2 Q 3 O 2 Q 2 3 Q 3 lock arry Output O 4

B ounter architecture Behavioral of bcd_counter is signal regcnt : std_logic_vector(3 downto ); begin count: process(reset,clk) is begin if ( reset='' ) then regcnt <= ""; elsif ( clk'event and clk='') then regcnt <= regcnt+; if (regcnt = "") then regcnt <= ""; end if; end if; end process; end Behavioral; Overview of Sequential ircuits Storage Elements Sequential circuits Storage elements: Latches & Flip-flops Registers and counters ircuit and System Timing Sequential circuit analysis and description: State tables & State diagrams 5

Flip-Flop Timing Parameters t w - clock pulse width t s - setup time: Equal to a time interval that is generally much less than the width of the triggering pulse t h - hold time - Often equal to zero t px - propagation delay Same parameters as for gates except Measured from clock edge that triggers the output change to the stabilization of the output to a new value t wh t wh,min t wl t wl,min Q t s t h t p-,min t p-,max Edge-triggered (negative edge) Triggered ircuit and System Level Timing onsider a system comprised of ranks of flipflops connected by logic If the clock period is too short, some data changes will not propagate through the circuit to next flip-flop inputs before the setup time interval begins LOK Q Q' Q Q' Q Q' Q Q' Q Q' Q Q' Q Q' Q Q' Q Q' Q Q' LOK t p t pd,ff t pd,omb t slack t s 6

ircuit and System Level Timing (ontd.) Timing components along a path from flip-flop to flipflop t p t pd,ff t pd,omb t slack t s Edge-triggered (negative edge) Timing Equations t p = t slack + (t pd,ff + t pd,omb + t s ) t p max (t pd,ff + t pd,omb + t s ) for all paths from flip-flop output to flip-flop input alculation of llowable t pd,omb ompute the allowable t pd,omb for a circuit using edge-triggered flip-flops Parameters t pd,ff (max) =. ns lock frequency = 25 MHz, t p = /clock frequency = 4. ns t s (max) =.3 ns for edge-triggered flip-flops for a gate, average t pd =.3 ns alculations: Edge-triggered: 4.. + t pd,omb +.3 =>t pd,omb 2.7 ns, approximately 9 gates allowed on a path 7

Overview of Sequential ircuits Storage Elements Sequential circuits Storage elements: Latches & Flip-flops Registers and counters ircuit and System Timing Sequential circuit analysis and description: State tables & State diagrams Example Input: x(t) Output: State: y(t) ((t), B(t)) x Next State Q Q Output Function? y(t) = x(t)(b(t) + (t)) Next State Function? (t+) = (t)x(t) + B(t)x(t) B(t+) = (t)x(t) P Output Q Q' B y 8

Example (ontd.) Where in time are inputs, outputs and states defined? y(t) = x(t)(b(t) + (t)) (t+) = (t)x(t) + B(t)x(t) B(t+) = (t)x(t) State Table haracteristics The state table can be filled in using the next state and output equations: (t+) = (t)x(t) + B(t)x(t), B(t+) = (t)x(t) y(t) = x (t)(b(t) + (t)) Present State Input Next State Output (t) B(t) x(t) (t+) B(t+) y(t) 9

State iagram Present State Input Next State Output (t) B(t) x(t) (t+) B(t+) y(t) / / S S / / S 2 / / / S 3 esign Procedure for Sequential ircuits Formulation: Obtain a state diagram or state table State ssignment: ssign binary codes to the states Flip-Flop Input Equation etermination: Select flip-flop types, derive flip-flop input equations from next state entries in the table Output Equation etermination: erive output equations from output entries in the table Optimization - Optimize the equations Technology Mapping - Find circuit from equations and map to flip-flops and gate technology Verification - Verify correctness of final design

Formulation: Finding a State iagram State: an abstraction of the history of past-applied inputs to the circuit (including power-up or system reset) synchronous reset normally resets to the initial state In specifying a circuit, states remember meaningful properties of past input sequences that are essential to predicting future output values, e.g.: State represents the fact that a input has occurred among the past inputs. State B represents the fact that a followed by a have occurred as the most recent past two inputs. Example: Sequence Recognizer Procedure sequence recognizer: produces an output value whenever a prescribed pattern of inputs occur in sequence Steps: Begin in an initial state (typically reset state), when NONE of the initial portion of the sequence has occurred dd states that recognize each successive symbol occurring the final state represents the input sequence occurrence. dd state transition arcs which specify what happens when a symbol not in the proper sequence has occurred. dd other arcs on non-sequence inputs which transition to states. The last step is required because the circuit must recognize the input sequence regardless of where it occurs within the overall sequence applied since reset..

Example: Recognize efine states for the sequence to be recognized Starting in the initial state (""): / / / B Finally, output on the arc from means the sequence has been recognized, To what state should the arc from state go? Remember:? The final in the recognized sequence is a sub-sequence of. It follows a which is not a sub-sequence of. Thus it should represent the same state reached from the initial state after a first is observed. / / B / Example: Recognize (ontd.) The other arcs are added to each state for inputs not yet listed. Which arcs are missing? State transition arcs must represent the fact that an input subsequence has occurred. Note that the arc from state back to implies that State means two or more 's have occurred. / / / B Present Next State / State x= x= Output x= x= B B B 2

Example: Moore Model For Moore Model, outputs are associated with states. rcs now show only state transitions dd a new state E to produce the output State E produces the same behavior in the future as state B, but it gives a different output at the present time. Thus these states do represent a different abstraction of the input history. The Moore model for a sequence recognizer usually has more states than the Mealy model. / / B / / / B/ / / E/ Example: Moore Model (ontd.) / B/ / / E/ Present State Next State x= x= B B E E Output y 3

VHL Example: Sequential Recognizer VHL for the sequential recognizer follows library ieee; use ieee.std_logic_64.all; entity seq_rec is port (LK, RESET, X: in std_logic; Z: out std_logic); end seq_rec; architecture process_3 of seq_rec is type state_type is (, B,, ); signal state, next_state: state_type; begin VHL Example (ontd.) --process : implements positive edge-triggered flipflop with asynchronous reset state_register: process (LK, RESET) begin if(reset = '') then / state <= ; elsif (LK'event and LK = '') then state <= next_state; end if; end process; / B / / --process 2: implement output as function of input X and state output_function: process (X, state) begin case state is when => Z <= ''; when B => Z <= ''; when => Z <= ''; when => if X = '' then Z <= '; else Z <= '; end if; end case; end process; 4

VHL Example: (Process 3) --process 3: next state-function implemented as a function of input X and state next_state_function: process (X, state) begin case state is when => if X = '' then next_state <= B; else next_state <= ; end if; when B => if X = '' then next_state <= ; else next_state <= ; / B / end if; when => if X = '' then next_state <= ; else next_state <= ; end if; when => if X = '' then next_state <= B; else next_state <= ; end if; end case; end process; end architecture; / / 5