FSM

Attribution Non-Commercial (BY-NC)

12 views

Fsm 1

FSM

Attribution Non-Commercial (BY-NC)

- FSM VHDL
- Finite State Machine Design
- SAR Electrical Engineering
- Untitled
- Desktop Temperature Gauge Pro Log Desktop Temperature Gauge Pro Log
- 646
- Wiley-Acing-the-GATE-Computer-Science-and-Information-Technology.pdf
- 01-06-2015
- cd0306
- CM305
- ATmega48 DevBoard.pdf
- LECTURE B 4 FSM Encoding Intro
- r05311201 Automata and Compiler Design
- verilog - hw1
- Keypad Lcd
- UL20A
- STM32F103ZET6 Development Board
- waqas Cv
- What is a PLC
- V2I30078

You are on page 1of 33

Sequential Circuits

Combines combinational logic with storage Remembers state, and changes output (and state)

Digital signals are received and interpreted by a digital system an control outputs are generated in accordance with the sequence in which the input signals are received. Inputs

Outputs Storage Elements

State Machine

3-2

Sequential Circuits

Models for representing sequential circuits

Finite-state machines (Moore and Mealy) Representation of memory (states) Changes in state (transitions)

Shift registers Counters

Design procedure

State diagrams State transition table Next state functions

All programmable logic designs can be specified in Boolean

form. However some designs are easier to conceptualize and implement using non-Boolean models. The State Machine model is one such model

A state machine represents a system as a set of states, the transitions between them, along with the associated inputs and outputs

So, a state machine is a particular conceptualization of a

Any Circuit with Memory Is a Finite State Machine

Design of FSMs Involves Defining states Defining transitions between states Optimization / minimization Above Approach Is Practical for Small FSMs Only

A description of a system with the following components:

1. 2. 3. 4. 5.

A finite number of states A finite number of external inputs A finite number of external outputs An explicit specification of all state transitions An explicit specification of what determines each external output value

Inputs trigger state transitions. Outputs are associated with each state (or with each transition).

3-6

FSM structure

Synchronous design

Controlled by clock(s).

State changes at time determined by the clock. Inputs to registers settle in time for state change. Primary inputs settle in time for combinational delay

through logic.

Dont have to worry about timing constraints, events

The Clock

Frequently, a clock circuit triggers transition from one state to the next.

1

One Cycle

time

At the beginning of each clock cycle, state machine makes a transition, based on the current state and the external inputs.

3-9

A finite state machine (FSM) consists of three sets I, O,

I is a set of input combinations, O is a set of output combinations, S is a set of states PS is the next state function f(I, S), and NS is the output function f(S) [Moore model] or the output function f(I, S) [Mealy model].

sequential circuits.

The traditional state diagrams and state tables are just two

Chapter 5 Part 3 10

FSM Equations

The output logic can be easily derived as a logical sum of all the states where 1 on the output is produced (Moore). o 0 u t 1

00

Out1

in1

in1

Next State

Q1 Q2

D1 D2

Q1

in1 in1

11

Q2

01

in1

Clk

State

The state of a system is a snapshot of all the relevant elements of the system at the moment the snapshot is taken.

Examples:

The state of a basketball game can be represented by

the scoreboard.

3-12

State 4 For any given state, there is a finite number of possible next states. On each clock cycle, the state machine branches to the next state. One of the possible next states becomes the new present state, depending on the inputs present on the clock cycle.

State 5

State 6

State 7

Two types:

Moore Mealy

Both these machine types follow the basic characteristics of

state machines, but differ in the way that outputs are produced. Moore Machine: Outputs are independent of the inputs, ie outputs are effectively produced from within the state of the state machine. Mealy Machine: Outputs can be determined by the present state and the present inputs, ie outputs are produced as the machine makes a transition from one state to another.

Machine Models

Inputs Inputs

Present State Register Bank Combinatorial Logic to Determine Output Based on: Present State

Present State Register Bank Combinatorial Logic to Determine Output Based on: Present State Present Inputs

Moore Machine

Output Output

Mealy Machine

The Mealy model: the outputs are functions of both

The outputs may change if the inputs change during the

The outputs may have momentary false values unless the inputs are synchronized with the clocks.

The outputs are synchronous with the clocks.

Eastern Mediterranean University 17

Eastern Mediterranean University 18

Moore Machine

Describe Outputs as Concurrent Statements

transition condition 1

state 1 / output 1 state 2 / output 2

transition condition 2

A Moore Machine

a,b q1/0 a b a

q0/1 b

q3/1 b

q2/0

