Numerical systems

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/6

encourage image

There's no tags or description

Looks like no tags are added yet.

7 Terms

1
New cards

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

2
New cards

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

3
New cards

IEEE-734 tutorial

Format: sign (1 bit) exponent (8 bits) mantissa (23 bits)

  1. Convert mantissa to binary (ignore the sign for now, treat as positive number)

  2. Normalise so 1 is at the front like so ‘1.0..’ or ‘1.1..’

  3. Write down the new exponent from normalising and add the excess 127 to it.

  4. Drop the 1 at the start of the mantissa as it is implicit.

  5. 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

4
New cards

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

5
New cards

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.

6
New cards

Expressing binary numbers

Prefix: 0b

7
New cards

Expressing decimal numbers

Prefix: none