Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.

Latest threads

New Articles From Microcontroller Tips

Back
Top