q0 q1 q2 q3

a q1 q1 q1 q3

b OUT q2 1 q1 0 q3 0 q1 1

The Moore State Machine output is shown inside the state bubble, because the output remains the same as long as the state machine remains in that state. State 1 q,r a,b

Input condition that must exist in order to execute these transitions from State 1

i,j

State 2 x,y

Mealy FSM

Output depends on inputs

Outputs are set during

transitions

A Mealy Machine

q1 a/1 a/1, b/1

q0 b/0

a/0

b/0 q2

Qold IN Qnew q0 a q1 q0 b q2 q1 a q1 q1 b q1 q2 a q1 q2 b q2

OUT 1 0 1 1 0 0

The Mealy State Machine generates outputs based on: The Present State, and The Inputs to the M/c. So, it is capable of generating many different patterns of output signals for the same state, depending on the inputs present on the clock cycle. Outputs are shown on transitions since they are determined in the same way as is the next state.

Output condition that results from being in a particular present state

State 1

a,b q,r

Input condition that must exist in order to execute these transitions from State 1

i,j x,y

State 2

State A B 0 0 0 0 0 1 0 1 1 0 1 0 1 1 1 1 I/P x 0 1 0 1 0 1 0 1 State A B 0 0 0 1 0 0 1 1 0 0 1 0 0 0 1 0 O/P y 0 0 1 0 1 0 1 0 State A B 0 0 0 0 0 1 0 1 1 0 1 0 1 1 1 1 I/P x 0 1 0 1 0 1 0 1 State A B 0 0 0 1 0 1 1 0 1 0 1 1 1 1 0 0

Mealy

Moore

O/P y 0 0 0 0 0 0 1 1

For the same state, the output changes with the input

For the same state, the output does not change with the input

25

Moore machine: Output a function of state. Mealy machine: Output a function of primary inputs + state.

Moore and Mealy FSMs Can Be Functionally Equivalent

Mealy FSM Has Richer Description and Usually Requires Smaller Number of States

Mealy FSM Computes Outputs as soon as Inputs

Change

Mealy FSM responds one clock cycle sooner than

Moore FSM is less likely to have a shorter critical path

1. 2. 3. 4. CODE SEQUENCE DETECTOR COUNTERS AND REGISTERS SEQUENTAL CODE GENERATORS MULTI-INPUT SYSTEM CONTROLLERS

Present Input State Next State

x

Output

Q Q

A 0 0 0 0 1 1 1 1 t

B 0 0 1 1 0 0 1 1

x 0 1 0 1 0 1 0 1

A 0 0 0 1 0 1 0 1

B 0 1 0 1 0 0 0 0

y 0 0 1 0 1 0 1 0

D CLK

Q Q

29

x

Present State

Q Q

A 0 0 1 1

B 0 1 0 1

A 0 0 0 0

B 0 0 0 0 t+1

A 0 1 1 1

B 1 1 0 0

y 0 1 1 1 t

y 0 0 0 0

D CLK

Q Q

30

State Diagram

AB

Present State

input/output

1/0 0/1

10

A B 0 0

A B A B 0 0 0 1

y 0

y 0

0/0

00

0 1

1 0 1 1

0

0 0

0

0 0

1

1 1

1

0 0

1

1 1

0

0 0

x D Q Q A

0/1 1/0

01

0/1

11

1/0

D CLK

Q Q

31

Moore Circuit

Next State Logic Circuit State Memory Output Logic Circuit

outpu t

clock signal

Mealy Circuit

Next State Logic Circuit State Memory Output Logic Circuit

outpu t

clock signal

- FSM VHDLUploaded byNgoc Xuan
- Finite State Machine DesignUploaded byluffydmon
- SAR Electrical EngineeringUploaded byEMAD
- UntitledUploaded bylekinda
- Desktop Temperature Gauge Pro Log Desktop Temperature Gauge Pro LogUploaded bykatsikhs1
- 646Uploaded byMata Randall
- Wiley-Acing-the-GATE-Computer-Science-and-Information-Technology.pdfUploaded byRitesh Poddar
- 01-06-2015Uploaded byRaju Puppala
- cd0306Uploaded bydiankusuma123
- ATmega48 DevBoard.pdfUploaded bytehmatix
- LECTURE B 4 FSM Encoding IntroUploaded byMd Hasan
- r05311201 Automata and Compiler DesignUploaded bySRINIVASA RAO GANTA
- CM305Uploaded byapi-3853441
- verilog - hw1Uploaded byCharusree Thiagarajan
- Keypad LcdUploaded bySid Jain
- UL20AUploaded byYanto Sae
- STM32F103ZET6 Development BoardUploaded bypiramidon
- waqas CvUploaded bywaqas_asad3081
- What is a PLCUploaded bySandesh S Rao
- V2I30078Uploaded byeditor_ijarcsse
- I2CUploaded byapi-19646376
- 1.2Lexical AnalysisUploaded byPrashant Raut
- Beamer PresUploaded bymaik73
- digital circuits notesUploaded byShobana MOHANA SUNDARAM
- siva3Uploaded byG.Siva Sankar
- p2Uploaded byTani Gaur
- Historical Computers in Japan-Computer MuseumUploaded byJUAN ALVAREZ QUEZADA
- p spiceUploaded byNakalchi Ram
- 5600DUploaded byAshok Jangra
- Lec # 26 EncodersUploaded bySyed Abdul Rehman Shah

