Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
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.
21615 Discussions

Wrong in Modelsim

Altera_Forum
Honored Contributor II
1,280 Views

Hi. I'm using Modelsim to calculate numbers. Please help me why my code is wrong. I'm thinking I wrong in assign " c=a+b; " 

 

 

--- Quote Start ---  

 

module add_fixed; 

parameter a=1.0525; 

parameter b=2.012; 

c=a+b;  

initial begin 

$display("Sum is: %f",c); 

end 

endmodule 

 

--- Quote End ---  

0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
601 Views

no one can answer me ? I need

0 Kudos
Altera_Forum
Honored Contributor II
601 Views

module add_fixed; 

parameter a=1.0525; 

parameter b=2.012; 

initial begin 

c=a+b;  

$display("Sum is: %f",c); 

end 

endmodule
0 Kudos
Reply