Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

parameter

Altera_Forum
Honored Contributor II
1,458 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
665 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
665 Views

It is verilog.

0 Kudos
Reply