Sequential Logic Implementation

Size: px
Start display at page:

Download "Sequential Logic Implementation"

Transcription

1 Sequential Logic Implementation Models for representing sequential circuits Abstraction of sequential elements Finite state machines and their state diagrams Inputs/outputs Mealy, Moore, and synchronous Mealy machines Finite state machine design procedure Verilog specification eriving state diagram eriving state transition table etermining next state and output functions Implementing combinational logic CS 5 - Fall 25 Lec #7: Sequential Implementation Mealy vs. Moore Machines Moore: outputs dep on current state only Mealy: outputs dep on current state and inputs Ant brain is a Moore Machine Output does not react immediately to input change We could have specified a Mealy FSM Outputs have immediate reaction to inputs As inputs change, so does next state, doesn t commit until clocking event L / TL A L R / TL, F react right away to leaving the wall L R / TR, F CS 5 - Fall 25 Lec #7: Sequential Implementation 2

2 Specifying Outputs for a Moore Machine Output is only function of state Specify in state bubble in state diagram Example: sequence detector for or reset A/ B/ C/ / E/ current next reset input state state output A A B A C B B B C E C C E C E B E CS 5 - Fall 25 Lec #7: Sequential Implementation 3 Specifying Outputs for a Mealy Machine Output is function of state and inputs Specify output on transition arc between states Example: sequence detector for or reset/ / B / A / / / C current next reset input state state output A A B A C B B B C C B C C / CS 5 - Fall 25 Lec #7: Sequential Implementation 4

3 Comparison of Mealy and Moore Machines Mealy Machines t to have less states ifferent outputs on arcs (n^2) rather than states (n) Moore Machines are safer to use Outputs change at clock edge (always one cycle later) In Mealy machines, input change can cause output change as soon as logic is done a big problem when two machines are interconnected asynchronous feedback Mealy Machines react faster to inputs React in same cycle don't need to wait for clock In Moore machines, more logic may be necessary to decode state into outputs more gate delays after inputs Combinational logic for ext State reg Logic for outputs outputs inputs Logic for outputs Combinational logic for ext State reg outputs state feedback CS 5 - Fall 25 Lec #7: Sequential Implementation 5 state feedback Mealy and Moore Examples Recognize A,B =, Mealy or Moore? A B clock out A out B clock CS 5 - Fall 25 Lec #7: Sequential Implementation 6

4 Mealy and Moore Examples (cont d) Recognize A,B =, then, Mealy or Moore? out A B clock out A B clock CS 5 - Fall 25 Lec #7: Sequential Implementation 7 Registered Mealy Machine (Really Moore) Synchronous (or registered) Mealy Machine Registered state A outputs Avoids glitchy outputs Easy to implement in programmable logic Moore Machine with no output decoding Outputs computed on transition to next state rather than after entering View outputs as expanded state vector Inputs output logic next state logic Outputs Current State CS 5 - Fall 25 Lec #7: Sequential Implementation 8

5 Verilog FSM - Reduce s Example Change the first to in each string of s Example Moore machine implementation // State assignment parameter zero =, one =, twos = 2; module reduce (out, clk, reset, in); output out; input clk, reset, in; reg out; reg [:] state; // state register reg [:] next_state; zero [] one [] twos [] CS 5 - Fall 25 Lec #7: Sequential Implementation 9 Moore Verilog FSM (cont d) or state) case (state) zero: begin // last input was a zero out = ; if (in) next_state = one; else next_state = zero; one: begin // we've seen one out = ; if (in) next_state = twos; else next_state = zero; twos: begin // we've seen at least 2 ones out = ; if (in) next_state = twos; else next_state = zero; default: begin // in case we reach a bad state out = ; next_state = zero; case zero [] include all signals that are input to state and output equations one [] twos [] CS 5 - Fall 25 Lec #7: Sequential Implementation

6 Moore Verilog FSM (cont d) // Implement the state register clk) if (reset) state <= zero; else state <= next_state; module zero [] one [] twos [] CS 5 - Fall 25 Lec #7: Sequential Implementation Mealy Verilog FSM for Reduce-s Example module reduce (clk, reset, in, out); input clk, reset, in; output out; reg out; reg state; // state register reg next_state; parameter zero =, one = ; zero / or state) case (state) zero: begin // last input was a zero if (in) next_state = one; else next_state = zero; out = ; one: // we've seen one if (in) begin next_state = one; out = ; else begin next_state = zero; out = ; case / / one / clk) if (reset) state <= zero; else state <= next_state; module CS 5 - Fall 25 Lec #7: Sequential Implementation 2

7 Synchronous Mealy Verilog FSM for Reduce-s Example module reduce (clk, reset, in, out); input clk, reset, in; output out; reg out; reg state; // state register reg next_state; reg next_out; parameter zero =, one = ; or state) case (state) zero: begin // last input was a zero if (in) next_state = one; else next_state = zero; next_out = ; one: // we've seen one if (in) begin next_state = one; next_out = ; else begin next_state = zero; next_out = ; case clk) if (reset) begin state <= zero; out <= ; else begin state <= next_state; out <= next_out; module / CS 5 - Fall 25 Lec #7: Sequential Implementation 3 zero one / / / Announcements Review Session, Today, 5-6 PM, 25 Cory Hall Examination, Wednesday, -2:3 PM, 25 Cory Hall Five uiz-like uestions -- Please Read Them Carefully! They are not inted to be tricky; they should contain all the information you need to answer the question correctly o calculators or other gadgets are necessary! on t bring them! o blue books! All work on the sheets handed out! o bring pencil and eraser please! If you like to unstaple the exam pages, then bring a stapler with you! Write your name and student I on EVERY page in case they get separated -- it has happened! on t forget your two-sided 8.5 x crib sheet! CS 5 - Fall 25 Lec #7: Sequential Implementation 4

