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

### Division (割り算)

• x/y = q + r
• if y=0, do not attempt to divide
• division is done by repetitive subtraction

Unsigned Binary Division

Operation (refer to Figure 4.3)

1.
2.
shift rx register left by 1 bit
3.
if , 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)

• a 3-bit unsigned array divider is shown in Figure 4.4
• first compute bout: if x-y-bin<0 then bout=1
• next compute r: if c=1 then r=x; if c=0 then r=(x-y-bin) mod 2

• faster operation is obtained at the expense of more hardware

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