Forum Discussion

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

parameter

i wonder why i get 0 of phi1_const when i declare like this:

parameter half_cycle = 5;

phi_w = 27;

parameter fo1 =8000;

parameter phi1_const = (fo1 * (2**phi_w))* (1/(2*half_cycle));

thanks

2 Replies

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

    Hi,

    Is it a c prog ? in Nios II ?

    What kind of type is "parameter" ? Is it integer ?

    If half_cycle is integer --> (1/ (2*half_cucle)) will give 0 instead of 0.1