In addition to the great posts above for the use of fixed point arithmetic:

Notation: u(5,3) means unsigned, 5 integer and 3 fractional bits.

There is a simple rule for fixed point arithmetic.

For additions or subtractions you need to use the same number of fractional bits at the input. The result will have the same number of fractional bits. Integer bits will increase by one.

So u(5,3) + u(9,3) will become u(10,3)

e.g. 1.5 + 2.25 = 3.75 --> 12 + 18 = 30

For multiplications and division the number of fractional bits at the inputs can differ. For multiplications the resulting fractional bits will be the sum of the input fractional bits. The resulting integer bits will be the sum of the input integer bits.

So u(5,3) * u(2,8) will become u(7,11)

e.g. 1.5 * 2.25 = 3.375 --> 12 * 576 = 6912

Johannes