Forum Discussion
Altera_Forum
Honored Contributor
9 years agoWhat's the difference between these two pieces of simple code?
Do you think there is a difference in functionality between these codes? always @(posedge clk)
begin
A<=0;
if (sel==0)
A<=in_u;
...
Altera_Forum
Honored Contributor
9 years ago --- Quote Start --- Okay, so that simply means: 1) Assignment in different 'always' blocks --> they are evaluated in parallel, resulting in multiple driver error 2) Assignment in the same 'always' block --> they are evaluated in sequential, where it will reset initially before going into a MUX --- Quote End --- You need to understand the underlying hardware. 1) It generates 2 bits of logic that have both outputs wired together. Each always block creates some logic. 2) Yes - but there is no reset occuring, because the assignment to 0 is overriden and thus ignored.