State Reduction and State Assignment
Last Updated : 13 Sep, 2024
To illustrate the process of state reduction and state assignment first we have to know the concepts of the state diagram, state table, and state equation. In this article, we are going to learn all the topics related to state reduction and assignment.
What is State Diagram?
The state graph or state diagram is a pictorial representation of the relationships between the present state, the input state, the next state, and the output state of a sequential circuit i.e. A state diagram is a graphical representation of a sequential circuit's behavior.
Example: Consider an excitation table of J-K flip-flop
The state diagram of the above table is
State Diagram of J-K flip-flop What is State Table?
Even though the behavior of a sequential circuit can be conveniently described using a state diagram, for its implementation the information contained in the state diagram is to be translated into a state table. The tabular form of the state diagram is the state table. The present state, the next state, and the output are the three sections of the diagram.
The State Table of JK flip-flop is
Inputs | Present state | Output |
---|
J | K | Q | Q+ (Output) |
---|
0 | 0 | 0 | 0 |
0 | 0 | 1 | 1 |
0 | 1 | 0 | 0 |
0 | 1 | 1 | 0 |
1 | 0 | 0 | 1 |
1 | 0 | 1 | 1 |
1 | 1 | 0 | 1 |
1 | 1 | 1 | 0 |
State equation: Qn+1 = Qn bar J + Qn K bar
What is State Reduction?
The state reduction technique generally prevents the addition of duplicate states. The reduction in redundant states reduces the number of flip-flops and logic gates, reducing the cost of the final circuit. Two states are said to be equivalent if every possible set of inputs generates exactly the same output and the same next state. When two states are equal, one of them can be eliminated without changing the input-output relationship. The state reduction algorithm is applied in the state table to reduce equivalent states.
Advantages of State Reduction
- Reduced Complexity: Lesser number of states result in a reduced complexity of circuits with lesser flip-flops and logic gates.
- Cost Efficiency: Overall cost of the circuit is diminished because of the decision taken for the simplified design.
- Improved Performance: Increased throughput among other features such as low power consumption.
Disadvantages of State Reduction
- Design Time: State reduction may take more time to analyze and compute the data as compared to analyzing the parameter trajectory directly.
- Potential Information Loss: It thus requires precaution so that none of the important information is overlooked during the reduction process.
What is State Assignment?
State assignment refers to the process of assigning binary values to the states of a sequential machine. The binary values should be given to the states in such a way that flip-flop input functions may be implemented with a minimum number of logic gates.
Types of State Assignment Techniques
- Binary Assignment: Gives binary numbers to states on one-to-one basis. This is clear and properly executable yet it may sometimes lead to the creation of an utmost low logical condition.
- Gray Code Assignment: It utilizes Gray codes to bring about minimum change of transition between the states hence reducing the chances of getting glitches in the logic.
- One-Hot Assignment: Conveys each value that specifies a state by means of a specific position of the bits, in which only the one is set to 1. This makes the combinational logic simpler but at a cost of more numbers of flip-flops.
State Assignment rules are as follows
Rule 1: States having the same next state for a given input condition should have assignments that can be grouped into logically adjacent cells in a K-map.
Rule 2: States that are the next states of a single state should have assignments that can be grouped into logically adjacent cells in a K-map.
Example 1: To explain the concept of state reduction let us consider the state table as
Present state | Next state | Output |
---|
X=0 | X=1 | X=0 | X=1 |
---|
a | a | b | 0 | 0 |
b | c | d | 0 | 0 |
c | a | d | 0 | 0 |
d | e | f | 0 | 1 |
e | a | f | 0 | 1 |
f | g | f | 0 | 1 |
g | a | f | 0 | 1 |
The state diagram for the above state table is
State diagram before reductionStep1: First here we are supposed to identify two or more similar states in the next state and output state. In the above table if we observe states of e and g are having the same next state and output values for all combinations of input i.e. X=0 and X=1.
So eliminate the g state in the state table and wherever g is present replace it with e. Because e and g both are the same i.e. e=g.
Present state | Next state | Output |
---|
X=0 | X=1 | X=0 | X=1 |
---|
a | a | b | 0 | 0 |
b | c | d | 0 | 0 |
c | a | d | 0 | 0 |
d | e | f | 0 | 1 |
e | a | f | 0 | 1 |
f | e(g=e) | f | 0 | 1 |
Step 2: Again check if any two states have similar values or not. If any two states have the same next state and output then eliminate one state.
Here d and f are having the same next state value and output. So eliminate f and wherever f is present replace it with d. Because both are the same d=f
Present state | Next state | Output |
---|
X=0 | X=1 | X=0 | X=1 |
---|
a | a | b | 0 | 0 |
b | c | d | 0 | 0 |
c | a | d | 0 | 0 |
d | e | d(d=f) | 0 | 1 |
e | a | d(d=f) | 0 | 1 |
Step 3: Further observe if any similar states are present or not. The states c and e are having same next states but they are having different outputs. So we can not consider it a reduction state.
State diagram After reductionStep 4: If you observed the state table, the states are represented by using the alphabet. We can not proceed further if we are having alphabets, so, assigning binary numbers to alphabets is called a state assignment.
To assign binary numbers to the state we have to consider the minimum number of bits.
The codes must contain n bits for a circuit with m states, where 2n >= m. In this case, each state requires 23 >=5=>3 bits to be represented. With three bits, there are eight possible combinations, of which five can be used to represent the states.
State | Assignment 1 |
---|
Binary |
---|
a | 000 |
b | 001 |
c | 010 |
d | 011 |
e | 100 |
Step 5: Replacing the alphabets with binary numbers.
Present state | Next state | Output |
---|
X=0 | X=1 | X=0 | X=1 |
---|
000 | 000 | 001 | 0 | 0 |
001 | 010 | 011 | 0 | 0 |
010 | 000 | 011 | 0 | 0 |
011 | 100 | 011 | 0 | 1 |
100 | 000 | 011 | 0 | 1 |
Advantages of State Assignment
- Minimized Logic Gates: Pre allocation of states on the hardware component can also have an impact of minimizing the number of logic gates in use.
- Simplified Implementation: Some of the state assignment techniques such as Gray coding and one-hot encoding are beneficial in simplifying the circuit design and also improving on the errors that might be present.
Disadvantages of State Assignment
- Increased Flip-Flops: Some of these techniques such as one-hot encoding may need more flip-flops as compared to other techniques.
- Complexity in Assignment: Deciding on which state should be assigned to an AP can be a challenging task and requires sometimes even a huge amount of time.
Conclusion
State reduction and state assignment are very useful in the design of the sequential circuits. State reduction enable fewer numbers of states hence easier in the design of the circuit than state assignment which optimizes the binary form of the states in order to reduce complexity of the circuit. By doing so, these techniques will enable designers to come up with better and more efficient cost-effective digital systems.
Similar Reads
Introduction of Algorithmic State Machines (ASMs) Introduction : In digital systems, the binary information is divided into data and control information.Data information is manipulated by various operations like arithmetic, shift, and logic. These operations are implemented by multiplexers, decoders, counters, and shift registers.Control informatio
4 min read
State Space Search in AI State Space Search is used to solve problems by finding different possible states and their transitions. In simple terms itâs like finding the best route to goal by trying different paths. In this article, we will understand it and implement Breadth-First Search (BFS) to solve the 8-puzzle problem.T
9 min read
Handling State and State Management | System Design State management is a critical aspect of system design that involves managing the state or condition of a system at any given point in time. In software development, state refers to the current values of variables, data, and configurations that determine the behavior of an application or system. Eff
12 min read
State Transition Matrix and Diagram State Transition Matrices and Diagrams are powerful tools used in the various disciplines including the computer science, engineering and control systems to model the behavior of the systems that transition between the different states. Understanding these concepts is crucial for the students and pr
9 min read
Understanding React State and Data Flow React, a very popular JavaScript library used for building user interfaces has the concept of components and they can manage the states efficiently. ReactJs is based on the concept of uni-directional data transfer. In this article, we will understand React State and Data Flow across the application.
4 min read