always @ (posedge clk)
begin
if(reset)
begin
opc_iraddrs <= 16'h0000;
state <= 0;
end
else begin
if(ena)
begin
casex(state)
1'b0: begin
opc_iraddrs[15:8] <= data;
state <= 1;
end
1'b1: begin
opc_iraddrs[7:0] <= data;
state <= 0;
end
default : begin
opc_iraddrs[15:0] <= 16'hxxxx;
state <= 1'bx;
end
endcase
end
else
state <= 1'b0;
end
end
endmodule
文章评论(0条评论)
登录后参与讨论