Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17249 Discussions

Is this code synthesizable with Quartus?

Altera_Forum
Honored Contributor II
1,287 Views

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
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
575 Views

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
0 Kudos
Reply