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

parameter

Altera_Forum
Honored Contributor II
1,440 Views

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
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
647 Views

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
0 Kudos
Altera_Forum
Honored Contributor II
647 Views

It is verilog.

0 Kudos
Reply