0% found this document useful (0 votes)
30 views

We Know That Synchronous Sequential Circuits Change

Asynchronous circuit

Uploaded by

Mario Mona
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

We Know That Synchronous Sequential Circuits Change

Asynchronous circuit

Uploaded by

Mario Mona
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

We know that synchronous sequential circuits

change affect𝑎𝑓𝑓𝑒𝑐𝑡 their states for every


positive ornegative𝑜𝑟𝑛𝑒𝑔𝑎𝑡𝑖𝑣𝑒 transition of the clock signal based on
the input. So, this behavior of synchronous sequential circuits can
be represented in the graphical form and it is known as state diagram.

A synchronous sequential circuit is also called as Finite State


Machine FSM𝐹𝑆𝑀, if it has finite number of states. There are two
types of FSMs.

 Mealy State Machine


 Moore State Machine

Now, let us discuss about these two state machines one by one.

Mealy State Machine


A Finite State Machine is said to be Mealy state machine, if outputs
depend on both present inputs & present states. The block diagram of
Mealy state machine is shown in the following figure.

As shown in figure, there are two parts present in Mealy state


machine. Those are combinational logic and memory. Memory is
useful to provide some or part of previous
outputs presentstates𝑝𝑟𝑒𝑠𝑒𝑛𝑡𝑠𝑡𝑎𝑡𝑒𝑠 as inputs of combinational logic.

So, based on the present inputs and present states, the Mealy state
machine produces outputs. Therefore, the outputs will be valid only
at positive ornegative𝑜𝑟𝑛𝑒𝑔𝑎𝑡𝑖𝑣𝑒 transition of the clock signal.

The state diagram of Mealy state machine is shown in the following


figure.

In the above figure, there are three states, namely A, B & C. These
states are labelled inside the circles & each circle corresponds to
one state. Transitions between these states are represented with
directed lines. Here, 0 / 0, 1 / 0 & 1 / 1 denotes input / output. In the
above figure, there are two transitions from each state based on the
value of input, x.

In general, the number of states required in Mealy state machine is


less than or equal to the number of states required in Moore state
machine. There is an equivalent Moore state machine for each
Mealy state machine.

Moore State Machine


A Finite State Machine is said to be Moore state machine, if outputs
depend only on present states. The block diagram of Moore state
machine is shown in the following figure.

As shown in figure, there are two parts present in Moore state


machine. Those are combinational logic and memory. In this case,
the present inputs and present states determine the next states.
So, based on next states, Moore state machine produces the
outputs. Therefore, the outputs will be valid only after transition of
the state.

The state diagram of Moore state machine is shown in the following


figure.
In the above figure, there are four states, namely A, B, C & D.
These states and the respective outputs are labelled inside the
circles. Here, only the input value is labeled on each transition. In
the above figure, there are two transitions from each state based on
the value of input, x.

In general, the number of states required in Moore state machine is


more than or equal to the number of states required in Mealy state
machine. There is an equivalent Mealy state machine for each
Moore state machine. So, based on the requirement we can use one
of them.

https://www.tutorialspoint.com/digital_circuits/digital_circuits_algorithmic_state_machine_charts.htm

FINITE STATE MACHINE

ChatGPT

A Finite State Machine (FSM) is a computational model used to design both computer programs
and sequential logic circuits. It is a mathematical abstraction used to design algorithms, control
systems, and hardware circuitry. An FSM can be in exactly one of a finite number of states at
any given time and can transition from one state to another in response to some inputs.

Components of a Finite State Machine

1. States: Distinct modes in which the FSM can exist.


2. Initial State: The state in which the FSM starts operation.
3. Transitions: Rules that define state changes based on inputs.
4. Inputs: External signals or conditions that affect state transitions.
5. Outputs: Signals or actions that result from being in a particular state or from transitions.
Types of FSMs

1. Deterministic Finite Automaton (DFA): An FSM where each state has exactly one transition for
each possible input.
2. Nondeterministic Finite Automaton (NFA): An FSM where a state may have multiple transitions
for the same input.
3. Moore Machine: Outputs are determined only by the current state.
4. Mealy Machine: Outputs are determined by the current state and the current inputs.

Example: Simple Traffic Light Controller

A traffic light controller is a classic example of an FSM. Let's design a simple traffic light
controller with three states: Green, Yellow, and Red.

States

1. Green (G)
2. Yellow (Y)
3. Red (R)

Inputs

1. Timer Expired (T): Indicates the time for the current light has expired.

Outputs

1. Green Light (G)


2. Yellow Light (Y)
3. Red Light (R)

State Transition Diagram

Here's a simple state transition diagram for a traffic light controller:

sql
Copy code
+-----+ T +-----+ T +-----+
| G | -------------->| Y | -------------->| R |
+-----+ +-----+ +-----+
^ |
| |
+----------------------------------------------+
T (Cycle repeats)

State Table
Current State Input (T) Next State Output

Green (G) T Yellow (Y) G


Current State Input (T) Next State Output

Yellow (Y) T Red (R) Y

Red (R) T Green (G) R

Implementation of FSM

An FSM can be implemented using different methods depending on the application. Below are
some common implementation techniques:

1. Hardware (Sequential Logic Circuits): Using flip-flops, logic gates, and multiplexers.
2. Software (Programming): Using state variables and control structures (e.g., switch-case
statements).

Hardware Implementation (Digital Circuit)

In digital circuit design, an FSM can be implemented using flip-flops to store the current state
and combinational logic to determine the next state and outputs.

Example: Traffic Light Controller using D Flip-Flops

Assume the states are encoded as follows:

 Green (G) = 00
 Yellow (Y) = 01
 Red (R) = 10

State Transition Table


Current State Input (T) Next State

00 (Green) 1 01 (Yellow)

01 (Yellow) 1 10 (Red)

10 (Red) 1 00 (Green)

Logic Equations

Let's derive the next state equations:

 Next State Logic:


o S1(t+1) = S1' & S0 + S1 & S0'
o S0(t+1) = S1' & S0' + S1 & S0

 Output Logic:
o The output can be directly derived from the state encoding.

Software Implementation (Programming)

Here’s a simple implementation of an FSM in Python for the traffic light controller:

python
Copy code
class TrafficLightFSM:
def __init__(self):
self.state = 'Green'

def transition(self, input):


if self.state == 'Green' and input == 'T':
self.state = 'Yellow'
elif self.state == 'Yellow' and input == 'T':
self.state = 'Red'
elif self.state == 'Red' and input == 'T':
self.state = 'Green'

def output(self):
if self.state == 'Green':
return 'G'
elif self.state == 'Yellow':
return 'Y'
elif self.state == 'Red':
return 'R'

# Example usage
traffic_light = TrafficLightFSM()

inputs = ['T', 'T', 'T', 'T'] # Simulate timer expiration inputs


for i in inputs:
traffic_light.transition(i)
print(traffic_light.output())

Conclusion

Finite State Machines are powerful tools for designing sequential logic circuits and algorithms.
They provide a clear and structured way to model the behavior of systems with a finite number
of states, making them invaluable in both hardware and software design.

4o

You might also like