radix 2 srt division

January 16, 2010 at 03:56:58
Specs: win
hello
Does somebody knows about RADIX 2 SRT division ?
I cant understand all of it !

z : dividend
d : divisor
Q : quotient
s : remainder

this is the algorithm(pseudo code) :

z = s(0)
for j=1 to k
if 2s(j-1) > 1/2 then
q(j) = 1;
s(j) = 2s(j-1) -d ;
els if s(j-1) <-1/2 then
q(j) = -1;
s(j) = 2s(j-1) +d ;
else
q(j) = 0;
s(j) = 2s(j-1);
end if ;
end for;


and this is an example :


z 0.01000101
d 0.1010
-d 1.0110
=============================
s(0) 0.01000101
2s(0) 0.1000101 >1/2 so q(-1)=1
+(-d)
=============================
s(1) 1.1110101
2s(1) 1.110101 in [-1/2,1/2) so q(-2)=0
=============================
s(2) 1.110101
2s(2) 1.10101 <-1/2 so q(-3)=-1
+d 0.1010

=============================
s(3) 0.01001
2s(3) 0.1001 >1/2 so q(-4)=1
+(-d) 1.0110
=============================
s(4) 1.1111 negative so add to correct
2s(4) 0.1010
=============================
s(4) 0.1001
s 0.0000 1001
q 0.10(-1)1 uncorrect BSD quotient
q 0.0110 convert and subtract ulp

i think this is not true : (line 13)
s(2) 1.110101
2s(2) 1.10101 <-1/2 so q(-3)=-1
+d 0.1010

and what is "ulp" and how convert 0.1.(-1)1 to 0.0110 ?

thnx

Impossible is nothing !!!


See More: radix 2 srt division

Report •

#1
January 19, 2010 at 10:39:58
Is this a programming language or a logical calculator or so ?

Report •

#2
January 21, 2010 at 06:03:59
it is a pseudo code but i need it in VHDL language ,

Impossible is nothing !!!


Report •
Related Solutions


Ask Question