Verilog question for CPLD programming arithmetic

Status
Not open for further replies.

gren

New Member
greetings- not strictly mcu related (if anyone can suggest a more appropriate forum let me know) but...

I'm trying to multiply and divide non integer real values I.e. I want to divide the integer 1 by a register value.

E.g.

input wire;
output result;

reg signed [31:0] result;
wire [31:0] count;

result = 1/(20 * count);

however, this will not work, as I get an error saying "real numbers are not supported" and "real variable data types not supported". How can I do this seemingly simple operation with verilog? Any help much appreciated

also, does anyone know if there is a simple implementation for absolute value in verilog.....something like the equivalent of abs(some_number) = ...? does $unsigned(some_number)=... work in the same way?
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…