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

Syntax to conditionally assign integer or parameter

Altera_Forum
Honored Contributor II
1,074 Views

Appreciate any help on how to assign an integer or parameter based on a signal, I know the following isn't correct, but i think you can see what I am trying to accomplish. RATE is latter used in an equation with other parameters. Does RATE have to be a parameter for the equation to work?  

 

wire low; 

 

RATE = low ? 3 : 4; 

 

---- 

if(BCK_DIV >= REF_CLK/(RATE*DATA_WIDTH*CHANNEL_NUM*2)-1 )
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
348 Views

I got it figured out -  

 

integer SAMPLE_RATE; 

always @(*) 

SAMPLE_RATE <= toneSelect ? 68000 : 48000;
0 Kudos
Reply