Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How save the floating numbers in reg verilog?

Status
Not open for further replies.

stackprogramer

Full Member level 3
Joined
Jul 22, 2015
Messages
181
Helped
0
Reputation
0
Reaction score
1
Trophy points
1,298
Activity points
2,668
Hi, I define some reg variable when I initialize reg with integer, Everything is ok.

Code:
reg [15:0] a;
reg [15:0] b;
reg [15:0] c;
a=1;
b=2;

c=a*b;

When I want to initialize reg value with float I face with errors...
Code:
a=.005
b=-.004
c=a*b
Anyone can guide me? thanks in advance
 

Verilog is basically integer based, but to handle floats -



.https://primo.wiki/w3cnote/verilog2-real2int.html


Regards, Dana.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top