Skip to content

Instantly share code, notes, and snippets.

@mandel59
Created June 27, 2012 16:17
Show Gist options
  • Save mandel59/3005151 to your computer and use it in GitHub Desktop.
Save mandel59/3005151 to your computer and use it in GitHub Desktop.
これだと論理合成できないそうです
module seripara (clk, si, res, ena, q);
input si, res, ena, clk;
output [3:0] q;
reg [3:0] q;
reg [1:0] state;
always@(negedge res or posedge clk)
begin
if (~res)
begin
q <= 4'b0000;
state <= 2'd3;
end
if (ena)
begin
q[state] = si;
state = state - 1;
end
end
endmodule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment