CSE370 Quiz 5 Solution
1. Below is a data-path and a corresponding Mealy
state machine for the Shell Game machine. It has three inputs (A,
B, C) which are mutually exclusive (only one occurs at any one time). A
pair of inputs determines which two registers will have their values exchanged.
Complete the state diagram below by adding conditions and outputs for the
two shaded states.
2. Given the partial state table below, write
the logic equation for AtoB and AtoC. Specify the state encoding you would
use if three state bits are used to represent the state.
State = [ bit1, bit2, bit3 ] S0 = [ _0_ , _0_ , _0_ ] SA = [ _1_ , _0_ , _0_ ] SB = [ _0_ , _1_ , _0_ ] SC = [ _0_ , _0_ , _1_ ] AtoB := B bit1 + A bit2 AtoC := C bit1 + A bit3 BtoC := C bit2 + B bit3 BtoA = AtoB CtoA = AtoC CtoB = BtoC bit1 := bit1' bit2' bit3' A bit2 := bit1' bit2' bit3' B bit3 := bit1' bit2' bit3' C inputs c.s. n.s. outputs A B C AtoB AtoC BtoA BtoC CtoA CtoB 1 0 0 S0 SA 0 0 0 0 0 0 0 1 0 S0 SB 0 0 0 0 0 0 0 0 1 S0 SC 0 0 0 0 0 0 1 0 0 SA S0 0 0 0 0 0 0 0 1 0 SA S0 1 0 1 0 0 0 0 0 1 SA S0 0 1 0 0 1 0 1 0 0 SB S0 1 0 1 0 0 0 0 1 0 SB S0 0 0 0 0 0 0 0 0 1 SB S0 0 0 0 1 0 1 1 0 0 SC S0 0 1 0 0 1 0 0 1 0 SC S0 0 0 0 1 0 1 0 0 1 SC S0 0 0 0 0 0 0