A
ashu
Hi Dear
I am working on quantization, for this I need to divide two signed
numbers. The procedure I am using is working fine for most of the
input data but with some values results are not correct. Please
suggest me the remedy. The procedure I am using is as follows:
I. 33/22 = 1.5 =~ 2
II. 33*512\22*512
III. (33 * 23)/512 ( as 512/22 = 23.2 =~ 23)
IV. Binary representation of 33*22 (1011110111) is shifted by nine
bits right (SRA Shift right arithematic) to divide by 512 & if the
last shifted bit i.e. ninth bit is one then result is incremented by
one else leave it as such.
V. In this particular case as ninth bit is 0 thus I did not increment
the result & get the result as one which actually should be two.
It will be a great favor if anybody can help me out.
Thanks & regards
Ashwani
I am working on quantization, for this I need to divide two signed
numbers. The procedure I am using is working fine for most of the
input data but with some values results are not correct. Please
suggest me the remedy. The procedure I am using is as follows:
I. 33/22 = 1.5 =~ 2
II. 33*512\22*512
III. (33 * 23)/512 ( as 512/22 = 23.2 =~ 23)
IV. Binary representation of 33*22 (1011110111) is shifted by nine
bits right (SRA Shift right arithematic) to divide by 512 & if the
last shifted bit i.e. ninth bit is one then result is incremented by
one else leave it as such.
V. In this particular case as ninth bit is 0 thus I did not increment
the result & get the result as one which actually should be two.
It will be a great favor if anybody can help me out.
Thanks & regards
Ashwani