Continue to Site

# conversion of negative real numbers............

Status
Not open for further replies.

#### pinkyvidya

##### Member level 2
Any one please help me in converting a negative real number having both integer and fractional part into binary and tell me a method to multiply a real constant with a negative fractional number in binary....i need conversion in fixed point format.....thanks in advance.....

For eg:
1: how to convert -3.675 into binary
2: multiply 34 and -0.75 in binary

One way is to convert it to the floating point notation. Then you´ll have a mantissa (signed or not) and an exponent. Convert the mantissas to positive numbers and keep tracking of the signals. Then you can multiply the mantissas and work on the exponents to get your result. Finally, calculate the final sign. Your results will be in the floating point format. You can work on them to restore them to the binary notation (with some truncation) if you want. This task is very easy to perform if you´re using a C compiler. All you need is to declare your variables as "float" and the final result as "int".
Regards

Thanks for the reply....but i need conversion in fixed point format since i am working with fixed size....also i need to know how to use verilog to represent it....

Status
Not open for further replies.