Chapter #8: Finite State Machine Design. 8.5 Finite State Machine Word Problems

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

PUSH BUTTON START INSTALLATION MANUAL

(Refer Slide Time: 00:01:16 min)

BLOCK OCCUPANCY DETECTOR WITH SEMAPHORE OPERATION BOD1/DAP4-BR

PROGRAMMABLE LOGIC CONTROL

Lecture 8: Synchronous Digital Systems

Programming A PLC. Standard Instructions

CHAPTER 11: Flip Flops

STEP 7 MICRO/WIN TUTORIAL. Step-1: How to open Step 7 Micro/WIN

Chapter 5. Sequential Logic

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

FINITE STATE MACHINE: PRINCIPLE AND PRACTICE

How To Control A Car Alarm On A Car With A Remote Control System

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

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

How to read this guide

Software Manual RS232 Laser Merge Module. Document # SU Rev A

Asynchronous Counters. Asynchronous Counters

Computer organization

FlexPak 3000 Digital DC Drive Software Reference Manual Version 4.3

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

Finite State Machine Design and VHDL Coding Techniques

Adding Pneumatic Preset Counter. Type 497. Continuously visible preset Integrated pneumatic reset 3 or 5-digit display Convenient button setting

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

EC313 - VHDL State Machine Example

Informatique Fondamentale IMA S8

2.0 System Description

2011, The McGraw-Hill Companies, Inc. Chapter 5

Chapter 9 Latches, Flip-Flops, and Timers

Digital input modules

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

Combinational Logic Design Process

PACKAGE OUTLINE DALLAS DS2434 DS2434 GND. PR 35 PACKAGE See Mech. Drawings Section

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC Microprocessor & Microcontroller Year/Sem : II/IV

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

Cascaded Counters. Page 1 BYU

INSTALLATION GUIDE. FCC ID NOTICE

Digital Controller for Pedestrian Crossing and Traffic Lights

Industrial Process Automation (Exercise)

EMR-9 Quick Start Guide (00175)D 1

Tutorial: Configuring GOOSE in MiCOM S1 Studio 1. Requirements

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

Operational Overview and Controls Guide. Two or Three Pump IronHeart Lite with Variable Frequency Drives

DIGITAL LOGIC CURRENT FLOW

Programming Timers CHAPTER 4-1 GOALS AND OBJECTIVES 4-2 MECHANICAL TIMING RELAYS

MICROPROCESSOR. Exclusive for IACE Students iacehyd.blogspot.in Ph: /422 Page 1

Multiagent Control of Traffic Signals Vision Document 2.0. Vision Document. For Multiagent Control of Traffic Signals. Version 2.0

Multiple Connection Telephone System with Voice Messaging

AN141 SMBUS COMMUNICATION FOR SMALL FORM FACTOR DEVICE FAMILIES. 1. Introduction. 2. Overview of the SMBus Specification. 2.1.

Control/Communicator Installation Manual

Inwall 4 Input / 4 Output Module

USING WIRELESS DIAGNOSTICS Application Note 31

United States Naval Academy Electrical and Computer Engineering Department. EC262 Exam 1

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

TestManager Administration Guide

11. FLOWCHART BASED DESIGN

MICROPROCESSOR AND MICROCOMPUTER BASICS

Date Rev. Details Author

Configuration Manager

Section 29. Real-Time Clock and Calendar (RTCC)

Sequential Logic Design Principles.Latches and Flip-Flops

XyLoc Windows7 Client Release Notes

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

Algorithm and Flowchart Structured Programming 1

CS311 Lecture: Sequential Circuits

TRILOGI 5.3 PLC Ladder Diagram Programmer and Simulator. A tutorial prepared for IE 575 by Dr. T.C. Chang. Use On-Line Help

VARIO PROX CARD READER INSTALLATION MANUAL

1R / 4-BUTTON SERIES

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

FINITE STATE AND TURING MACHINES

RapidIO Network Management and Diagnostics

(AA12) QUANTITATIVE METHODS FOR BUSINESS

