State Table Problem #1 An electronic lock is controlled by a keypad, which has three buttons labeled A, B, and R. The keypad is restricted such that, at.

Slides:



Advertisements
Similar presentations
Modeling Computation Chapter 13.
Advertisements

Sequential Logic Circuits. Set-Reset Latch The Set-Reset latch or bistable is a simple sequential logic circuit that remembers what has happened to the.
Finite State Machines (FSMs)
State-machine structure (Mealy)
Analysis of Clocked Sequential Circuits
CSE 311: Foundations of Computing Fall 2013 Lecture 23: Finite state machines and minimization.
Denise Landau Fundamentals of Problem Solving Finite State Machines Denise Landau 2013 AQA Computing COMP1.
Sequential Logic ENEL 111. Sequential Logic Circuits So far we have only considered circuits where the output is purely a function of the inputs With.
A. Abhari CPS2131 Sequential Circuits Most digital systems like digital watches, digital phones, digital computers, digital traffic light controllers and.
Digital Logic Chapter 5 Presented by Prof Tim Johnson
Sequential Circuits1 DIGITAL LOGIC DESIGN by Dr. Fenghui Yao Tennessee State University Department of Computer Science Nashville, TN.
Module 12.  In Module 9, 10, 11, you have been introduced to examples of combinational logic circuits whereby the outputs are entirely dependent on the.
Lecture 22: Sequential Circuits Today’s topic –Clocks and sequential circuits –Finite state machines 1.
Finite state machines.
Sequential Circuit Design
ECE 331 – Digital System Design
LAB 3 – Review of the Assignment. -- Clarifications Vikram Murali. TA : CSE 140L Prof. CK Cheng.
08/07/041 CSE-221 Digital Logic Design (DLD) Lecture-8:
Sequential Circuit Design
Basic Register Typically, we store multi-bit items
1 Synchronous Sequential Circuit Design. 2 Sequential circuit design In sequential circuit design, we turn some description into a working circuit – We.
Midterm Wednesday Chapter 1-3: Number /character representation and conversion Number arithmetic CMOS logic elements Combinational logic elements and design.
In a not gate, if the input is on(1) the output is off (0) and vice versa.
State Machine Design State Machine Design Digital Electronics
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
Unit 14 Derivation of State Graphs
Finite-State Machines with Output
Lecture 23: Finite State Machines with no Outputs Acceptors & Recognizers.
Implementing software in IEC Languages in IEC IEC uses the following languages Instruction List – Assembly level programming using.
1 Lecture 22 Sequential Circuits Analysis. 2 Combinational vs. Sequential  Combinational Logic Circuit  Output is a function only of the present inputs.
Digital Logic Design Lecture # 21 University of Tehran.
Introduction to State Machine
1 Lecture 13 Overview of sequential logic  Basic concepts  An example.
Chapter 3 Digital Logic Structures. 3-2 Combinational vs. Sequential Combinational Circuit always gives the same output for a given set of inputs  ex:
© BYU 16 FSM Page 1 ECEn 224 Finite State Machines.
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.
1 ENGG 1203 Tutorial Combinational Logic (II) and Sequential Logic (I) 8 Feb Learning Objectives  Apply Karnaugh map for logic simplification  Design.
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Transistor: Building.
1Sequential circuit design Acknowledgement: Most of the following slides are adapted from Prof. Kale's slides at UIUC, USA by Erol Sahin and Ruken Cakici.
University of Texas at Austin CS310 - Computer Organization Spring 2009 Don Fussell State Machines.
1 ENGG 1015 Tutorial Three Examples of Finite State Machines Supplementary notes Learning Objectives  Learn about Design of Finite State Machines Ack.:

