Forum Discussion
Altera_Forum
Honored Contributor
14 years agoFSM trouble
I am trying to understand and get working a FSM that is part of a PS/2 mouse lab I am working on. The first always block is not giving me any errors now even though I am not sure that the logic is c...
Altera_Forum
Honored Contributor
14 years agoFirst you must use clock edge for your state transitions.
second, your second always is not driving outputs as you want. Again it is better to have outputs registered or else you get latches, but anyway you should get the idea from pseudocode below
//pseudocode
always @(y_Q, plugged_in)
begin: state_outputs
case (y_Q)
S5: if (!plugged_in)
mouse_packet=1'b1;
default:
ps2_send_command = 1'b1;
ps2_command = 8'hF4;
mouse_packet = 1'b0;
endcase
end