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?
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?