Created
June 27, 2012 16:17
-
-
Save mandel59/3005151 to your computer and use it in GitHub Desktop.
これだと論理合成できないそうです
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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