- Coelho, Paulo - The Alchemist.pdfUploaded byParthu Balina
- pi_10015 (1)Uploaded byParthu Balina
- Iclodean 2017 IOP Conf. Ser. Mater. Sci. Eng. 252 012058Uploaded byParthu Balina
- Media WikiUploaded byjay M
- Staff System in the Indian ArmyUploaded byParthu Balina
- 21 Qualities of a LeaderUploaded byParthu Balina
- a02866a5-12aa-4e47-9c16-deed0314672a_v2Uploaded byParthu Balina
- Accomodation IIMB FinalUploaded byParthu Balina
- FSM -IIUploaded byParthu Balina
- Evaluation UditUploaded byParthu Balina
- Form11Revised.pdfUploaded byDiwaker Pandey
- Tutorial Sheet IUploaded byParthu Balina
- p27-bahlUploaded byParthu Balina
- VocabularyUploaded byParthu Balina
- OrientationUploaded byParthu Balina
- BluetoothUploaded byParthu Balina
- IndicesUploaded byParthu Balina
- Report FormatUploaded byParthu Balina
- ECE632 Mobile CommunicationUploaded byUsama Latif
- The Zen of Steve JobsUploaded byNghĩa Còi
- Becker 1967 - Whose Side Are We OnUploaded byParthu Balina
- Sun Tzu - The Art of WarUploaded byParthu Balina

- Advancing Integrated Systems Modelling Framework for Life Cycle Sustainability AssessmentUploaded byKumar
- Teaching Neural Network Control System Design Using a Low-cost Rapid Control Prototyping PlatformUploaded byffranquiz
- Lec 10Uploaded byKaran Chawla
- Chap007.pptUploaded bySaad Khadur Eilyes
- Schx4005 Process Dynamics & Control LabUploaded bysaibapole
- Questions & Answers About Industrial EngineeringUploaded byK.s. Ramesh
- Practical FIR Filter Design_ Part 1 - Design With Octave or MatlabUploaded byNorozKhan
- Speech Morphing 2 Info]Uploaded byAtul Kumar Verma
- 13-blackwhiteboxtestingUploaded bySujala V Koparde
- 14. Questions on Nonlinear SystemsUploaded bykibrom atsbha
- Exercise 6 - State-space ModelsUploaded byanass sbni
- Modeling and LQG LTR Control for Power and Axial Power d 2014 Annals of NuclUploaded bygvkovind
- John R Wilson Fundamentals of Systems Ergonomics 2012Uploaded byDalia Albu
- Digital Communication Using MATLABUploaded byMatlabAsignmentExperts
- Cr 36560564Uploaded byAnonymous 7VPPkWS8O
- Seven Deadly WastesUploaded byle thanh
- Root_Cause_Guide.pdfUploaded byLester Pino
- The Systems Approach (1)Uploaded byRoneth Raquel Dela Cruz
- Week1 Chapter 1Uploaded bymhdbad amin
- 10 Reservoir Problem SolutionUploaded byVageesha Shantha Veerabhadra Swamy
- IT1252 Q&AUploaded byRavi Raj
- Lab Manual New CSUploaded byKarthi Ramachandran
- 12EI301.docUploaded bykrajasekarantuti
- 2012.SpringUploaded bykim
- Eight-Stages-of-Agile-Approach-That-Works.pdfUploaded bya
- Quality ManagementUploaded byNidhalTlili
- LtmUploaded byLuqy
- Equipment CareUploaded bySajid Chaudhary
- Maintenance Scheduling of Fighter Aircraft Fleet With Multi-Objective Simulation-OptimizationUploaded byGcmarshall82
- Research _ Operations Research and Operations-researchUploaded bychrkiitm