Binary
- Computers use binary (base 2) because their circuits are either off (0) or on (1).
- A bit is a single 0 or 1. A nibble is 4 bits. A byte is 8 bits.
- In an 8-bit number, the place values are 128, 64, 32, 16, 8, 4, 2 and 1. So 00001101 = 8 + 4 + 1 = 13, and the largest 8-bit number, 11111111, is 255. 8 bits can store 256 different values (0 to 255).
- To convert denary to binary, take away the biggest place values that fit: 45 = 32 + 8 + 4 + 1 = 00101101.
Binary addition and hexadecimal
- Binary addition rules: 0 + 0 = 0, 0 + 1 = 1, 1 + 1 = 10 (write 0, carry 1), and 1 + 1 + 1 = 11 (write 1, carry 1).
- Overflow happens when the answer needs more bits than are available.
- Hexadecimal (base 16) uses the digits 0 to 9 and the letters A to F (10 to 15). One hex digit stands for 4 bits, so hex is a short way of writing binary: FF = 255.
Units
- 1 kilobyte (KB) = 1000 bytes; 1 megabyte (MB) = 1000 KB; 1 gigabyte (GB) = 1000 MB; 1 terabyte (TB) = 1000 GB. (You may also see 1024 used.)
Text, images and sound
- A character set gives each character a binary code. ASCII uses 7 bits for 128 characters (A is 65). Unicode has far more, including other alphabets and emoji.
- An image is made of pixels. Colour depth is the number of bits per pixel: 1 bit gives 2 colours, and 8 bits give 256 colours. Resolution is the number of pixels.
- More pixels or a greater colour depth gives better quality but a bigger file.
- Sound is stored by taking samples of the sound wave many times a second.
Key terms
- Binary
- The base-2 number system, using only 0 and 1.
- Bit
- A single binary digit, 0 or 1.
- Byte
- A group of 8 bits.
- Denary
- The base-10 number system we normally use.
- Overflow
- When a result needs more bits than are available.
- Hexadecimal
- The base-16 number system, using 0 to 9 and A to F.
- Character set
- A list of characters and the binary codes that represent them.
- ASCII
- A character set that uses 7 bits for 128 characters.
- Unicode
- A character set with codes for many more characters, including emoji.
- Pixel
- A single dot of colour in an image.
- Colour depth
- The number of bits used for the colour of each pixel.
- Resolution
- The number of pixels in an image.