mirror of
https://github.com/supleed2/ELEC40006-P1-CW.git
synced 2024-11-10 02:05:48 +00:00
28 lines
300 B
Coq
28 lines
300 B
Coq
|
module SM_pipelined (CLK, RST, E2, EXEC1, EXEC2);
|
||
|
|
||
|
input CLK;
|
||
|
input RST;
|
||
|
input E2;
|
||
|
output EXEC1;
|
||
|
output EXEC2;
|
||
|
|
||
|
reg s = 0;
|
||
|
|
||
|
assign EXEC1 = ~s;
|
||
|
assign EXEC2 = s;
|
||
|
|
||
|
always @(posedge CLK) begin
|
||
|
if(!RST)
|
||
|
if(!s)
|
||
|
if(E2)
|
||
|
s <= 1;
|
||
|
else
|
||
|
s <= 0;
|
||
|
else
|
||
|
s <= 0;
|
||
|
else
|
||
|
s <= 0;
|
||
|
end
|
||
|
|
||
|
endmodule
|