Unit 1 · Data representation
1.1 Number systems
By the end of this section you should be able to
- 1.1.1 Explain why computers use binary for all data
- 1.1.2 Convert between denary, binary and hexadecimal (up to 16-bit)
- 1.1.3 Explain why hexadecimal is used and where
- 1.1.4 Add two 8-bit binary integers and recognise overflow
- 1.1.5 Perform logical left and right shifts and describe their effect
- 1.1.6 Represent positive and negative integers in 8-bit two's complement
Lessons
Key vocabulary
- Binary
- A base 2 number system that uses only the digits 0 and 1.
- Denary
- A base 10 number system that uses the digits 0 to 9.
- Hexadecimal
- A base 16 number system that uses 0 to 9 and A to F; a shorter way to write binary.
- Overflow error
- Happens when a result is too large to fit in the register, e.g. above 255 in 8 bits.
- Logical shift
- Moving all bits left or right, losing bits off one end and filling with zeros at the other.
- Two's complement
- A method of representing negative binary integers. The leftmost bit is the sign bit, and you flip the bits and add 1 to change the sign.
- Most significant bit
- The leftmost bit in a binary number, with the highest place value.