Académique Documents
Professionnel Documents
Culture Documents
I.
a.
b.
c.
d.
e.
f.
g.
h.
c.
d.
e.
ii.
iii. Hardware perspective
f.
g.
iv.
There is a five-step design procedure
i. Step 1: Draw the state transition diagram
ii. Step 2: Write truth tables for nx_state and output. Rearrange truth tables, replacing state
names with corresponding binary values
iii. Step 3: Get the boolean expression for nx_state and output
iv. Step 4: Draw the circuit, placing all D flip-flops in the lower section and the combination
logic in the upper section
v. Step 5 (optional): Add D flip-flops at the output to eliminate glitches
ii.
iii. Notice that each block points to the next highest binary number. Nine points to three,
however.
iv. Step 2: We should set up a truth table! A number not on here (such as 1100) can be
represented by a dont care (x)
previous_state
next_state
(q3, q2, q1, q0) (ex. 0011)
(d3, d2, d1, d0) (ex. 0100)
0011
0100
0100
0101
0101
0110
0110
0111
0111
1000
1000
1001
1001
0011
v. Step 3: Requires us to find the boolean expressions. We can do this with a karnaugh map.
However, I omitted the maps to skip to the main point.
1. d3 = (q3)(q0) + (q2)(q1)(q0)
2. d2 = (q2)(q1) + (q2)(q0) + (q2)(q1)
3. d1 = (q1)(q0) + (q1)(q0)
4. d0 = (q3) + (q0)
vi. Step 4: Transfer our Boolean equations into a clear circuit diagram.
h.
1.
Study the FSM template! It is quite useful (Model 22)
i.
i.
j.
k.
l.
We explore some examples of FSMs. The first one will be a BCD counter (Model 23)
i. I usually imagine this as implementing a clock
ii. rst 0000 0001 0010 0011 0100 0101 1001 0000
iii.
Finite State Machine with two state (stateA and stateB) example Model 24
i. Everytime d = 1 is received, the current state changes into the other
ii. The desired output is x = a when machine is in stateA
iii. The desired output is x = b when machine is in stateB
iv. The initial (rst) state is stateA
v.
A third FSM example
i. It is the same as the previous example, except we want the output to be synchronous (to
change only when the clock rises)
A fourth FSM example String Detector Model 25
i. Design a circuit that takes as input a serial bit stream
ii. Outputs 1 when the sequence 111 occurs
iii. Overlaps must be considered. If 0111110 occurs, the output remains active for three clock
cycles.
iv.
II.
Encoding Styles
a. Sequential (*)
b. Gray
c. Johnson
d. One-hot
e. User-defined
f. How many states can be encoded with n=4 flip-flops using:
i. Sequential:
16 = 2**n
ii. Gray:
16 = 2**n
iii. Johnson:
8 = 2*n
iv. One-hot:
4=n
g. When to use which?