Counting systems
Introduced| English | Meaning |
|---|---|
| binary/ˈbaɪnəri/ | A number system using base two, with the digits zero and one. |
| number base/ˈnʌmbə beɪs/ | The number of distinct digits used in a positional number system, which determines the place values as successive powers of that base. |
| place value/pleɪs ˈvæljuː/ | The contribution of a digit to a number according to its position and the number system's base. |
| hexadecimal/ˌheksəˈdesɪml/ | A base-sixteen number system using digits zero to nine and letters A to F. |
The same digits can name different values
- The numeral 10 is two in binary and ten in decimal. State the base before calculating.
- A positional number base 进制 b uses digits from zero to b minus one and powers of b as place weights. Binary 二进制 has only 0 and 1.
Multiply digits by their place weights
- Place value 位值 gives each digit its contribution. From right to left, binary weights are 1, 2, 4, 8 and so on.
- To convert a nonnegative value back, select its weights or use repeated division with remainders. Leading zeros preserve a chosen width without changing its unsigned value.
The same value in three bases
Place value is the only idea; the base only changes what the places are.
Group four bits for a hexadecimal digit
- Hexadecimal 十六进制 uses sixteen digits: 0 to 9 then A to F. Each digit corresponds to four binary bits.
- Hexadecimal FF is decimal 255 and unsigned pattern 11111111. Its value depends on representation conventions; a signed eight-bit interpretation is a different task.
Convert binary 1101 to decimal.
Difficulty 2/5 · 140 coins + a small bonus on first completion today
Places 8, 4, 2, 1 with digits 1, 1, 0, 1 gives 8 + 4 + 0 + 1 = 13.
Write decimal 10 in binary.
Difficulty 1/5 · 100 coins + a small bonus on first completion today
8 and 2 are used, 4 and 1 are not. Writing the place values first makes this immediate.
Read 1101 in binary. The weighted sum is $V=1(8)+1(4)+0(2)+1(1)=13$. Grouping those four bits gives hexadecimal D. Decimal 10 instead has binary pattern 1010.
How many bits does one hexadecimal digit represent?
Difficulty 2/5 · 140 coins + a small bonus on first completion today
Sixteen values need four bits, which is why hex is compact shorthand for binary.
What is hexadecimal FF as an unsigned decimal value?
Difficulty 2/5 · 140 coins + a small bonus on first completion today
15 × 16 + 15 = 255, also represented by unsigned eight-bit pattern 11111111.
Distinguish a mathematical sum from stored bits. Eight unsigned bits allow zero to 255. Adding 10 to 250 gives mathematical sum 260; an explicitly specified eight-bit wraparound rule stores 4. Sheet 4.2 asks you to state the overflow and the rule.
Do not discard an extra carry silently. The question may request an unrestricted result, an overflow decision or a fixed-width stored pattern, and those are different answers.
Binary 10 has the value ten.
Difficulty 1/5 · 100 coins + a small bonus on first completion today
It is two. Read binary digit by digit — "one zero" — so you never treat it as decimal by accident.