T
Troels Smit
Guest
Hi all,
I have to convert a 1QN number into a 2' complement number both 20 bit
wide.
1QN define numbers between -1 and 1-(2^-n) with a binary point after 2
first bits.
i.e:
+1 : 0100 0000 ...
-1 : 1100 0000 ...
pi/8 : 0011 0010 ...
-pi/8 : 1100 1101 ...
The 2'complement number is between 1 and -1, where 7FFFF define 1 and
8FFFF define -1.
i.e:
+1 : 0111 1111
-1 : 1000 0000
+1/8 : 0000 1111
-1/8 : 1111 0001
Does anyone have an idea of how to convert between these two formats ?
It is the 1Qn that has to be converted into the 2'complement number.
I have to convert a 1QN number into a 2' complement number both 20 bit
wide.
1QN define numbers between -1 and 1-(2^-n) with a binary point after 2
first bits.
i.e:
+1 : 0100 0000 ...
-1 : 1100 0000 ...
pi/8 : 0011 0010 ...
-pi/8 : 1100 1101 ...
The 2'complement number is between 1 and -1, where 7FFFF define 1 and
8FFFF define -1.
i.e:
+1 : 0111 1111
-1 : 1000 0000
+1/8 : 0000 1111
-1/8 : 1111 0001
Does anyone have an idea of how to convert between these two formats ?
It is the 1Qn that has to be converted into the 2'complement number.