Register File, Finite State Machines & Hardware Control Language

Below is a diagram explaining the data packet and the timing related to the mouse clock while receiving a byte from the PS-2 mouse:

NUM INFORMATION US N 111 1/9

Event counters in NOVA

Analog Monitoring Tool AMT 0.3b User Manual

StateFlow Hands On Tutorial

Modeling Sequential Elements with Verilog. Prof. Chien-Nan Liu TEL: ext: Sequential Circuit

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

G.A.L. HANDS FREE EMERGENCY TELEPHONE MODEL GAL-6400

Automated Test Generation

RPDO 1 TPDO 1 TPDO 5 TPDO 6 TPDO 7 TPDO 8

Lecture 7: Clocking of VLSI Systems

FPGA Implementation of an Advanced Traffic Light Controller using Verilog HDL

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

8-ch RAID0 Design by using SATA Host IP Manual Rev1.0 9-Jun-15

RAM & ROM Based Digital Design. ECE 152A Winter 2012

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

siemens.com/mobility Traffic data analysis in Sitraffic Scala/Concert The expert system for visualization, quality management and statistics

Disputed Red Light Accidents: A Primer on Signal Control. Jon B. Landerville, MSME, PE Edward C. Fatzinger, MSME, PE Philip S.

DS1621 Digital Thermometer and Thermostat

8051 hardware summary

Counters and Decoders

find model parameters, to validate models, and to develop inputs for models. c 1994 Raj Jain 7.1

CHAPTER IX REGISTER BLOCKS COUNTERS, SHIFT, AND ROTATE REGISTERS

Keep it Simple Timing

Control and Indicating Equipment

First Steps with CoDeSys. Last update:

Transcription:

Chapter #8: 8.5 Finite State Machine Word Problems R.H. Katz Transparency No. 6-

Mapping English Language Description to Formal Specifications Four Case Studies: Finite String Pattern Recognizer Complex Counter with Decision Making Traffic Light Controller Digital Combination Lock We will use state diagrams and ASM Charts R.H. Katz Transparency No. 6-2

. Finite String Pattern Recognizer A finite string recognizer has one input (X) and one output (Z). The output is asserted whenever the input sequence has been observed, as long as the sequence has never been seen. Step. Understanding the problem statement Sample input/output behavior: X: Z: X: Z: The outputs have been written to lag behind the inputs. R.H. Katz Transparency No. 6-3

Finite String Recognizer Step 2. Draw State Diagrams/ASM Charts for the strings that must be recognized. I.e., and. S [] Reset S [] S4 [] Moore State Diagram Reset signal places FSM in S S2 [] S5 [] Outputs S3 [] S6 [], Loops in State R.H. Katz Transparency No. 6-4

Finite String Recognizer Exit conditions from state S3: have recognized if next input is then have! if next input is then have = (state S2) S [] Reset S [] S4 [] S2 [] S5 [] S3 [] S6 [], R.H. Katz Transparency No. 6-5

Finite String Recognizer Exit conditions from S: recognizes strings of form (no seen) loop back to S if input is Exit conditions from S4: recognizes strings of form (no seen) loop back to S4 if input is S [] Reset S [] S2 [] S3 [] S4 [] S5 [] S6 [], R.H. Katz Transparency No. 6-6

Finite String Recognizer S2, S5 with incomplete transitions S2 = ; If next input is, then string could be prefix of ()() S4 handles just this case! S5 = ; If next input is, then string could be prefix of ()() S2 handles just this case! S [] S S4 [] [] S2 [] S3 [] Reset S5 [] S6 [], Final State Diagram R.H. Katz Transparency No. 6-7

Finite String Recognizer Verify I/O behavior of your state diagram to insure it functions like the specification Sample input/output behavior: X: Z: X: Z: R.H. Katz Transparency No. 6-8

