Forum Discussion
Altera_Forum
Honored Contributor
8 years ago --- Quote Start --- The reason for the always_ff block not working is because you'v used the bit-wise AND (&) operator and not the logical AND (&&). Change the '&' to '&&' and try. It will trigger this time.
/*this is the part that doesn't work
always_ff @(posedge oneSecondEnable) begin
if (rollHourTens ==2 & rollHourOnes==4) begin <------ Change this to logical && from the bitwise &
reset;
end
end
*/
--- Quote End --- Altho the answer is technically correct (you should syntactically be using && here instead of &) it won't change the result ... the result of x==y will be '0' or '1', and &ing two of these together will still produce a single bit result '0' or '1' that can be tested by the if. What does the line 'reset;' refer to? There is no other code (like a function or task or block) with this name in your code listing.