# Finite State Machines: Features & State Diagrams

Shadi has a Ph.D. in Computer Science and more than 20 years experience in industry and higher education.

Sequential circuits are often built as control units for complicated digital systems, such as CPUs. In order for a circuit to be able to control other parts of a system, they should themselves be able to control their own behaviour. In this lesson, we will take a look at the control aspect of sequential circuits.

## Introduction

Sequential circuits are logic circuits that implement two concepts that we cannot easily implement using combinational circuits. These two concepts are memory and time. A circuit that is able to implement these two concepts is able to be in one state during a certain duration of time (memory) and then (time) change its state to another one. For example, counters and registers are able to stay in one state during a certain period of time, and they might change their state when a certain event takes place. For example, a counter that counts the number of people entering a room keeps the counted value until someone enters the room. This event will increase counted value by one, or in other words, change the state of the counter.

Counters and registers change their state in a fixed predefined way. In other words, there is only one transition from each state. This means that the state transitions in the circuit cannot be controlled by external and/or internal events. For example, if a counter is in state 4, its next state when a counted event takes places will be 'always' 5.

In general, sequential circuits are able to 'choose' a transition out of a state depending on the transition condition. In other words, a state might have more than one outgoing transition, each depends on one or many conditions.

## State Machines

The general case of a sequential circuit is that it is able to 'control' the state transition. In other words, when the circuit is in a certain state, the next state could be one out of a number of states, depending on the values of the inputs. Let us use the example of the counter to understand this concept. As mentioned above, in the case of a simple (uni-directional) counter there is only one 'next state' for each state. However, what if we want to design an up/down counter? In this case, the counter has, in addition to the data input, a control input. This control input will decide if the counter is to count up or down. Figure 1 shows an example of this counter. In this figure, the control input controls the counting direction. For example, if the control input is set to count up and the state of the counter is 4, the next state will be 5. However, if the control input is set to count down, and the state of the counter is 4, the next state will be 3.

As shown in the counter of Figure 1, there are two transitions for each state, or in other words, there are two next states for each current state, and 'the' next state is chosen as a function of the control input.

This general case of sequential circuits is very commonly called finite state machines. A finite state machine is a system that can be in exactly one state at a time, and the global number of the states it can be in is a finite number. If the counter in the above-mentioned example is a 3-bit counter, then the number of the states it can be in is 8. At a certain time, the counter can be in exactly one state, which represents the counted number. Notice that the number of the states does not change if the counter is uni-directional or an up/down counter. A counter is a finite state machine.

To unlock this lesson you must be a Study.com Member.

### Register to view this lesson

Are you a student or a teacher?

#### See for yourself why 30 million people use Study.com

##### Become a Study.com member and start learning now.
Back
What teachers are saying about Study.com

### Earning College Credit

Did you know… We have over 200 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.