8 Announcements Examination, Wednesday, -2:3 PM, 25 Cory Hall Topics covered through last Wednesday Combinational logic: design and optimization (K-maps up to and including 6 variables) Implementation: Simple gates (minimum wires and gates), PLA structures (minimum unique terms), Muxes, ecoders, ROMs, (Simplified) Xilinx CLB Sequential logic: R-S latches, flip-flops, transparent vs. edge-triggered behavior, master/slave concept Basic Finite State Machines: Representations (state diagrams, transition tables), Moore vs. Mealy Machines, Shifters, Registers, Counters Structural and Behavioral Verilog for combinational and sequential logic Labs, 2, 3 K&B: Chapters, 2 (2.-2.5), 3 (3., 3.6), 4 (4., 4.2, 4.3), 6 (6., 6.2., 6.3), 7 (7., 7.2, 7.3) CS 5 - Fall 25 Lec #7: Sequential Implementation 5 Example: Ving Machine Release item after 5 cents are deposited Single coin slot for dimes, nickels o change Reset Coin Sensor Ving Machine FSM Open Release Mechanism Clock CS 5 - Fall 25 Lec #7: Sequential Implementation 6

9 Example: Ving Machine (cont d) Suitable Abstract Representation Tabulate typical input sequences: Reset 3 nickels nickel, dime dime, nickel two dimes S raw state diagram: S S2 Inputs:,, reset Output: open chute Assumptions: S3 S4 [open] S5 [open] S6 [open] Assume and asserted for one cycle Each state has a self loop for = = (no coin) S7 [open] CS 5 - Fall 25 Lec #7: Sequential Implementation 7 Example: Ving Machine (cont d) Minimize number of states - reuse states whenever possible 5 Reset + present inputs next output state state open [open] symbolic state table CS 5 - Fall 25 Lec #7: Sequential Implementation 8

10 Example: Ving Machine (cont d) Uniquely Encode States present state inputs next state output open CS 5 - Fall 25 Lec #7: Sequential Implementation 9 Example: Ving Machine (cont d) Mapping to Logic X X X X X X X X Open X X X X = + + = OPE = CS 5 - Fall 25 Lec #7: Sequential Implementation 2

11 Example: Ving Machine (cont d) One-hot Encoding present state inputs next state output open = = + 2 = = OPE = 3 CS 5 - Fall 25 Lec #7: Sequential Implementation 2 Equivalent Mealy and Moore State iagrams Moore machine outputs associated with state Mealy machine outputs associated with transitions Reset + Reset Reset/ ( + Reset)/ [] / / 5 [] / 5 / / [] / / + +/ 5 [] Reset 5 Reset / CS 5 - Fall 25 Lec #7: Sequential Implementation 22

12 Moore Verilog FSM for Ving Machine module ving (open, Clk, Reset,, ); input Clk, Reset,, ; output open; reg open; reg state; // state register reg next_state; parameter zero =, five =, ten = 2, fifteen = 3; or or state) case (state) zero: begin if () next_state = five; else if () next_state = ten; case else open = ; fifteen: begin next_state = zero; if (!Reset) next_state = fifteen; else next_state = zero; open = ; clk) if (Reset (! &&!)) state <= zero; else state <= next_state; module Reset [] + 5 [] [] 5 [] + Reset Reset CS 5 - Fall 25 Lec #7: Sequential Implementation 23 Mealy Verilog FSM for Ving Machine module ving (open, Clk, Reset,, ); input Clk, Reset,, ; output open; reg open; reg state; // state register reg next_state; reg next_open; parameter zero =, five =, ten = 2, fifteen = 3; or or state) case (state) zero: begin if () begin next_state = ten; next_open = ; else if () begin next_state = five; next_open = ; else begin next_state = zero; next_open = ; case Reset/ ( + Reset)/ / / / 5 / / / / +/ 5 Reset / clk) if (Reset (! &&!)) begin state <= zero; open <= ; else begin state <= next_state; open <= next_open; module CS 5 - Fall 25 Lec #7: Sequential Implementation 24

13 Example: Traffic Light Controller A busy highway is intersected by a little used farmroad etectors C sense the presence of cars waiting on the farmroad with no car on farmroad, light remain green in highway direction if vehicle on farmroad, highway lights go from Green to Yellow to Red, allowing the farmroad lights to become green these stay green only as long as a farmroad car is detected but never longer than a set interval when these are met, farm lights transition from Green to Yellow to Red, allowing highway to return to green even if farmroad vehicles are waiting, highway gets at least a set interval as green Assume you have an interval timer that generates: a short time pulse (TS) and a long time pulse (TL), in response to a set (ST) signal. TS is to be used for timing yellow lights and TL for green lights CS 5 - Fall 25 Lec #7: Sequential Implementation 25 Example: Traffic Light Controller (cont d) Highway/farm road intersection farm road car sensors highway CS 5 - Fall 25 Lec #7: Sequential Implementation 26

14 Example: Traffic Light Controller (cont d) Tabulation of Inputs and Outputs inputs description outputs description reset place FSM in initial state HG, HY, HR assert green/yellow/red highway lights C detect vehicle on the farm road FG, FY, FR assert green/yellow/red highway lights TS short time interval expired ST start timing a short or long interval TL long time interval expired Tabulation of unique states some light configurations imply others state description S highway green (farm road red) S highway yellow (farm road red) S2 farm road green (highway red) S3 farm road yellow (highway red) CS 5 - Fall 25 Lec #7: Sequential Implementation 27 Example: Traffic Light Controller (cont d) State iagram (TL C)' Reset S S: HG S: HY TS' TL C / ST TL+C / ST S TS / ST S3 TS' S2: FG S3: FY TS / ST S2 TL+C' / ST (TL+C')' CS 5 - Fall 25 Lec #7: Sequential Implementation 28

