hw4 Q A Homework Assignment 4
hw4 Q A Homework Assignment 4
Homework 4
(Due date: April 2nd @ 5:30 pm)
Presentation and clarity are very important! Show your procedure!
Provide the State Diagram (any representation), State Table, and the Excitation Table. Is this a Mealy or a Moore machine?
Why? (10 pts)
Provide the excitation equations (simplify your circuit using K-maps or the Quine-McCluskey algorithm) (5 pts)
Sketch the circuit. (5 pts)
resetn=0
S1
sclr 1 clock
0 resetn
s
1 s
S2
0
z E1 sclr
1
sclr 1
E
S3
state
wt 1
wt
1
z
0 done
S4
done 1
0 1
s
Complete the timing diagram of the following FSM. Is this a Mealy or a Moore machine? Why? (5 pts)
resetn = 0
x/z
1/0 clock
1/1
0/1 resetn
S1 S2
0/0 x
1/0 0/0
state S1
S4 S3 0/1
1/1
z
Provide the state diagram (in ASM form) and complete the timing diagram of the FSM whose VHDL description is listed
below. (15 pts)
when S2 =>
if a = '1' then y <= S3; else y <= S2; end if;
when S3 =>
if b = '1' then y <= S1; else y <= S3; end if;
end case;
end if;
end process;
clk
resetn
state
1 0
0
4 4 s sclr 1
0
+ p 1
resetn 4 S2
E1
E
sclr
0
z
4 1
Q sclr: synchronous clear
If E=sclr=1, then Q = 0 sclr 1
p E sclr
S3
z done 1
s FINITE STATE
MACHINE done
clock
0 1
s
clock
resetn
Q 0000
sclr
state
done
Solutions - Homework 4
(Due date: April 2nd @ 5:30 pm)
Presentation and clarity are very important! Show your procedure!
Provide the State Diagram (any representation), State Table, and the Excitation Table. Is this a Mealy or a Moore machine?
Why? (10 pts)
Provide the excitation equations (simplify your circuit using K-maps or the Quine-McCluskey algorithm) (5 pts)
Sketch the circuit. (5 pts)
𝑄0 (𝑡 + 1) = 𝐸̅ 𝑄0 + 𝐸𝑄1 ̅𝑄̅̅0̅ + 𝐸𝑄
̅̅̅2̅(𝑄1 + 𝑄
̅̅̅0̅) 01 0 1 1 0 01 0 0 0 1
̅̅̅1 𝑄
𝑧=𝑄 ̅̅̅0̅𝑄2 + 𝑄1 𝑄0 𝑄2 = 𝑄2 (𝑄
̅̅̅̅̅̅̅̅̅
1 𝑄0 )
11 0 1 1 1 11 1 1 1 1
10 0 1 1 0 10 1 1 0 1
Q0(t+1) z
EQ2 EQ2
00 01 11 10 00 01 11 10
Q1 Q0 Q 1 Q0
00 0 0 0 1 00 0 1 1 0
01 1 1 0 0 01 0 0 0 0
11 1 1 0 1 11 0 1 1 0
10 0 0 1 1 10 0 0 0 0
Circuit Implementation:
resetn
clk
E
D Q Q2
D Q Q1
D Q Q0
resetn=0
S1
0
x
1
S4
0
x
1
S5
1
x
0
S6
0
x
1
S7
1
x
0
S8
0 1
x z1
resetn=0
S1
sclr 1 clock
0 resetn
s
1 s
S2
0
z E1 sclr
1
sclr 1
E
S3
wt 1
state S1 S1 S1 S2 S2 S2 S3 S4 S4 S1 S2 S2 S2 S3
wt
1
z
0 done
S4
done 1
0 1
s
Complete the timing diagram of the following FSM. Is this a Mealy or a Moore machine? Why? (5 pts)
resetn = 0
x/z
1/0 clock
1/1
0/1 resetn
S1 S2
0/0 x
1/0 0/0
state S1 S1 S1 S2 S3 S4 S1 S2 S1 S1
S4 S3 0/1
1/1
z
The output ‘z’ does not depend on the input ‘x’ It is a Moore-type FSM.
Provide the state diagram (in ASM form) and complete the timing diagram of the FSM whose VHDL description is listed
below. (15 pts)
0 1 when S2 =>
if a = '1' then y <= S3; else y <= S2; end if;
z1
when S3 =>
S2 if b = '1' then y <= S1; else y <= S3; end if;
end case;
w1 end if;
end process;
clk
resetn
state S1 S1 S2 S2 S3 S1 S2 S3 S1 S1 S3 S1 S2 S2 S3 S3 S1
1 0
0
4 4 s sclr 1
0
+ p 1
resetn 4 S2
E1
E
sclr
0
z
4 1
Q sclr: synchronous clear
If E=sclr=1, then Q = 0 sclr 1
p E sclr
S3
z done 1
s FINITE STATE
MACHINE done
clock
0 1
s
clock
resetn
Q 0000 0000 0101 0111 1001 1011 1101 1111 0000 0000 0000 1000 1010 1100 1110 0000 0010
sclr
state S1 S1 S2 S2 S2 S2 S2 S2 S3 S3 S1 S2 S2 S2 S2 S2 S2
done