Dividing two fixed point number presents another problem. Let n′ and r′ represent the actual values of the dividend and
divisor, respectively. We’ll also use x′ to represent the actual value of . n and r are the fixed point representations of n′ and
r′. Based on our assumption that the implicit binary point is between bit 3 and bit 4, n′ = n∕100002, and
r′ = r∕100002.
The question is whether x = is the actual representation of x′. Using the represented values, x′ =
. Let us first
compute x′′ = n∕r. Note that x′ = x′′! This is bad, because the representation of x′ is supposed to be x′(100002). In other
words, x′′ does not have an implicit binary point between bit 3 and bit 4! x′′ is not expressed in units of
1∕100002. If we interpret x′′ as a fixed point number, its interpreted value will be 100002 smaller than it should
be.
To make x′′ express in units of 1∕100002, we can first multiply n by 100002, then carry out the division. This means that
we can compute x = so that. This makes x′′ = (100002)(n′∕r′), which also means that x′′∕100002 is the approximate
value of n′∕r′.
Do we have rounding problems? Yes! This is because the actual division between n and r is done by integer division. Integer division truncates the fractional part of the result!
We can fix this problem by first multiply the dividend by 1000000002, get the quotient, round it, then right shift it 4 times. In other words, we can compute the fixed point result as x = rs(((n(1000000002))∕r) + 10002,4).