Design a circuit with memory.
The open ended lab asks you to design a sequential circuit from a description. Here is the procedure, and a worked sample you can play with.
Sequential logic
The output depends on the present input and on the history of the inputs, kept as a state in flip flops. A Moore machine has outputs that depend only on the state (they change at clock edges); a Mealy machine has outputs that also depend on the inputs.
State diagram
Inputs so far: -. Z = 1 in S3, right after 1, 0, 1.
State table
| Present A B | X | Next A B | Z |
|---|---|---|---|
| 00 | 0 | 00 | 0 |
| 00 | 1 | 01 | 0 |
| 01 | 0 | 10 | 0 |
| 01 | 1 | 01 | 0 |
| 10 | 0 | 00 | 0 |
| 10 | 1 | 11 | 0 |
| 11 | 0 | 10 | 1 |
| 11 | 1 | 01 | 1 |
Choice of flip flop
The input equation is the next state column itself: the easiest choice.
Fewer gates sometimes, but J and K come from the excitation table, not straight from the next state.
Good for counters: T = 1 wherever a bit must change.
Input equations
Map D_A (the next A) over A, B, X. The 1s are at A B X = 010, 110 and 101. Try it:
| A \ BX | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | ||||
| 1 |
F = Σm(2, 5, 6) = AB'X + BX'
Click a cell to cycle 0, 1, X (don't care). The rows and columns follow the Gray code, so neighbouring cells differ in one variable.D_A = B X' + A B' X, D_B = X and Z = A B.
The sample
Build it in the lab with one 7474 (both flip flops), one 7404, two 7408 and one 7432, then clock 1, 0, 1, 0, 1, 1, 0, 1 through it. For a design of your own, switch to the Free bench.
Check yourself
Q1How many flip flops does a machine with 4 states need?
Two (2² = 4).
Q2In a Moore machine, when can the output change?
Only at a clock edge, with the state.
Q3Why is the D flip flop the easiest for design?
Its input equation is the next state.
Q4In the sample, what is D_B?
X: after any 1 the machine is in S1 or S3, which both have B = 1.