1 COMP541 Finite State Machines - 1 Montek Singh Sep 22, 2014.
Synchronous Counter Design
1 State machine by nature are ideally suited to track state and detect specific sequence of events For example, we may design specific machines to track.
4) Design the logic to control the motor on a simple remote control car. There are two buttons on the remote control for the motor. If neither button is.
State Machine Design State Machine Design Digital Electronics
1 Lecture #14 EGR 277 – Digital Logic Self-starting counters Counters are considered to be self-starting if all unused counts eventually lead to the correct.
5-1-2 Synchronous counters. Learning Objectives: At the end of this topic you will be able to: draw a block diagram showing how D-type flip-flops can.
State Diagrams Tuesday, 12 September State diagram Graphical representation of a state table. –Provides the same information as a state table. –A.
1 COMP541 Sequential Logic – 2: Finite State Machines Montek Singh Feb 29, 2016.
© Copyright 2004, Gaetano Borriello and Randy H. Katz
Lecture 13 Derivation of State Graphs and Tables
CS 352 Introduction to Logic Design
Computer Organization
You have 5 minutes to look over your table of sensor and outputs ready for a spot check on the different symbols Start Timer 5 mins
CSE 311 Foundations of Computing I
Synchronous Sequential Circuit Design
Sequential Circuits Most digital systems like digital watches, digital phones, digital computers, digital traffic light controllers and so on require.
CSE 311 Foundations of Computing I
Introduction to Sequential Circuits
State Machine Design State Machine Design Digital Electronics
CSE 370 – Winter Sequential Logic-2 - 1
Flip-Flops.
ECE 352 Digital System Fundamentals
Logic Gates AIM: To know the different types of logic gate
State Machine Design State Machine Design Digital Electronics
Presentation transcript:

State Table Problem #1 An electronic lock is controlled by a keypad, which has three buttons labeled A, B, and R. The keypad is restricted such that, at most, one key can be pressed at a time, and that each key press generates an input signal that lasts for only one clock cycle. A state machine takes the key presses as input, and its output is either lock (L) or unlock (U). If the correct sequence of keys is typed and followed by an R, the state machine generates an unlock (U) signal and then resets. At any other time the output should be locked (L). If an incorrect sequence of keys is pressed the lock becomes inactive until the reset (R) key is pressed, at which point the lock resets (with no unlock signal).

State Table Problem #1 1) An electronic lock is controlled by a keypad, which has three buttons labeled A, B, and R. The keypad is restricted such that, at most, one key can be pressed at a time, and that each key press generates an input signal that lasts for only one clock cycle. A state machine takes the key presses as input, and its output is either lock (L) or unlock (U). If the correct sequence of keys is typed and followed by an R, the state machine generates an unlock (U) signal and then resets. At any other time the output should be locked (L). If an incorrect sequence of keys is pressed the lock becomes inactive until the reset (R) key is pressed, at which point the lock resets (with no unlock signal).

Create the symbolic state machine (state diagram) for this lock if the correct key sequence is BBAB. Label your inputs A, B, R, and O (for no key pressed). Label your output L or U. Label your states with words such as "reset" and "inactive," or with partial key sequences such as "BBA." Make sure that all possible transitions exist.

Bubble Diagram

Problem #2 Candy costs 15 cents, and the candy machine accepts nickels and dimes. However, it has a coin return and can only output one item (a nickel, a dime, or candy) at a time. In addition, only one input (a nickel, a dime, or the coin return) can occur at a time. Create the symbolic state machine (state diagram) for this candy machine. Label your inputs N, D, CR (coin return), and O (for no input). Label your outputs N, D, C (candy), and O (for no out put). Make sure that all possible transitions exist.

Bubble Diagram For Prob #2

Problem #3 Sequence Recognizer –Given a string of bits, recognize the sequence 011 or 10 –Overlapping sequences are OK ex: When we get a zero, look for two ones following it When we get a one, look for a zero following it

Possible inputs: The next bit you are trying to identify Can be a 0 or a 1 Have 2 inputs, need 1 binary variable

Possible outputs: Did you complete a sequence {Y} or not {N}? Have 2 outputs, need 1 binary variable

