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 ago --- Quote Start --- The thing is that I have a random Integer input in the 0 - 579 range, without any fractions, simply integers :) ...(xmin-xmax) This need be scaled to the -1 to 1 range --- Quote End --- What is the data being generated from? And what is being done to it afterwards? If the number is being filtered or processed, perhaps you don't need to change the input, but rather, change the filter gain, so that the filtered number has the right power levels. A method like the one Kaz suggested should work fine. If you want more accuracy in the least-significant bits, then as he suggests, just add more bits. If you can describe what you are doing, we can probably give you alternative solutions. Cheers, Dave