1/6
Looks like no tags are added yet.
Excess n
An alternate way to represent negative numbers.
Set the excess so that the lowest possible negative number becomes zero.
Pros: doesn’t lose a bit to the sign like in sign and magnitude or two’s complement.
Cons: arithmetic issues
aka as offset binary
Guard digits
If you are expecting a calculation to result in more decimals than you currently have, you can anticipate this by adding extra bits from the start (and set as 0). This is to prevent a loss of precision.
e.g. without guard digit: 5 / 2 = 2 (remainder 0.5 is discarded since we are using a fixed amount of bits)
e.g. with guard digit 5.0 / 2.0 = 2.5
IEEE-734 tutorial
Format: sign (1 bit) exponent (8 bits) mantissa (23 bits)
Convert mantissa to binary (ignore the sign for now, treat as positive number)
Normalise so 1 is at the front like so ‘1.0..’ or ‘1.1..’
Write down the new exponent from normalising and add the excess 127 to it.
Drop the 1 at the start of the mantissa as it is implicit.
Combine into the format. Remember mantissa is 23 bits so pad with trailing 0s.
Common mistake: using twos complement in step 1.
The final form can be converted back to binary or into hexidecimal
Literals
Textual representation of a value as it is written in the source code e.g. 0x
Not strictly about numbers, we will cover this another time
Expressing hex numbers
Prefix: 0x
0x4 is equivalent to 0x00000004 NOT 0x40000000. This is because it might not be stored in 4 bytes in every context. This is simply how it is done in addresses and registers.
Expressing binary numbers
Prefix: 0b
Expressing decimal numbers
Prefix: none