Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

Is this code synthesizable with Quartus?

Hi all,

I'm new in the industry, and now I have one code using the for loops.

Someone suggests that it could not be synthesizable. Could anyone explain why?

Thanks in advance.


integer i,N;
parmeter N=7;
reg  A;
 
always @ (A)
  begin
    oddparity=1'b0;
    for(i=0;i<=N;i=i+1)
      if(A) oddparity=~oddparity;
  end

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    It's synthesizable, because it's simply evaluates to an XOR of all bits of A, but it can be simplified to

    oddparity =^ A; // reduction XOR operator