Counters. In class excercise How to implement a “counter”, which will count as 0,3,1,4,5,7,0,3,1,…… Q2Q1Q0D2D1D0 000 001 010 011 100 101 110 111.

Slides:



Advertisements
Similar presentations
ENGIN112 L23: Finite State Machine Design Procedure October 27, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 23 Finite State Machine.
Advertisements

Finite State Machine Continued
General Sequential Design
Finite State Machines (FSMs)
Lecture #24 Page 1 EE 367 – Logic Design Lecture #24 Agenda 1.State Machines Review Announcements 1.n/a.
State-machine structure (Mealy)
State Machine Design Procedure
Analysis of Clocked Sequential Circuits
Give qualifications of instructors: DAP
Sequential Logic Computer Organization Ellen Walker Hiram College Figures from Computer Organization and Design 3ed, D.A. Patterson & J.L. Hennessey, Morgan.
Circuits require memory to store intermediate data
Some examples Paolo PRINETTO Politecnico di Torino (Italy) University of Illinois at Chicago, IL (USA)
CS 151 Digital Systems Design Lecture 37 Register Transfer Level
CS 151 Digital Systems Design Lecture 25 State Reduction and Assignment.
ECE 331 – Digital System Design
Give qualifications of instructors: DAP
Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Chapter #8: Finite State Machine Design Finite State.
1 COMP541 State Machines Montek Singh Feb 6, 2007.
Spring 2002EECS150 - Lec15-seq2 Page 1 EECS150 - Digital Design Lecture 15 - Sequential Circuits II (Finite State Machines revisited) March 14, 2002 John.
ECE 301 – Digital Electronics Introduction to Sequential Logic Circuits (aka. Finite State Machines) and FSM Analysis (Lecture #17)
ECE 331 – Digital Systems Design Introduction to Sequential Logic Circuits (aka. Finite State Machines) and FSM Analysis (Lecture #19)
ENGIN112 L25: State Reduction and Assignment October 31, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 25 State Reduction and Assignment.
Sequential Circuits Chapter 4 S. Dandamudi To be used with S. Dandamudi, “Fundamentals of Computer Organization and Design,” Springer,  S.
Lecture 10 Topics: Sequential circuits Basic concepts Clocks
SEQUENTIAL CIRCUITS Introduction
ECE 331 – Digital Systems Design Sequential Logic Circuits: FSM Design (Lecture #20)
1 COMP541 State Machines Montek Singh Feb 8, 2012.
Elevator Controller We’re hired to design a digital elevator controller for a four-floor building st try: Design a counter that counts up.
Circuit, State Diagram, State Table
Digital Logic Design Sequential circuits
Advanced Digital Circuits ECET 146 Week 5 Professor Iskandar Hack ET 221G, Me as I typed this slides.
Introduction to Sequential Logic Design Finite State-Machine Design.
2017/4/24 CHAPTER 6 Counters Chapter 5 (Sections )
1 Lecture 22 Sequential Circuits Analysis. 2 Combinational vs. Sequential  Combinational Logic Circuit  Output is a function only of the present inputs.
1 CSE370, Lecture 19 Lecture 19 u Logistics n Lab 8 this week to be done in pairs íFind a partner before your lab period íOtherwise you will have to wait.
Module : FSM Topic : types of FSM. Two types of FSM The instant of transition from the present to the next can be completely controlled by a clock; additionally,
Counters. In class excercise How to implement a “counter”, which will count as 0,3,1,4,5,7,0,3,1,…… Q2Q1Q0D2D1D
CHAPTER 8 - COUNTER -.
Computer Organization & Programming Chapter 5 Synchronous Components.
Assignment 8 solutions 1) Design and draw combinational logic to perform multiplication of two 2-bit numbers (i.e. each 0 to 3) producing a 4-bit result.
DLD Lecture 26 Finite State Machine Design Procedure.
Digital Logic Design.
1 Thus far what we only dealt with a pure combination circuit That means output was simply dependent on the current input However, output may depend on.
Problem Class 3 - Slide 1 PYKC 17 Nov 2015 E2.1 Digital Electronics Problem Class 3 State Machines (Problem Sheet 3) Peter Cheung Department of Electrical.
Digital System Design using VHDL

1 COMP541 Finite State Machines - 1 Montek Singh Sep 22, 2014.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
1 COMP541 Sequential Logic – 2: Finite State Machines Montek Singh Feb 29, 2016.
Exam-like questions.
Clocks A clock is a free-running signal with a cycle time.
Adapted by Dr. Adel Ammar
Crazy Hat & Candy Machine
COMP541 Sequential Logic – 2: Finite State Machines
Sequential Circuit: Counter
ECE 301 – Digital Electronics
Assistant Prof. Fareena Saqib Florida Institute of Technology
FINITE STATE MACHINES (FSMs)
CSE 140L Discussion Finite State Machines.
CSE 370 – Winter Sequential Logic-2 - 1
Introduction to Sequential Circuits
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
Finite State Machines.
Sequential Design Example
Counters.
ECE 352 Digital System Fundamentals
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
Outline Registers Counters 5/11/2019.
EGR 2131 Unit 12 Synchronous Sequential Circuits
Finite State Machine Continued
Presentation transcript:

Counters

In class excercise How to implement a “counter”, which will count as 0,3,1,4,5,7,0,3,1,…… Q2Q1Q0D2D1D

Finite State Machines

Parity checking Design a parity checking circuit that has one input X, and one output O. X may change every clock cycle. The change happens at the falling edge. The circuit samples the input at every rising edge of the clock. If the input is 1, consider as read a 1, else read a 0. O is 1 if all the bits read so far contains an odd number of 1s and 0 otherwise.

Parity checking Note that the output of the circuit depends on ALL past inputs. So one possible implementation is to remember all past inputs. Obviously bad…

Parity checking A better implementation is to “summarize” the past inputs into some “states.” For what we are concerned about, – Knowing the current state, the value of the output can be uniquely determined. – Given the current state, the future state transition does not depend on the past inputs. Note that – The states are just some binary numbers. – The number of states is significantly less than the number of input combinations, so we have a better circuit.

The difference from the counters Counters also have states. For example, the state of the 3-bit counters are 0,1,2,3,4,5,6,7. But counters have only the clk input, and is driven only by the clk. Knowing what the current state is, we know exactly what the next state should be. Here, obviously, the next state also depends on the input X. So we are moving to a more sophisticated example.

States Finding out what the states should be is a bit of art. Problems are different, so the solutions are also different. Experience will help. What the states of the parity checking circuit should be?

State The state is the parity of the bits read so far. Two states: S0 and S1. – S0: the bits have parity 0. – S1: the bits have parity 1.

State Diagram The state transition diagram. – Draw a circle around the state. – Draw arrows from one state to another. – Beside the arrows, show the values of the inputs that caused this transition. S0S1 X = 1 X = 0 X=1 X=0 X=1 X=0

Assign states Need to assign binary number representations to the states. Only one bit is needed. Let S0=0, S1=1.

Next State Function QXD D = Q^X

Output function The circuit should generate the output. Clearly, the output function is O=Q.

Another FSM example – A sequence detector One input X, and one output O. X may change every clock cycle. The change happens at the falling edge. The circuit samples the input at every rising edge of the clock. If the input is 1, consider as read a 1, else read a 0. O is 1 (for one clock cycle, from positive edge to positive edge) if the last three bits read are 101.

Suggestions? Do we need to remember any states? What states do we need to remember?

Suggestions? Maybe we just connect 3 Dffs and output 1 if Q2Q1Q0=101? That is, we need to remember 8 states. Can do better than that. Remember what fractions of the sequence I have got.

4 states S0: got nothing. The initial state. S1: got 1. S2: got 10. S3: got 101. S0S1 X = 1 X = 0 S2S3 X=0 X=1

Assign states S0 = 00 S1 = 01 S2 = 10 S3 = 11

Next State Function Q1Q0XD1D

Next State Function Q1Q0XD1D D1 = (Q0&~X)|(Q1&~Q0&X) D0 = X

The output function Clearly, O = Q1&Q0.