15 Example: Traffic Light Controller (cont d) Generate state table with symbolic states Consider state assignments output encoding similar problem to state assignment (Green =, Yellow =, Red = ) Inputs Present State ext State Outputs C TL TS ST H F HG HG Green Red HG HG Green Red HG HY Green Red HY HY Yellow Red HY FG Yellow Red FG FG Red Green FG FY Red Green FG FY Red Green FY FY Red Yellow FY HG Red Yellow SA: HG = HY = FG = FY = SA2: HG = HY = FG = FY = SA3: HG = HY = FG = FY = (one-hot) CS 5 - Fall 25 Lec #7: Sequential Implementation 29 Traffic Light Controller Verilog module traffic (ST, Clk, Reset, C, TL, TS); input Clk, Reset, C, TL, TS; output ST; reg ST; reg state; reg next_state; reg next_st; parameter S =, S =, S2 = 2, S3 = 3; or TL or TS or state) case (state) S: if (!(TL && C)) begin next_state = S; next_st = ; else if (TL C) begin next_state = S; next_st = ; case TS' (TL C)' Reset S TL C TS / ST TL+C / ST S S3 TS / ST TL+C' / ST S2 TS' Clk) if (Reset) begin state <= S; ST <= ; else begin state <= next_state; ST <= next_st; module (TL+C')' CS 5 - Fall 25 Lec #7: Sequential Implementation 3

16 Logic for ifferent State Assignments SA S = C TL' PS PS + TS PS' PS + TS PS PS' + C' PS PS + TL PS PS S = C TL PS' PS' + C TL' PS PS + PS' PS ST = C TL PS' PS' + TS PS' PS + TS PS PS' + C' PS PS + TL PS PS H = PS H = PS' PS F = PS' F = PS PS' SA2 S = C TL PS' + TS' PS + C' PS' PS S = TS PS PS' + PS' PS + TS' PS PS SA3 ST = C TL PS' + C' PS' PS + TS PS H = PS H = PS PS' F = PS' F = PS PS S3 = C' PS2 + TL PS2 + TS' PS3 S2 = TS PS + C TL' PS2 S = C TL PS + TS' PS S = C' PS + TL' PS + TS PS3 ST = C TL PS + TS PS + C' PS2 + TL PS2 + TS PS3 H = PS3 + PS2 H = PS F = PS + PS F = PS3 CS 5 - Fall 25 Lec #7: Sequential Implementation 3 Ving Machine Example Revisted (PL mapping) OPE = reset'(' + ' + + ) = reset'( + + ) = CLK Seq Seq Open Reset Com CS 5 - Fall 25 Lec #7: Sequential Implementation 32

