Forum Discussion
Altera_Forum
Honored Contributor
15 years agoNumber Scaling
Hi, What is the most efficient way to scale numbers into the range of -1, 1 in Verilog using Cyclone II? That is the fastest code with least resources? are there any free IP cores from Altera o...
Altera_Forum
Honored Contributor
15 years agoyou need to explain when you say it does not match the value, which value? Accuracy can be increased by better rounding the term:
(2^16-1)/579 which = 113.18652849740932642487046632124... e.g. maultiply by 2^10 = 115903.005 = 115903 then truncate 10 LSBs from result then subtract 32767. Your format of 1 sign 5 integer 10 fraction is not covered in above equation as I assume 1 sign 15 fraction since you hardly need 1 bit for integer(-1 ~ +1)