Another way (con’t)
function [1:0] next_state; input in;
input [1:0] state;
case (state)
zero: if (in) next_state = one1; else next_state = zero; one1: if (in) next_state = two1s; else next_state = zero;
two1s: if (in) next_state = two1s; else next_state = zero;
default:
next_state = zero;
endcase endfunction
endmodule
Previous slide
Next slide
Back to first slide
View graphic version