Professional Documents
Culture Documents
vhd
Cnta Cntb Chap 22
Rb
1-to-6 1-to-6 Roll
Cntr Cntr C
o Ra
Dpatha.vhd n
Adder t
dicesum r
D7 o
Dpathb.vhd Test win
D11 l
Logic
D2312
Point Comparator eq lose
Register
sp
BR 1/99 1
BR 1/99 2
S2 Win
S3 Lose
BR 1/99 3
1
Finite State Machine Changes (cont).
Because we don’t have debounced switches, added extra “roll”
input called “Ra”. Changed States S1, S5 to use Ra, not Rb.
S1
This means that to
0 roll the dice, you
Ra Roll use flip switch Rb
1 up, then down.
This starts the
S5 dice rolling. To
stop the dice, Flip
0 Ra switch up then
Ra Roll
1 down.
BR 1/99 4
Test D7 (1 if sum=11)
Register Logic
Dicesum D2312
(from DIN (1 if sum=2,3 or 12)
dpatha) 4
sp LD
(from Point Compare Eq
control) (1 if point = sum)
4
Clk C
Reset R
“sp” (save point) loads value
of dicesum into register.
BR 1/99 6