Forum Discussion
Altera_Forum
Honored Contributor
17 years agoHi Xristos,
I am aware that you are doing 2's complement. But since the Matlab model shows positive values only then I think you can safely consider all values to be so (unless proved otherwise). You may therefore either assume all 16 bits as magnitude bits(even though they are meant to cover negative values. Then you will need to offset values down if you want + representation. If in doubt you may as well use 15 bits and move the '1' to bit (30) rather than bit(31) for the num. For the denum move the bit to bit(16). In this case you will cover 15 bits only(even after any offset). For offset you can subtract each value by a the mean(you don't need to compute the mean in real time but you can precompute it)