Jun 25, 2022 #1 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
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
Jun 25, 2022 #2 danadakk Advanced Member level 6 Joined Mar 26, 2018 Messages 3,135 Helped 414 Reputation 848 Reaction score 733 Trophy points 113 Activity points 13,576 Verilog is basically integer based, but to handle floats - Floating Point to Fixed Point Online Converter The other day I was in need of a tool to represent a fractional number (floating point) into its binary representation in fixed point. More... davidcastells.blogspot.com floating point in verilog I have floating point number in verilog , I wanna shift it to right to make IEEE standard, but I don't know where the point is, to understand if it is standard or not(to stop shifting) . what can ... stackoverflow.com .https://primo.wiki/w3cnote/verilog2-real2int.html Regards, Dana. Upvote 0 Downvote
Verilog is basically integer based, but to handle floats - Floating Point to Fixed Point Online Converter The other day I was in need of a tool to represent a fractional number (floating point) into its binary representation in fixed point. More... davidcastells.blogspot.com floating point in verilog I have floating point number in verilog , I wanna shift it to right to make IEEE standard, but I don't know where the point is, to understand if it is standard or not(to stop shifting) . what can ... stackoverflow.com .https://primo.wiki/w3cnote/verilog2-real2int.html Regards, Dana.