Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 A counter counts Number of elements in counter determines how many different states we need For example, an eight-state counter can count eight steps.

Similar presentations


Presentation on theme: "1 A counter counts Number of elements in counter determines how many different states we need For example, an eight-state counter can count eight steps."— Presentation transcript:

1 1 A counter counts Number of elements in counter determines how many different states we need For example, an eight-state counter can count eight steps Counter state machine X= Y= Z=

2 2 Counter need not have always number of states that is equal to a power of 2 Here is a five state counter Is it simpler? Another counter X= Y= Z=

3 3 Output in a state may depend on state or state and input –Mealy machine: Output depends on both current state and current input –Moore machine: Output depends on current state Thus we have two different circuits to implement –1. Decides what is the next state –2. Decides what is the output Both circuits are combinational States are remembered by memory elements –Latches and Flips-flops are used to remember states And what about output

4 4 The two sets of circuits are shown Next state logic determines next step based on current state and next input Output logic determines the output based on current state Mealy machine will have slight different structure Overall structure of a State machine Next State Logic INPUTSINPUTS Output Logic OUTPUTSOUTPUTS

5 5 Design a state machine that will repeatedly display in binary values 1, 3, 5, and 7 Solutions: –How many states we need? –What is the state transition diagram? –What is the output in each state? –What is the next state logic? –Construct the truth table with state variables –Derive the output logic –Draw the circuit Example

6 6 We need four states, S0, S1, S2, S3 State transitions diagram is State transition table, implementation level state transition table, output table, and implementation level output tables are And the logic equations are Example (contd.) S0S1S2S3 L2 = XY’+XY = XX := X’Y+XY’ L1 = X’Y+XY = YY := X’Y’+XY’ = Y’ L0 = X’Y’+X’Y+XY’+XY = X’+X = 1


Download ppt "1 A counter counts Number of elements in counter determines how many different states we need For example, an eight-state counter can count eight steps."

Similar presentations


Ads by Google