Hi all
i want to implement the following mathematical equation in verilog:
slopeup=(y2-y1)/(x2-x1)
slopeup after calculations will be like 0.01456... or -0.013478......... etc.
Plz can anybody tell me how to accomodate numbers like this in verilog???? Plz reply soon. Waiting
Negative numbers are generally represented as 2's compliment in hardware.
While fractional numbers, may be represented by 'fixed point' or floating point.
Fixed point is simpler form, but may not have a vast 'range'.
If you see some of the c progrmas on the following site, you will get an idea how to represent fractional/decimal numbers using fixed point binary. http://www.vlsiip.com/cindex.html
Kr,
Avi