+ Post New Thread
Results 21 to 23 of 23

7th February 2011, 13:09 #21
 Join Date
 Jun 2010
 Posts
 6,415
 Helped
 1868 / 1868
 Points
 35,010
 Level
 45
Re: How to create lookup table for sin(4(pi)x) in VHDL?
It will depend what the max and min values are. If you need range 4 to almost +4, you already need 3 bits of integer. So to make up the other 5 you multiply your number by 2^5 = 32.
on paper, multiply by 32 and get rid of any remaining fractional bits.
so here, 3.9688 = 127 = 10000001. So in reality the number is 100.000001.
Inside in FPGA there is no need for any multiplying. 10000001 in 3.5 fixed point represents 3.9688

7th February 2011, 13:09

7th February 2011, 16:30 #22
 Join Date
 Oct 2010
 Posts
 26
 Helped
 1 / 1
 Points
 497
 Level
 4
Re: How to create lookup table for sin(4(pi)x) in VHDL?
3 for binary value is 111 and for .9688 of binary value is 11111, So the answer is 111.11111, is it correct ? How did calculate? How 3.9688 is equal to 127?

7th February 2011, 16:30

7th February 2011, 16:41 #23
 Join Date
 Jun 2010
 Posts
 6,415
 Helped
 1868 / 1868
 Points
 35,010
 Level
 45
Re: How to create lookup table for sin(4(pi)x) in VHDL?
3 binary value is 101.00000, not 111.000000 (1). This is 2's compliment notation (to find a ve number, take the +ve number, invert the bits and add 1)
0.9688 is 000.11111. But we want 0.9688, which is 111.00001.
So we have 3  0.9688 = 101.00000 + 111.00001 = 100.00001 = 127 (without the point)
+ Post New Thread
Please login