Forum Discussion
Altera_Forum
Honored Contributor
15 years agoProblems with Verilog % Modulo and if-Statements
Hi all, I got a problem with a normally relatively straightforward piece of Verilog code representing some modulo arithmetics and an if-statement. In the code below, the modulo of the r...
Altera_Forum
Honored Contributor
15 years agoJonas,
Maybe it's because you stripped the code down to a small snippet. For me it seems you mix-up a program and a model. If there is an edge triggered block @(posedge wb_clk_i) and blocking assignments inside the block than in most cases there is this mix-up. I recommend to use non-blocking assigmnents and to keep in mind that all assignments execute in parallel. The if statement never takes the result from the aforementioned modulo operation at the same clock edge. Harald