Binary and Hexadecimal Basics
An unsigned binary pattern uses every bit for place value. No bit is set aside to signal a minus sign, so an unsigned pattern always stands for zero or a positive number.
A pattern's states are the different combinations of bits it can show. A 3-bit pattern has 8 states, running from 000 up to 111, and each state stands for one value. The first of those values is zero.
| Pattern | Value it stands for |
|---|---|
| 000 | 0 |
| 001 | 1 |
| 010 | 2 |
| 011 | 3 |
| 100 | 4 |
| 101 | 5 |
| 110 | 6 |
| 111 | 7 |
Because zero takes up one of the states, the largest value an unsigned pattern can hold is always one less than the number of states. Those 8 states reach only as far as 7. A 4-bit pattern has 16 states, so its top value is 15 — saying 16 would describe the number of states, not the largest value.
The most significant bit (MSB) is the leftmost bit of the pattern. It holds the biggest place value, so changing it alters the number far more than changing any other bit. The least significant bit (LSB) is the rightmost bit. Its place value is always 1, so flipping it changes the value by just 1.
In the pattern 10101 the MSB is the leftmost 1, worth 16, and the LSB is the final 1, worth 1. Reading the place values from left to right gives 16, 8, 4, 2 and 1, so the value is 1×16 + 0×8 + 1×4 + 0×2 + 1×1 = 21. Only that leftmost bit is worth 16, which is exactly why it earns the name “most significant”.
Edexcel GCSE Computer Science · Binary and Hexadecimal Basics
Edexcel GCSE Computer Science · Binary to Denary Conversion
Edexcel GCSE Computer Science · Adding Binary Numbers
Edexcel GCSE Computer Science · Unsigned Binary to Negative Binary Conversion
Edexcel GCSE Computer Science · Binary Shifts