2. Complex Counter A sync. 3 bit counter has a mode control M. When M =, the counter counts up in the binary sequence. When M =, the counter advances through the Gray code sequence. Binary:,,,,,,, Gray:,,,,,,, Example Valid I/O behavior: Output = Next State Mode Input M Current State Next State (Z2 Z Z) R.H. Katz Transparency No. 6-9

Complex Counter Derive the State Diagram using Moore FSM R.H. Katz Transparency No. 6-

3. Traffic Light Controller A busy highway is intersected by a little used farmroad. Detectors 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. R.H. Katz Transparency No. 6-

Traffic Light Controller Picture of Highway/Farmroad Intersection: FL Farmroad C HL Highway Highway HL C Farmroad FL R.H. Katz Transparency No. 6-2

Traffic Light Controller Tabulation of Inputs and Outputs: Input Signal reset C TS TL Description place FSM in initial state detect vehicle on farmroad short time interval expired long time interval expired Output Signal HG, HY, HR FG, FY, FR ST Description assert green/yellow/red highway lights assert green/yellow/red farmroad lights start timing a short or long interval Tabulation of Unique States: Some light configuration imply others State S S S2 S3 Description Highway green (farmroad red) Highway yellow (farmroad red) Farmroad green (highway red) Farmroad yellow (highway red) R.H. Katz Transparency No. 6-3

Traffic Light Controller Refinement of ASM Chart: Start with basic sequencing and outputs: S S 3 H.HG H.FR H.HR H.FY S S 2 H.HY H.HR H.FR H.FG R.H. Katz Transparency No. 6-4

Traffic Light Controller Determine Exit Conditions for S: Car waiting and Long Time Interval Expired- C TL S S H.HG H.HG H.FR H.FR TL TL C C OR H.ST H.ST S H.HY H.FR S H.HY H.FR Equivalent ASM Chart Fragments R.H. Katz Transparency No. 6-5

Traffic Light Controller S to S2 Transition: Set ST on exit from S Stay in S until TS asserted Similar situation for S3 to S4 transition S H.HY H.FR H.ST S 2 H.HR H.FG TS R.H. Katz Transparency No. 6-6

Traffic Light Controller S2 Exit Condition: no car waiting OR long time interval expired S S 3 H.HG H.HR H.FR H.ST H.FY TL C TS H.ST H.ST S S 2 H.HY H.ST H.HR H.FR H.FG TS TL + C Complete ASM Chart for Traffic Light Controller R.H. Katz Transparency No. 6-7

Traffic Light Controller Compare with state diagram: TL + C MEALY TL C/ST S Reset TS/ST S: HG S: HY TS S TS/ST S2 S3 TS TL + C/ST S2: FG S3: FY TL C Advantages of State Charts: Concentrates on paths and conditions for exiting a state Exit conditions built up incrementally, later combined into single Boolean condition for exit Easier to understand the design as an algorithm R.H. Katz Transparency No. 6-8

4. Digital Combination Lock "3 bit serial lock controls entry to locked room. Inputs are RESET, ENTER, 2 position switch for bit of key data. Locks generates an UNLOCK signal when key matches internal combination. ERROR light illuminated if key does not match combination. Sequence is: () Press RESET, (2) enter key bit, (3) Press ENTER, (4) repeat (2) & (3) two more times." Problem specification is incomplete: how do you set the internal combination? exactly when is the ERROR light asserted? Make reasonable assumptions: combination hardwired into next state logic vs. stored in internal register assert as soon as error is detected vs. wait until full combination has been entered ==>Our design: registered combination plus error after full combination R.H. Katz Transparency No. 6-9

Digital Combination Lock Understanding the problem: draw a block diagram RESET Operator Data Internal Combination ENTER KEY -IN L L L 2 Combination Lock FSM UNLOCK ERROR Inputs: Reset Enter Key-In L, L, L2 Outputs: Unlock Error R.H. Katz Transparency No. 6-2

Digital Combination Lock Derive the ASM or the State Diagram Implementation R.H. Katz Transparency No. 6-2

HW #6 -- Section 8.5 R.H. Katz Transparency No. 6-22