Created
January 29, 2014 18:22
-
-
Save tejainece/8693815 to your computer and use it in GitHub Desktop.
Where not to assign wire and reg in Verilog. This was written for demonstration purposes in my blog post.
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 RegAssignmentWrong( | |
output reg o, | |
input in1, | |
input in2 | |
); | |
assign o = in1 & in2; | |
endmodule |
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 WireAssignmentWrong( | |
output o1, | |
input in1, | |
input in2 | |
); | |
always @(in1, in2) begin | |
o1 <= in1 & in2; | |
end | |
endmodule |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment