Forum Discussion

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

Syntax to conditionally assign integer or parameter

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 )

1 Reply

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

    I got it figured out -

    integer SAMPLE_RATE;

    always @(*)

    SAMPLE_RATE <= toneSelect ? 68000 : 48000;