Possible states: I don't have any recognizable sequence -> {x} I have a 0 (we may be able to match the 1st sequence) -> {x0} I have a 0 followed by a 1 (we may be able to match the 1st sequence) -> {x01} I have a 1 (we may be able to match the 2nd sequence) -> {x1} Have 4 possible states, need 2 binary variables

Sequence Recognizer Example

Sequence Recognizing State Diagram Input = 0 is shown in blue. Input = 1 is shown in red. Notice, every state has both a red and blue arrow from it.

What happens to the state diagram if we don't allow overlapping sequences?state diagram if we don't allow overlapping sequences?

Sequence Recognizing State Diagram No Overlapping Sequences Changes from previous diagram are shown in green.

What happens to the state diagram if we have a reset?state diagram if we have a reset? If the reset is on, it will go back to the unrecognizable sequence state no matter what the other input is The reset can be on {R} or off {R'} Have 2 more inputs, need 1 more binary variable

Sequence Recognizing State Diagram with a Reset

How do we describe sequential systems? Sequential system description –If state=0¢ and input=nickel, then next state=5¢ and output=no candy –if state=5¢ and input=nickel, then next state=0¢ and output=candy

How do we describe sequential systems? State diagrams –Circles represent state –Arrows represent what the next state is –Numbers on arrows represent the input required to get that next state/resulting output

What causes transition? If input causes transition, get the following state diagram Called an asynchronous system

If have a periodic signal constantly checking for the input (called clock), must have an arrow directing you to a state if no input is received Called a synchronous system. This is the type system we will be dealing with.

How do we describe sequential systems? take the existing state diagram and write using binary variables? –Have 2 possible inputs {nickel / no nickel}, so need 1 binary variable to represent Nickel=1 No nickel=0 Input=N, which can be either 1 or 0 to represent having a nickel or not –Have 2 possible states {0¢ / 5¢}, so need 1 binary variable to represent 0¢=0 5¢=1 State variable=M, which can be either 0 or 1 to represent 0¢ state or 5¢ state –Have 2 possible outputs {candy / no candy}, so need 1 binary variable to represent Candy=1 No candy=0 Output=C, which can be either 1 or 0 to represent getting candy or not Note that assignment of binary definitions (ie nickel = 1) is arbitrary

Writing State Diagrams with Binary Definitions nickel = 10¢ = 0candy = 1 no nickel = 05¢ = 1no candy = 0

Garage Door Opener –The door can go up, go down, stay up, stay down, or stop in the middle –You can push a button that will change what the door is going to do If the door stopped at the bottom, push the button and the door will go up If the door stopped at the top or in the middle, push the button and the door will go down If the door is going up, push the button and the door will stop in the middle If the door is going down, push the button and the door will go back up (emergency feature) –There exist limit switches that stop the motor when the door hits the top or the bottom When the door is stopped at the top or bottom, the limit switch is always pushed

So, we have a limit switch and a button, either of which may be on or off

Possible inputs: Neither button nor limit switch pushed -> {L' B'} Button pushed, limit switch not pushed -> {L' B} Limit switch pushed, button not pushed -> {L B'} Both button and switch pushed -> {L B} Have 4 inputs, need 2 binary variables

Possible outputs = possible states: Going up -> {G-U} Going down -> {G-D} Stopped up -> {S-U} Stopped down -> {S-D} Stopped middle -> {S-M} Have 5 states, need 3 binary variables

Garage Door Opener State Diagram

S-U and S-M states may be combined into a single state {S-U-M} Inputs not possible for S-U state are valid inputs for S-M state and vice versa Now, only need 2 binary variables

Garage Door Opener State Diagram with States Combined

Complex Candy Machine –15¢ candy machine that accepts nickels and dimes –Possible inputs: Nothing -> {X} Nickel -> {N} Dime -> {D} Have 3 inputs, need 2 binary variables –Possible outputs: Candy -> {C} No candy -> {C'} Have 2 outputs, need 1 binary variable –Possible states: 0¢ 5¢ 10¢ Have 3 states, need 2 binary variables

Complex Candy Machine State Diagram