next up previous contents
Next: ALU Architecture (II) - Up: Fixed-Point Arithmetic (固定小数点) Previous: Multiplication (掛け算)

Division (割り算)

Unsigned Binary Division


  
Figure 4.3: An unsigned binary divider
\includegraphics[width=8cm]{/home/david/courses/comparch/lectures/arith/figs/divide.eps}

Operation (refer to Figure 4.3)

1.
load x, set r=0
2.
shift rx register left by 1 bit
3.
if $a-b\ge0$, shift 1 into the q register and load a-b into r; if a-b<0 shift 0 into the q register
4.
repeat 2-3 until 4 bits have been shifted into the q register
5.
the results are in the q and r registers



Example

rx 0 0 0 0 | 1 0 1 1    
y 0 0 1 1    
Initial state      
rx 0 0 0 1 | 0 1 1 -    
y 0 0 1 1    
a-b < 0   q 0
rx 0 0 1 0 | 1 1 - -    
y 0 0 1 1    
a-b < 0   q 0 0
rx 0 1 0 1 | 1 - - -    
y 0 0 1 1    
a-b > 0 0 0 1 0 q 0 0 1
rx 0 1 0 1 | - - - -    
y 0 0 1 1    
a-b > 0 0 0 1 0 = r q = 0 0 1 1

Unsigned Array Divider (3-bit) $x\div y$


  
Figure 4.4: A 3-bit unsigned array divider
\includegraphics[width=13cm]{/home/david/courses/comparch/lectures/arith/figs/arraydiv.eps}


next up previous contents
Next: ALU Architecture (II) - Up: Fixed-Point Arithmetic (固定小数点) Previous: Multiplication (掛け算)
David Asano
2001-05-29