17 Ving Machine (cont d) OPE = creates a combinational delay after and change This can be corrected by retiming, i.e., move flip-flops and logic through each other to improve delay OPE = reset'( + + )(' + ' + + ) = reset'(' ' + ') Implementation now looks like a synchronous Mealy machine Common for programmable devices to have FF at of logic CS 5 - Fall 25 Lec #7: Sequential Implementation 33 Ving Machine (Retimed PL Mapping) OPE = reset'(' ' + ') CLK Seq Seq OPE Open Reset Seq CS 5 - Fall 25 Lec #7: Sequential Implementation 34

18 Sequential Logic Implementation Summary Models for representing sequential circuits Abstraction of sequential elements Finite state machines and their state diagrams Inputs/outputs Mealy, Moore, and synchronous Mealy machines Finite state machine design procedure Verilog specification eriving state diagram eriving state transition table etermining next state and output functions Implementing combinational logic CS 5 - Fall 25 Lec #7: Sequential Implementation 35

Engr354: Digital Logic Circuits

Engr354: Digital Logic Circuits Engr354: igital Circuits Chapter 7 Sequential Elements r. Curtis Nelson Sequential Elements In this chapter you will learn about: circuits that can store information; Basic cells, latches, and flip-flops;

More information

IE1204 Digital Design F12: Asynchronous Sequential Circuits (Part 1)

IE1204 Digital Design F12: Asynchronous Sequential Circuits (Part 1) IE1204 Digital Design F12: Asynchronous Sequential Circuits (Part 1) Elena Dubrova KTH / ICT / ES dubrova@kth.se BV pp. 584-640 This lecture IE1204 Digital Design, HT14 2 Asynchronous Sequential Machines

More information

More Verilog. 8-bit Register with Synchronous Reset. Shift Register Example. N-bit Register with Asynchronous Reset.

More Verilog. 8-bit Register with Synchronous Reset. Shift Register Example. N-bit Register with Asynchronous Reset. More Verilog 8-bit Register with Synchronous Reset module reg8 (reset, CLK, D, Q); input reset; input [7:0] D; output [7:0] Q; reg [7:0] Q; if (reset) Q = 0; else Q = D; module // reg8 Verilog - 1 Verilog

More information

ECE232: Hardware Organization and Design. Part 3: Verilog Tutorial. http://www.ecs.umass.edu/ece/ece232/ Basic Verilog

ECE232: Hardware Organization and Design. Part 3: Verilog Tutorial. http://www.ecs.umass.edu/ece/ece232/ Basic Verilog ECE232: Hardware Organization and Design Part 3: Verilog Tutorial http://www.ecs.umass.edu/ece/ece232/ Basic Verilog module ();

More information

Chapter 5. Sequential Logic

Chapter 5. Sequential Logic Chapter 5 Sequential Logic Sequential Circuits (/2) Combinational circuits: a. contain no memory elements b. the outputs depends on the current inputs Sequential circuits: a feedback path outputs depends

More information

Modeling Sequential Elements with Verilog. Prof. Chien-Nan Liu TEL: 03-4227151 ext:34534 Email: jimmy@ee.ncu.edu.tw. Sequential Circuit

Modeling Sequential Elements with Verilog. Prof. Chien-Nan Liu TEL: 03-4227151 ext:34534 Email: jimmy@ee.ncu.edu.tw. Sequential Circuit Modeling Sequential Elements with Verilog Prof. Chien-Nan Liu TEL: 03-4227151 ext:34534 Email: jimmy@ee.ncu.edu.tw 4-1 Sequential Circuit Outputs are functions of inputs and present states of storage elements

More information

Latches, the D Flip-Flop & Counter Design. ECE 152A Winter 2012

Latches, the D Flip-Flop & Counter Design. ECE 152A Winter 2012 Latches, the D Flip-Flop & Counter Design ECE 52A Winter 22 Reading Assignment Brown and Vranesic 7 Flip-Flops, Registers, Counters and a Simple Processor 7. Basic Latch 7.2 Gated SR Latch 7.2. Gated SR

More information

CHAPTER 11 LATCHES AND FLIP-FLOPS

CHAPTER 11 LATCHES AND FLIP-FLOPS CHAPTER 11 LATCHES AND FLIP-FLOPS This chapter in the book includes: Objectives Study Guide 11.1 Introduction 11.2 Set-Reset Latch 11.3 Gated D Latch 11.4 Edge-Triggered D Flip-Flop 11.5 S-R Flip-Flop

More information

Finite State Machine Design and VHDL Coding Techniques

Finite State Machine Design and VHDL Coding Techniques Finite State Machine Design and VHDL Coding Techniques Iuliana CHIUCHISAN, Alin Dan POTORAC, Adrian GRAUR "Stefan cel Mare" University of Suceava str.universitatii nr.13, RO-720229 Suceava iulia@eed.usv.ro,

More information

Register File, Finite State Machines & Hardware Control Language

Register File, Finite State Machines & Hardware Control Language Register File, Finite State Machines & Hardware Control Language Avin R. Lebeck Some slides based on those developed by Gershon Kedem, and by Randy Bryant and ave O Hallaron Compsci 04 Administrivia Homework

More information

CSE140: Components and Design Techniques for Digital Systems

CSE140: Components and Design Techniques for Digital Systems CE4: Components and esign Techniques for igital ystems Tajana imunic osing ources: Where we are now What we ve covered so far (Chap -5, App. A& B) Number representations Boolean algebra OP and PO Logic

More information

Registers & Counters

Registers & Counters Objectives This section deals with some simple and useful sequential circuits. Its objectives are to: Introduce registers as multi-bit storage devices. Introduce counters by adding logic to registers implementing

More information

WEEK 8.1 Registers and Counters. ECE124 Digital Circuits and Systems Page 1

WEEK 8.1 Registers and Counters. ECE124 Digital Circuits and Systems Page 1 WEEK 8.1 egisters and Counters ECE124 igital Circuits and Systems Page 1 Additional schematic FF symbols Active low set and reset signals. S Active high set and reset signals. S ECE124 igital Circuits

More information

Lecture 10 Sequential Circuit Design Zhuo Feng. Z. Feng MTU EE4800 CMOS Digital IC Design & Analysis 2010

Lecture 10 Sequential Circuit Design Zhuo Feng. Z. Feng MTU EE4800 CMOS Digital IC Design & Analysis 2010 EE4800 CMOS igital IC esign & Analysis Lecture 10 Sequential Circuit esign Zhuo Feng 10.1 Z. Feng MTU EE4800 CMOS igital IC esign & Analysis 2010 Sequencing Outline Sequencing Element esign Max and Min-elay

More information

Traffic Light Controller. Digital Systems Design. Dr. Ted Shaneyfelt

Traffic Light Controller. Digital Systems Design. Dr. Ted Shaneyfelt Traffic Light Controller Digital Systems Design Dr. Ted Shaneyfelt December 3, 2008 Table of Contents I. Introduction 3 A. Problem Statement 3 B. Illustration 3 C. State Machine 3 II. Procedure 4 A. State

More information

To design digital counter circuits using JK-Flip-Flop. To implement counter using 74LS193 IC.

To design digital counter circuits using JK-Flip-Flop. To implement counter using 74LS193 IC. 8.1 Objectives To design digital counter circuits using JK-Flip-Flop. To implement counter using 74LS193 IC. 8.2 Introduction Circuits for counting events are frequently used in computers and other digital

More information

No serious hazards are involved in this laboratory experiment, but be careful to connect the components with the proper polarity to avoid damage.

No serious hazards are involved in this laboratory experiment, but be careful to connect the components with the proper polarity to avoid damage. HARDWARE LAB 5/DESIGN PROJECT Finite State Machine Design of a Vending Machine Using Xilinx ISE Project Navigator and Spartan 3E FPGA Development Board with VHDL Acknowledgements: Developed by Bassam Matar,

More information

Sequential Circuits. Combinational Circuits Outputs depend on the current inputs

Sequential Circuits. Combinational Circuits Outputs depend on the current inputs Principles of VLSI esign Sequential Circuits Sequential Circuits Combinational Circuits Outputs depend on the current inputs Sequential Circuits Outputs depend on current and previous inputs Requires separating

More information

EE 42/100 Lecture 24: Latches and Flip Flops. Rev B 4/21/2010 (2:04 PM) Prof. Ali M. Niknejad

EE 42/100 Lecture 24: Latches and Flip Flops. Rev B 4/21/2010 (2:04 PM) Prof. Ali M. Niknejad A. M. Niknejad University of California, Berkeley EE 100 / 42 Lecture 24 p. 1/20 EE 42/100 Lecture 24: Latches and Flip Flops ELECTRONICS Rev B 4/21/2010 (2:04 PM) Prof. Ali M. Niknejad University of California,

More information

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies ETEC 2301 Programmable Logic Devices Chapter 10 Counters Shawnee State University Department of Industrial and Engineering Technologies Copyright 2007 by Janna B. Gallaher Asynchronous Counter Operation

More information

Sequential Circuit Design

Sequential Circuit Design Sequential Circuit Design Lan-Da Van ( 倫 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C. Fall, 2009 ldvan@cs.nctu.edu.tw http://www.cs.nctu.edu.tw/~ldvan/ Outlines

More information

Lecture 10: Sequential Circuits

Lecture 10: Sequential Circuits Introduction to CMOS VLSI esign Lecture 10: Sequential Circuits avid Harris Harvey Mudd College Spring 2004 Outline q Sequencing q Sequencing Element esign q Max and Min-elay q Clock Skew q Time Borrowing

More information

Lecture 11: Sequential Circuit Design

Lecture 11: Sequential Circuit Design Lecture 11: Sequential Circuit esign Outline Sequencing Sequencing Element esign Max and Min-elay Clock Skew Time Borrowing Two-Phase Clocking 2 Sequencing Combinational logic output depends on current

More information

Computer organization

Computer organization Computer organization Computer design an application of digital logic design procedures Computer = processing unit + memory system Processing unit = control + datapath Control = finite state machine inputs

More information

Flip-Flops and Sequential Circuit Design. ECE 152A Winter 2012

Flip-Flops and Sequential Circuit Design. ECE 152A Winter 2012 Flip-Flops and Sequential Circuit Design ECE 52 Winter 22 Reading ssignment Brown and Vranesic 7 Flip-Flops, Registers, Counters and a Simple Processor 7.5 T Flip-Flop 7.5. Configurable Flip-Flops 7.6

More information

Flip-Flops and Sequential Circuit Design

Flip-Flops and Sequential Circuit Design Flip-Flops and Sequential Circuit Design ECE 52 Winter 22 Reading ssignment Brown and Vranesic 7 Flip-Flops, Registers, Counters and a Simple Processor 7.5 T Flip-Flop 7.5. Configurable Flip-Flops 7.6

More information

Vending Machine using Verilog

Vending Machine using Verilog Vending Machine using Verilog Ajay Sharma 3rd May 05 Contents 1 Introduction 2 2 Finite State Machine 3 2.1 MOORE.............................. 3 2.2 MEALY.............................. 4 2.3 State Diagram...........................

More information

Topics of Chapter 5 Sequential Machines. Memory elements. Memory element terminology. Clock terminology

Topics of Chapter 5 Sequential Machines. Memory elements. Memory element terminology. Clock terminology Topics of Chapter 5 Sequential Machines Memory elements Memory elements. Basics of sequential machines. Clocking issues. Two-phase clocking. Testing of combinational (Chapter 4) and sequential (Chapter

More information

Experiment # 9. Clock generator circuits & Counters. Eng. Waleed Y. Mousa

Experiment # 9. Clock generator circuits & Counters. Eng. Waleed Y. Mousa Experiment # 9 Clock generator circuits & Counters Eng. Waleed Y. Mousa 1. Objectives: 1. Understanding the principles and construction of Clock generator. 2. To be familiar with clock pulse generation

More information

ENEE 244 (01**). Spring 2006. Homework 5. Due back in class on Friday, April 28.

ENEE 244 (01**). Spring 2006. Homework 5. Due back in class on Friday, April 28. ENEE 244 (01**). Spring 2006 Homework 5 Due back in class on Friday, April 28. 1. Fill up the function table (truth table) for the following latch. How is this latch related to those described in the lectures

More information

Sequential Logic Design Principles.Latches and Flip-Flops

Sequential Logic Design Principles.Latches and Flip-Flops Sequential Logic Design Principles.Latches and Flip-Flops Doru Todinca Department of Computers Politehnica University of Timisoara Outline Introduction Bistable Elements Latches and Flip-Flops S-R Latch

More information

Memory Elements. Combinational logic cannot remember

Memory Elements. Combinational logic cannot remember Memory Elements Combinational logic cannot remember Output logic values are function of inputs only Feedback is needed to be able to remember a logic value Memory elements are needed in most digital logic

More information

Lab #5: Design Example: Keypad Scanner and Encoder - Part 1 (120 pts)

Lab #5: Design Example: Keypad Scanner and Encoder - Part 1 (120 pts) Dr. Greg Tumbush, gtumbush@uccs.edu Lab #5: Design Example: Keypad Scanner and Encoder - Part 1 (120 pts) Objective The objective of lab assignments 5 through 9 are to systematically design and implement

More information

7. Latches and Flip-Flops

7. Latches and Flip-Flops Chapter 7 Latches and Flip-Flops Page 1 of 18 7. Latches and Flip-Flops Latches and flip-flops are the basic elements for storing information. One latch or flip-flop can store one bit of information. The

More information

CS311 Lecture: Sequential Circuits

CS311 Lecture: Sequential Circuits CS311 Lecture: Sequential Circuits Last revised 8/15/2007 Objectives: 1. To introduce asynchronous and synchronous flip-flops (latches and pulsetriggered, plus asynchronous preset/clear) 2. To introduce

More information

Cascaded Counters. Page 1 BYU

Cascaded Counters. Page 1 BYU Cascaded Counters Page 1 Mod-N Counters Generally we are interested in counters that count up to specific count values Not just powers of 2 A mod-n counter has N states Counts from 0 to N-1 then rolls

More information

Finite State Machine. RTL Hardware Design by P. Chu. Chapter 10 1

Finite State Machine. RTL Hardware Design by P. Chu. Chapter 10 1 Finite State Machine Chapter 10 1 Outline 1. Overview 2. FSM representation 3. Timing and performance of an FSM 4. Moore machine versus Mealy machine 5. VHDL description of FSMs 6. State assignment 7.

More information

Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng

Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng Digital Logic Design Basics Combinational Circuits Sequential Circuits Pu-Jen Cheng Adapted from the slides prepared by S. Dandamudi for the book, Fundamentals of Computer Organization and Design. Introduction

More information

A New Paradigm for Synchronous State Machine Design in Verilog

A New Paradigm for Synchronous State Machine Design in Verilog A New Paradigm for Synchronous State Machine Design in Verilog Randy Nuss Copyright 1999 Idea Consulting Introduction Synchronous State Machines are one of the most common building blocks in modern digital

More information

Module 3: Floyd, Digital Fundamental

Module 3: Floyd, Digital Fundamental Module 3: Lecturer : Yongsheng Gao Room : Tech - 3.25 Email : yongsheng.gao@griffith.edu.au Structure : 6 lectures 1 Tutorial Assessment: 1 Laboratory (5%) 1 Test (20%) Textbook : Floyd, Digital Fundamental

More information

LAB #4 Sequential Logic, Latches, Flip-Flops, Shift Registers, and Counters

LAB #4 Sequential Logic, Latches, Flip-Flops, Shift Registers, and Counters LAB #4 Sequential Logic, Latches, Flip-Flops, Shift Registers, and Counters LAB OBJECTIVES 1. Introduction to latches and the D type flip-flop 2. Use of actual flip-flops to help you understand sequential

More information

Combinational Logic Design Process

Combinational Logic Design Process Combinational Logic Design Process Create truth table from specification Generate K-maps & obtain logic equations Draw logic diagram (sharing common gates) Simulate circuit for design verification Debug

More information

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

L4: Sequential Building Blocks (Flip-flops, Latches and Registers) L4: Sequential Building Blocks (Flip-flops, Latches and Registers) Acknowledgements: Materials in this lecture are courtesy of the following sources and are used with permission. Prof. Randy Katz (Unified

More information

Lesson 12 Sequential Circuits: Flip-Flops

Lesson 12 Sequential Circuits: Flip-Flops Lesson 12 Sequential Circuits: Flip-Flops 1. Overview of a Synchronous Sequential Circuit We saw from last lesson that the level sensitive latches could cause instability in a sequential system. This instability

More information

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012 CDA 3200 Digital Systems Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012 Outline SR Latch D Latch Edge-Triggered D Flip-Flop (FF) S-R Flip-Flop (FF) J-K Flip-Flop (FF) T Flip-Flop

More information

FINITE STATE MACHINE: PRINCIPLE AND PRACTICE

FINITE STATE MACHINE: PRINCIPLE AND PRACTICE CHAPTER 10 FINITE STATE MACHINE: PRINCIPLE AND PRACTICE A finite state machine (FSM) is a sequential circuit with random next-state logic. Unlike the regular sequential circuit discussed in Chapters 8

More information

Sequential Logic. (Materials taken from: Principles of Computer Hardware by Alan Clements )

Sequential Logic. (Materials taken from: Principles of Computer Hardware by Alan Clements ) Sequential Logic (Materials taken from: Principles of Computer Hardware by Alan Clements ) Sequential vs. Combinational Circuits Combinatorial circuits: their outputs are computed entirely from their present

More information

Digital Systems Based on Principles and Applications of Electrical Engineering/Rizzoni (McGraw Hill

Digital Systems Based on Principles and Applications of Electrical Engineering/Rizzoni (McGraw Hill Digital Systems Based on Principles and Applications of Electrical Engineering/Rizzoni (McGraw Hill Objectives: Analyze the operation of sequential logic circuits. Understand the operation of digital counters.

More information

Chapter 7. Registers & Register Transfers. J.J. Shann. J. J. Shann

Chapter 7. Registers & Register Transfers. J.J. Shann. J. J. Shann Chapter 7 Registers & Register Transfers J. J. Shann J.J. Shann Chapter Overview 7- Registers and Load Enable 7-2 Register Transfers 7-3 Register Transfer Operations 7-4 A Note for VHDL and Verilog Users

More information

EXPERIMENT 2 TRAFFIC LIGHT CONTROL SYSTEM FOR AN INTERSECTION USING S7-300 PLC

EXPERIMENT 2 TRAFFIC LIGHT CONTROL SYSTEM FOR AN INTERSECTION USING S7-300 PLC YEDITEPE UNIVERSITY ENGINEERING & ARCHITECTURE FACULTY INDUSTRIAL ELECTRONICS LABORATORY EE 432 INDUSTRIAL ELECTRONICS EXPERIMENT 2 TRAFFIC LIGHT CONTROL SYSTEM FOR AN INTERSECTION USING S7-300 PLC Introduction:

More information

ECE 451 Verilog Exercises. Sept 14, 2007. James Barnes (James.Barnes@colostate.edu)

ECE 451 Verilog Exercises. Sept 14, 2007. James Barnes (James.Barnes@colostate.edu) ECE 451 Verilog Exercises Sept 14, 2007 James Barnes (James.Barnes@colostate.edu) Organization These slides give a series of self-paced exercises. Read the specification of each exercise and write your

More information

ECE380 Digital Logic

ECE380 Digital Logic ECE38 igital Logic Flip-Flops, Registers and Counters: Flip-Flops r.. J. Jackson Lecture 25- Flip-flops The gated latch circuits presented are level sensitive and can change states more than once during

More information

Lecture 8: Synchronous Digital Systems

Lecture 8: Synchronous Digital Systems Lecture 8: Synchronous Digital Systems The distinguishing feature of a synchronous digital system is that the circuit only changes in response to a system clock. For example, consider the edge triggered

More information

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute. 2nd (Spring) term 2012/2013

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute. 2nd (Spring) term 2012/2013 DIGITAL TECHNICS II Dr. Bálint Pődör Óbuda University, Microelectronics and Technology Institute 4. LECTURE: COUNTERS AND RELATED 2nd (Spring) term 2012/2013 1 4. LECTURE: COUNTERS AND RELATED 1. Counters,

More information

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas Take-Home Exercise Assume you want the counter below to count mod-6 backward. That is, it would count 0-5-4-3-2-1-0, etc. Assume it is reset on startup, and design the wiring to make the counter count

More information

Design Example: Counters. Design Example: Counters. 3-Bit Binary Counter. 3-Bit Binary Counter. Other useful counters:

Design Example: Counters. Design Example: Counters. 3-Bit Binary Counter. 3-Bit Binary Counter. Other useful counters: Design Eample: ers er: a sequential circuit that repeats a specified sequence of output upon clock pulses. A,B,C,, Z. G, O, T, E, R, P, S,!.,,,,,,,7. 7,,,,,,,.,,,,,,,,,,,. Binary counter: follows the binary

More information

Counters and Decoders

Counters and Decoders Physics 3330 Experiment #10 Fall 1999 Purpose Counters and Decoders In this experiment, you will design and construct a 4-bit ripple-through decade counter with a decimal read-out display. Such a counter

More information

Finite State Machine Design A Vending Machine

Finite State Machine Design A Vending Machine LAB 6 Finite State Machine Design A Vending Machine You will learn how turn an informal sequential circuit description into a formal finite-state machine model, how to express it using ABEL, how to simulate

More information

Counters. Present State Next State A B A B 0 0 0 1 0 1 1 0 1 0 1 1 1 1 0 0

Counters. Present State Next State A B A B 0 0 0 1 0 1 1 0 1 0 1 1 1 1 0 0 ounter ounters ounters are a specific type of sequential circuit. Like registers, the state, or the flip-flop values themselves, serves as the output. The output value increases by one on each clock cycle.

More information

Modeling Registers and Counters

Modeling Registers and Counters Lab Workbook Introduction When several flip-flops are grouped together, with a common clock, to hold related information the resulting circuit is called a register. Just like flip-flops, registers may

More information

EE360: Digital Design I Course Syllabus

EE360: Digital Design I Course Syllabus : Course Syllabus Dr. Mohammad H. Awedh Fall 2008 Course Description This course introduces students to the basic concepts of digital systems, including analysis and design. Both combinational and sequential

More information

Sequential Logic: Clocks, Registers, etc.

Sequential Logic: Clocks, Registers, etc. ENEE 245: igital Circuits & Systems Lab Lab 2 : Clocks, Registers, etc. ENEE 245: igital Circuits and Systems Laboratory Lab 2 Objectives The objectives of this laboratory are the following: To design

More information

Introduction to CMOS VLSI Design (E158) Lecture 8: Clocking of VLSI Systems

Introduction to CMOS VLSI Design (E158) Lecture 8: Clocking of VLSI Systems Harris Introduction to CMOS VLSI Design (E158) Lecture 8: Clocking of VLSI Systems David Harris Harvey Mudd College David_Harris@hmc.edu Based on EE271 developed by Mark Horowitz, Stanford University MAH

More information

Chapter 9 Latches, Flip-Flops, and Timers

Chapter 9 Latches, Flip-Flops, and Timers ETEC 23 Programmable Logic Devices Chapter 9 Latches, Flip-Flops, and Timers Shawnee State University Department of Industrial and Engineering Technologies Copyright 27 by Janna B. Gallaher Latches A temporary

More information

State Machines in VHDL

State Machines in VHDL State Machines in VHDL Implementing state machines in VHDL is fun and easy provided you stick to some fairly well established forms. These styles for state machine coding given here is not intended to

More information

Digital Controller for Pedestrian Crossing and Traffic Lights

Digital Controller for Pedestrian Crossing and Traffic Lights Project Objective: - To design and simulate, a digital controller for traffic and pedestrian lights at a pedestrian crossing using Microsim Pspice The controller must be based on next-state techniques

More information

Theory of Logic Circuits. Laboratory manual. Exercise 3

Theory of Logic Circuits. Laboratory manual. Exercise 3 Zakład Mikroinformatyki i Teorii Automatów yfrowych Theory of Logic ircuits Laboratory manual Exercise 3 Bistable devices 2008 Krzysztof yran, Piotr zekalski (edt.) 1. lassification of bistable devices

More information

(1) /30 (2) /30 (3) /40 TOTAL /100

(1) /30 (2) /30 (3) /40 TOTAL /100 Your Name: SI Number: UNIVERSITY OF CALIFORNIA AT BERKELEY BERKELEY AVIS IRVINE LOS ANGELES RIVERSIE SAN IEGO SAN FRANCISCO epartment of Electrical Engineering and Computer Sciences SANTA BARBARA SANTA

More information

Flip-Flops, Registers, Counters, and a Simple Processor

Flip-Flops, Registers, Counters, and a Simple Processor June 8, 22 5:56 vra235_ch7 Sheet number Page number 349 black chapter 7 Flip-Flops, Registers, Counters, and a Simple Processor 7. Ng f3, h7 h6 349 June 8, 22 5:56 vra235_ch7 Sheet number 2 Page number

More information

Having read this workbook you should be able to: recognise the arrangement of NAND gates used to form an S-R flip-flop.

Having read this workbook you should be able to: recognise the arrangement of NAND gates used to form an S-R flip-flop. Objectives Having read this workbook you should be able to: recognise the arrangement of NAND gates used to form an S-R flip-flop. describe how such a flip-flop can be SET and RESET. describe the disadvantage

More information

ASYNCHRONOUS COUNTERS

ASYNCHRONOUS COUNTERS LB no.. SYNCHONOUS COUNTES. Introduction Counters are sequential logic circuits that counts the pulses applied at their clock input. They usually have 4 bits, delivering at the outputs the corresponding

More information

Lecture-3 MEMORY: Development of Memory:

Lecture-3 MEMORY: Development of Memory: Lecture-3 MEMORY: It is a storage device. It stores program data and the results. There are two kind of memories; semiconductor memories & magnetic memories. Semiconductor memories are faster, smaller,

More information

CHAPTER 11: Flip Flops

CHAPTER 11: Flip Flops CHAPTER 11: Flip Flops In this chapter, you will be building the part of the circuit that controls the command sequencing. The required circuit must operate the counter and the memory chip. When the teach

More information

Lecture 7: Clocking of VLSI Systems

Lecture 7: Clocking of VLSI Systems Lecture 7: Clocking of VLSI Systems MAH, AEN EE271 Lecture 7 1 Overview Reading Wolf 5.3 Two-Phase Clocking (good description) W&E 5.5.1, 5.5.2, 5.5.3, 5.5.4, 5.5.9, 5.5.10 - Clocking Note: The analysis

More information

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

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute DIGITAL TECHNICS II Dr. Bálint Pődör Óbuda University, Microelectronics and Technology Institute 2. LECTURE: ELEMENTARY SEUENTIAL CIRCUITS: FLIP-FLOPS 1st year BSc course 2nd (Spring) term 2012/2013 1

More information

Modeling Latches and Flip-flops

Modeling Latches and Flip-flops Lab Workbook Introduction Sequential circuits are digital circuits in which the output depends not only on the present input (like combinatorial circuits), but also on the past sequence of inputs. In effect,

More information

Asynchronous Counters. Asynchronous Counters

Asynchronous Counters. Asynchronous Counters Counters and State Machine Design November 25 Asynchronous Counters ENGI 25 ELEC 24 Asynchronous Counters The term Asynchronous refers to events that do not occur at the same time With respect to counter

More information

Counters are sequential circuits which "count" through a specific state sequence.

Counters are sequential circuits which count through a specific state sequence. Counters Counters are sequential circuits which "count" through a specific state sequence. They can count up, count down, or count through other fixed sequences. Two distinct types are in common usage:

More information

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter Description: The NTE2053 is a CMOS 8 bit successive approximation Analog to Digital converter in a 20 Lead DIP type package which uses a differential

More information

So far we have investigated combinational logic for which the output of the logic devices/circuits depends only on the present state of the inputs.

So far we have investigated combinational logic for which the output of the logic devices/circuits depends only on the present state of the inputs. equential Logic o far we have investigated combinational logic for which the output of the logic devices/circuits depends only on the present state of the inputs. In sequential logic the output of the

More information

Design Verification & Testing Design for Testability and Scan

Design Verification & Testing Design for Testability and Scan Overview esign for testability (FT) makes it possible to: Assure the detection of all faults in a circuit Reduce the cost and time associated with test development Reduce the execution time of performing

More information

Digital Design with Synthesizable VHDL

Digital Design with Synthesizable VHDL Digital Design with Synthesizable VHDL Prof. Stephen A. Edwards Columbia University Spring 2012 Combinational Logic in a Dataflow Style Hierarchy: Instantiating Components (entities) Combinational Logic

More information

CHAPTER 3 Boolean Algebra and Digital Logic

CHAPTER 3 Boolean Algebra and Digital Logic CHAPTER 3 Boolean Algebra and Digital Logic 3.1 Introduction 121 3.2 Boolean Algebra 122 3.2.1 Boolean Expressions 123 3.2.2 Boolean Identities 124 3.2.3 Simplification of Boolean Expressions 126 3.2.4

More information

Digital Electronics Part I Combinational and Sequential Logic. Dr. I. J. Wassell

Digital Electronics Part I Combinational and Sequential Logic. Dr. I. J. Wassell Digital Electronics Part I Combinational and Sequential Logic Dr. I. J. Wassell Introduction Aims To familiarise students with Combinational logic circuits Sequential logic circuits How digital logic gates

More information

Digital Design Verification

Digital Design Verification Digital Design Verification Course Instructor: Debdeep Mukhopadhyay Dept of Computer Sc. and Engg. Indian Institute of Technology Madras, Even Semester Course No: CS 676 1 Verification??? What is meant

More information

RAPID PROTOTYPING OF DIGITAL SYSTEMS Second Edition

RAPID PROTOTYPING OF DIGITAL SYSTEMS Second Edition RAPID PROTOTYPING OF DIGITAL SYSTEMS Second Edition A Tutorial Approach James O. Hamblen Georgia Institute of Technology Michael D. Furman Georgia Institute of Technology KLUWER ACADEMIC PUBLISHERS Boston

More information

路 論 Chapter 15 System-Level Physical Design

路 論 Chapter 15 System-Level Physical Design Introduction to VLSI Circuits and Systems 路 論 Chapter 15 System-Level Physical Design Dept. of Electronic Engineering National Chin-Yi University of Technology Fall 2007 Outline Clocked Flip-flops CMOS

More information

MICROPROCESSOR. Exclusive for IACE Students www.iace.co.in iacehyd.blogspot.in Ph: 9700077455/422 Page 1

MICROPROCESSOR. Exclusive for IACE Students www.iace.co.in iacehyd.blogspot.in Ph: 9700077455/422 Page 1 MICROPROCESSOR A microprocessor incorporates the functions of a computer s central processing unit (CPU) on a single Integrated (IC), or at most a few integrated circuit. It is a multipurpose, programmable

More information

Wiki Lab Book. This week is practice for wiki usage during the project.

Wiki Lab Book. This week is practice for wiki usage during the project. Wiki Lab Book Use a wiki as a lab book. Wikis are excellent tools for collaborative work (i.e. where you need to efficiently share lots of information and files with multiple people). This week is practice

More information

PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 OUTCOME 3 PART 1

PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 OUTCOME 3 PART 1 UNIT 22: PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 OUTCOME 3 PART 1 This work covers part of outcome 3 of the Edexcel standard module: Outcome 3 is the most demanding

More information

DIGITAL ELECTRONICS. Counters. By: Electrical Engineering Department

DIGITAL ELECTRONICS. Counters. By: Electrical Engineering Department Counters By: Electrical Engineering Department 1 Counters Upon completion of the chapter, students should be able to:.1 Understand the basic concepts of asynchronous counter and synchronous counters, and

More information

Digital Design with VHDL

Digital Design with VHDL Digital Design with VHDL CSE 560M Lecture 5 Shakir James Shakir James 1 Plan for Today Announcement Commentary due Wednesday HW1 assigned today. Begin immediately! Questions VHDL help session Assignment

More information

Layout of Multiple Cells

Layout of Multiple Cells Layout of Multiple Cells Beyond the primitive tier primitives add instances of primitives add additional transistors if necessary add substrate/well contacts (plugs) add additional polygons where needed

More information

CpE358/CS381. Switching Theory and Logical Design. Class 4

CpE358/CS381. Switching Theory and Logical Design. Class 4 Switching Theory and Logical Design Class 4 1-122 Today Fundamental concepts of digital systems (Mano Chapter 1) Binary codes, number systems, and arithmetic (Ch 1) Boolean algebra (Ch 2) Simplification

More information

Master/Slave Flip Flops

Master/Slave Flip Flops Master/Slave Flip Flops Page 1 A Master/Slave Flip Flop ( Type) Gated latch(master) Gated latch (slave) 1 Gate Gate GATE Either: The master is loading (the master in on) or The slave is loading (the slave

More information

Systems I: Computer Organization and Architecture

Systems I: Computer Organization and Architecture Systems I: omputer Organization and Architecture Lecture 8: Registers and ounters Registers A register is a group of flip-flops. Each flip-flop stores one bit of data; n flip-flops are required to store

More information

Design of Digital Circuits (SS16)

Design of Digital Circuits (SS16) Design of Digital Circuits (SS16) 252-0014-00L (6 ECTS), BSc in CS, ETH Zurich Lecturers: Srdjan Capkun, D-INFK, ETH Zurich Frank K. Gürkaynak, D-ITET, ETH Zurich Labs: Der-Yeuan Yu dyu@inf.ethz.ch Website:

More information

Set-Reset (SR) Latch

Set-Reset (SR) Latch et-eset () Latch Asynchronous Level sensitive cross-coupled Nor gates active high inputs (only one can be active) + + Function 0 0 0 1 0 1 eset 1 0 1 0 et 1 1 0-? 0-? Indeterminate cross-coupled Nand gates

More information