Docsity

Understanding Finite State Machines (FSMs) in Embedded Real-Time Systems - Prof. Andrew Fa, Study notes of Aerospace Engineering

Partial preview of the text

Download Understanding Finite State Machines (FSMs) in Embedded Real-Time Systems - Prof. Andrew Fa and more Study notes Aerospace Engineering in PDF only on Docsity!

Andrew H. Fagg: Embedded Real-Time Systems: FSMs

Memory

• With combinatorial logic (AND, OR, NOT,etc.), we could only implement “stateless”functions• By introducing flip-flops, we couldremember something about the history ofthe inputs

Andrew H. Fagg: Embedded Real-Time Systems: FSMs

Memory

• With combinatorial logic (AND, OR, NOT,etc.), we could only implement “stateless”functions• By introducing sequential logic (with flip-flops), we could remember somethingabout the history of the inputsHow do we formalize this idea of “history”?

Andrew H. Fagg: Embedded Real-Time Systems: FSMs

Formalizing Memory

Combinatorial Logic

Boolean Algebra

Sequential Logic

Andrew H. Fagg: Embedded Real-Time Systems: FSMs

Formalizing Memory

Combinatorial Logic

Boolean Algebra

Sequential Logic

Finite State Machines

Andrew H. Fagg: Embedded Real-Time Systems: FSMs

Finite State Machines (FSMs)Pure FSM form is composed of:• A set of states• A set of possible inputs (or events)• A set of possible outputs (or actions)• A transition function:– Given the current state and an input: definesthe output and the next state

Andrew H. Fagg: Embedded Real-Time Systems: FSMs

Finite State Machines (FSMs)States:• Represent all possible “situations” thatmust be distinguished• At any given time, the system is in exactlyone of the states• There is a finite number of these states

Andrew H. Fagg: Embedded Real-Time Systems: FSMs

Finite State Machines (FSMs)An example: our synchronous counter• States: the different combinations of thedigits: 000, 001, 010, … 111• Inputs:?

Andrew H. Fagg: Embedded Real-Time Systems: FSMs

Finite State Machines (FSMs)An example: our synchronous counter• Inputs:– Really only one: the event associated with theclock transitioning from high to low– We will call this “C”• Outputs:?

Andrew H. Fagg: Embedded Real-Time Systems: FSMs

Finite State Machines (FSMs)An example: our synchronous counter• Transition function:– On the clock event, transition to the next statein the sequence

Andrew H. Fagg: Embedded Real-Time Systems: FSMs

FSM Example:

Synchronous Counter

A Graphical Representation:^000

A set of states

Andrew H. Fagg: Embedded Real-Time Systems: FSMs

FSM Example:

Synchronous Counter

A transition^000

C/

The event

Andrew H. Fagg: Embedded Real-Time Systems: FSMs

FSM Example:

Synchronous Counter

A transition^000

C/

The output

Andrew H. Fagg: Embedded Real-Time Systems: FSMs

FSM Example:

Synchronous Counter

The next transition^000

C/^

C/

C/

Andrew H. Fagg: Embedded Real-Time Systems: FSMs

FSM Example:

Synchronous Counter

The full transition set^000

C/^

C/

C/100 C/

C/

C/

C/001 C/