Lab 7 : Overview State Machine : Moore Model Concept in designing a Vending Machine.

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 Machines (FSMs)
State-machine structure (Mealy)
Classification of Digital Circuits  Combinational. Output depends only on current input values.  Sequential. Output depends on current input values and.
Computing Machinery Chapter 5: Sequential Circuits.
Circuits require memory to store intermediate data
CS 151 Digital Systems Design Lecture 21 Analyzing Sequential Circuits.
1 Lecture 23 More Sequential Circuits Analysis. 2 Analysis of Combinational Vs. Sequential Circuits °Combinational : Boolean Equations Truth Table Output.
CS 151 Digital Systems Design Lecture 25 State Reduction and Assignment.
Sequential Circuit - Counter -
Sequential Circuit Design
FSMs 1 Sequential logic implementation  Sequential circuits  primitive sequential elements  combinational logic  Models for representing sequential.
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.
Sequential Circuit Design
Overview Sequential Circuit Design Specification Formulation
Logic and Computer Design Fundamentals Registers and Counters
CS 140L Lecture 7 Professor CK Cheng 11/12/02. Transformation between Mealy and Moore Machines Algorithm: 1) For each NS, z = S i, j create a state S.
VII - Finite State Machines © Copyright 2004, Gaetano Borriello and Randy H. Katz 1 Finite State Machines Sequential circuits  primitive sequential elements.
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.
So far, all of the logic circuits we have studied were basically based on the analysis and design of combinational digital circuits. The other major aspect.
Sequential Circuit - Counter -
Lecture 17 General finite state machine (FSM) design
Lecture 10 Topics: Sequential circuits Basic concepts Clocks
SEQUENTIAL CIRCUITS Introduction
Digital Computer Design Fundamental
T Flip-Flop A T (toggle) flip-flop is a complementing flip-flop and can be obtained from a JK flip-flop when the two inputs are tied together. When T =
Chap 4. Sequential Circuits
1 EECS 465: Digital Systems Lecture Notes # 8 Sequential Circuit (Finite-State Machine) Design SHANTANU DUTT Department of Electrical and Computer Engineering.
VII - Finite State Machines © Copyright 2004, Gaetano Borriello and Randy H. Katz 1 Finite State Machines (FSM) Sequential circuits  primitive sequential.
ECE 3130 – Digital Electronics and Design Lab 6 State Machines Fall 2012 Allan Guan.
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.
Announcements Assignment 8 posted –Due Friday Dec 2 nd. A bit longer than others. Project progress? Dates –Thursday 12/1 review lecture –Tuesday 12/6 project.
Introduction to State Machine
CHAPTER 8 - COUNTER -.
© BYU 13 COUNTERS Page 1 ECEn 224 COUNTERS Counters Transition Tables Moore Outputs Counter Timing.
1 CSE370, Lecture 18 Lecture 20 u Logistics n HW6 due Wednesday n Lab 7 this week (Tuesday exception) n Midterm 2 Friday (covers material up to simple.
CSIE.NCTU, DL-6-1 Basic Design Approach of FSM Six Step Process 1. Understand the statement of the Specification 2. Obtain an abstract specification of.
DLD Lecture 26 Finite State Machine Design Procedure.
1 Finite State Machines (FSMs) Now that we understand sequential circuits, we can use them to build: Synchronous (Clocked) Finite State Machines Finite.
ANALYSIS OF SEQUENTIAL CIRCUITS by Dr. Amin Danial Asham.
CHAPTER 6 Sequential Circuits’ Analysis CHAPTER 6 Sequential Circuits’ Analysis Sichuan University Software College.
Sequential Circuit: Analysis BIL- 223 Logic Circuit Design Ege University Department of Computer Engineering.
Analysis and Synthesis of Synchronous Sequential Circuits A “synchronizing” pulse/edge signal (clock) controls the operation of the memory portion of the.
Lab 7 : Overview State Machine : Moore Model Concept in designing a Vending Machine.
Counters Transition Tables Moore Outputs Counter Timing

1 KU College of Engineering Elec 204: Digital Systems Design Lecture 13 Edge-Triggered FF Operation.
State Diagrams Tuesday, 12 September State diagram Graphical representation of a state table. –Provides the same information as a state table. –A.
1 Lecture 3: Modeling Sequential Logic in Verilog HDL.
Lecture #17: Clocked Synchronous State-Machine Analysis
Sequential Networks and Finite State Machines
Chapter #6: Sequential Logic Design
ANALYSIS OF SEQUENTIAL CIRCUITS
© Copyright 2004, Gaetano Borriello and Randy H. Katz
FIGURE 5.1 Block diagram of sequential circuit
Asynchronous Inputs of a Flip-Flop
Sequential Circuit - Counter -
T Flip-Flop A T (toggle) flip-flop is a complementing flip-flop and can be obtained from a JK flip-flop when the two inputs are tied together. When T.
FINITE STATE MACHINES (FSMs)
CSE 140L Discussion Finite State Machines.
Recap D flip-flop based counter Flip-flop transition table
Finite State Machines (FSMs)
CSE 370 – Winter Sequential Logic-2 - 1
Lecture 20 Logistics Last lecture Today HW6 due Wednesday
Lecture 22 Logistics Last lecture Today HW7 is due on Friday
Lecture 22 Logistics Last lecture Today HW7 is due on Friday
Presentation transcript:

Lab 7 : Overview State Machine : Moore Model Concept in designing a Vending Machine

State Machines ► State Machine must have  Input  State  Output ► State Machine are always clocked. ► 2 Common Types of State Machines : ► Moore Model :  Output DO NOT depend on the input condition but the output is per state basis ► Mealy Model :  Output does depend on the input and state conditions.

Comparison of Mealy and Moore Machine ► Mealy machines tend to have less states ► 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 may occur if one isn’t careful ► 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 clock edge

Moore Model Circuits ► Output depends only on the state of the flip-flop.  The output is included under a slash below the state in a circle.

State Diagram – Fig (b) XY State Output

Example of Moore Machines StateOutput A (00) 0 B (01) 1 C (10) 0 A/0 C/0 B/1 X = 1 X = 0 X = 1 X = 0 X = 1 INPUT STATE NAME OUTPUT Present State Input X Next State A (00) 0 C (10) 1 B (01) 0 1 C (10) 0 B (01) 1 A (00)

Example 2 : Moore Machines ► Output is high when input is twice (2) high in a row. 11 in a row = o/p high Present State Input X Next State S0 (00) 0 1 S1 (01) 0 S0 (00) 1 S2 (00) S2 (10) 0 S0 (00) 1 S2 (10) S0/0 S2/1 S1/0 X=0 X=1 X=0 X=1 X=0StateOutput S0 (00) 0 S1 (01) 0 S2 (10) 1

Mealy Model Circuits ► The directed lines are labeled by two binary numbers separated by a slash, e.g. 0/1 refers to input =0 and output=1 of the present state. ► Output depends on the state of the flip-flop and input.

State Diagram – Fig (a) Input Output State

Example of Mealy Machines A C B X = 1/1 X = 0/0 X = 1/0 X = 0/1 X = 0/0 X = 1/0 INPUT STATE NAME OUTPUT Present State Input X Next State Output A (00) 0 C (10) 0 1 B (01) C (10) 0 C (01) 0 B (01) 1 1 A (00) 0

Example 2 : Mealy Machines ► Output is high when input is twice (2) high in a row. 11 in a row = o/p high S0S1 X=1/0 X=0/0 X=1/1 Present State Input X Next State Output S0 (00) S1 (01) 0 0 S0 (00) 0 1 S1 (01) 1

Lab 7 : Task ► Design Vending Machine (VM) using Moore Model ► VM deliver canned drink = 30 cent ► VM accept 10 cent & 20 cent only ► VM has only one coin slot, meaning it can only receive coins one at a time. (2 or more coins insert at same time is impossible to happen) ► Excessive coin values will release the correct change apart from releasing the can drink ► Include a RESET to manually reset the VM to its origin, meaning if coins has been inserted but RESET is activated, the coins should be released and VM is back to its original state with no value inserted.

Lab 7 : Requirements & Hints ► Input = coins (10c or 20c), whereby : X = 10c, Y= 20c ► Determine the number of states to achieve 30c:  10c+10c+10c, balance = none  10c+20c, balance = none  10c+10c+20c, balance = 10c  20c+10c, balance = none  20c+20c, balance = 10c ► Output should be 3-bit:  Tin out, 20c bal, 10c bal X (20c) Y (10c) Action XY No coins inserted XY 10c inserted XY 20c inserted XY Invalid action INPUT

Lab 7 : Moore State Machine ► Start Drawing your state machine with the info that u have in hand. ► Next is to build-up your present state and next state table use D Flip- flop in your design. ► Notice that you have 5 variables. So how do you do your K-Map?....use 5 variable method. Present State XY Next State Q2Q1Q0 A (000)

K-Map with 5 variables ► Split into 2 K-Map of 4x4 ► 1 st K-Map with the 5 th variable = 0 ► 2 nd K-Map with the 5 th variable = Q1 Q0 X Y Q1 Q0 Q2 = 0Q2 = 1 D0 = Q1Q0 D0 = Q2(Q1Q0) D0 = Q1Q0X + Q2Y D0 = Q2(Q1Q0X + Q2Y) D0 (total) = Q2(Q1Q0) + Q2(Q1Q0 + Q2Y)

K-Map with 5 variables ► Example Q1 Q0 X Y Q1 Q0 Q2 = 0Q2 = 1 D0 = Q1Q0 D0 = Q2(Q1Q0) D0 = Q1Q0 D0 = Q2(Q1Q0) D0 (total) = Q2(Q1Q0) + Q2(Q1Q0) = Q1Q0 (Q2 + Q2) = Q1Q0

K-Map with 5 variables ► Example XXXX 01XXXX 11XXXX 10XXXX Q1 Q0 X Y Q1 Q0 Q2 = 0Q2 = 1 D0 = XD0 = Q1Q0 D0 (total) = Q1Q0

Lab 7 : Moore Machine ► After getting the boolean expression for each D Flip-Flop ► Start designing your VM ► Don’t forget to include your STATE and OUTPUT table. ► Don’t forget your RESET

Lab 7 : Moore Machine Input from Boolean Expression D FF Q0 n x m Decoder 10c 20c Clock Reset D FF Q1 D FF Q2 n is output from D FF And m =2 n is decoder output (Hints : same numbering as your STATE) Bal 10c Bal 20c Tin Out Basic Comb. Logic Gates Basic Logic Gates is needed for Reset Control and output enable Do your own connections

GOOD LUCK! THANK YOU