Professional Documents
Culture Documents
Exercises With Finite State Machines: CS 64: Computer Organization and Design Logic Lecture #17 Winter 2019
Exercises With Finite State Machines: CS 64: Computer Organization and Design Logic Lecture #17 Winter 2019
with
Finite State Machines
CS 64: Computer Organization and Design Logic
Lecture #17
Winter 2019
Ziad Matni, Ph.D.
Dept. of Computer Science, UCSB
Administrative
• Lab #8
– Due next week on Wednesday
– Paper copy drop off at HFH 2nd floor
Initial 0 0 0 0 0 0 0 0
1 0 0 1 0
Found “1” 0 0 1 0 0 0 0 0
1 0 1 0 0
Found “11” 0 1 0 0 0 1 1 0
1 0 1 0 0
Found “110” 0 1 1 0 0 0 0 0
1 1 0 0 0
Found “1101” 1 0 0 0 0 0 0 1
3/7/19
1 0
Matni, CS64, Wi19
1 0 1 5
3. Design the
Circuit
Note that CLK is the input to ALL
the D-FFs’ clock inputs. This is a
synchronous machine.
Note the use of labels (example: B2
or B0-bar) instead of routing wires
all over the place!
Note that I issued both Bn and Bn-
bar from all the D-FFs – it makes it
easier with the labeling and you
won’t have to use NOT gates!
Note that the sole output (FOUND)
does not need a D-FF because it is
NOT A STATE BIT!
3/7/19 Matni, CS64, Wi19 6
FPGAs and
Programmable Logic
Field-Programmable Gate Arrays
AND OR DFF
Input = 1
• We can see that Input = 0
“1” “11”
Initial
State
Input = 0
• The machine will move from the initial state only if A&&B is true. Once it
does that, however, it will go through N states sequentially, once for every
time A||B is true.
• On the last state, it simply goes to the initial state again and repeats.