- Practice
- About 18 min
- 5 practice questions
Practice: memory unit conversions and number system conversions step by step
Convert between bits, bytes, KB, MB, GB and TB without slips, explain why a drive shows less space than its label, and convert numbers between binary, octal, decimal and hexadecimal.
If something looks wrong, please tell us.
Conversion questions reward a fixed routine. Decide the direction, multiply or divide by the right factor, and check the answer is sensible. This lesson sets out the routines with worked examples; every figure here has been checked.
The convention used in this lesson
Here 1 KB = 1024 bytes, 1 MB = 1024 KB, 1 GB = 1024 MB and 1 TB = 1024 GB, the binary convention used for computer memory (1024 is 2 to the power 10). Storage makers and the decimal SI system often use 1000 instead. When a question does not say, use 1024 for memory questions, and read the options: if they are round thousands, the question probably uses 1000.
The routine for unit conversion
- Bigger unit to smaller unit: multiply (by 1024 for each step, by 8 from bytes to bits).
- Smaller unit to bigger unit: divide.
- Count the steps: from GB to KB is two steps, so multiply by 1024 twice.
- Sense check: an answer in a smaller unit must be a bigger number.
| Conversion | Working | Answer |
|---|---|---|
| 2 GB to MB | 2 × 1024 | 2,048 MB |
| 4 KB to bits | 4 × 1024 = 4,096 bytes; 4,096 × 8 | 32,768 bits |
| 3,145,728 bytes to MB | 3,145,728 ÷ 1024 = 3,072 KB; 3,072 ÷ 1024 | 3 MB |
| 2,560 MB to GB | 2,560 ÷ 1024 | 2.5 GB |
| Number of 512 KB files in 6 MB | 6 × 1024 = 6,144 KB; 6,144 ÷ 512 | 12 files |
Worked example 1: why a new drive shows less space
A drive is labelled 500 GB, where the maker means 500 × 1000 × 1000 × 1000 = 500,000,000,000 bytes. The operating system divides by 1024 three times, that is by 1,073,741,824. Working: 500,000,000,000 ÷ 1,073,741,824 ≈ 465.66, so it shows about 466 GB. Nothing is missing; the two sides use different units. A common slip is to divide by 1024 only once and get about 488.
Number system routines
- Decimal to binary: divide by 2 repeatedly and read the remainders from the last to the first.
- Binary to decimal: add the place values (1, 2, 4, 8, 16, 32, 64, 128 ...) under each 1.
- Binary to octal: group the bits in threes from the right; write each group as one digit 0 to 7.
- Binary to hexadecimal: group the bits in fours from the right; write each group as one digit 0 to 9 or A to F.
- Octal or hexadecimal to decimal: multiply each digit by its place value (powers of 8 or 16) and add.
Worked example 2: one number, four ways
Convert binary 11010110. To decimal: place values under the 1s are 128, 64, 16, 4 and 2, so 128 + 64 + 16 + 4 + 2 = 214. To hexadecimal: split into fours, 1101 and 0110; 1101 = 13 = D and 0110 = 6, giving D6. To octal: split into threes from the right, 11, 010 and 110, giving 3, 2 and 6, so 326. Check: D6 = 13 × 16 + 6 = 214, and octal 326 = 3 × 64 + 2 × 8 + 6 = 214. All agree.
Worked example 3: decimal 100 to binary
100 ÷ 2 = 50 remainder 0; 50 ÷ 2 = 25 remainder 0; 25 ÷ 2 = 12 remainder 1; 12 ÷ 2 = 6 remainder 0; 6 ÷ 2 = 3 remainder 0; 3 ÷ 2 = 1 remainder 1; 1 ÷ 2 = 0 remainder 1. Reading from the last remainder: 1100100. Check: 64 + 32 + 4 = 100.
Down a unit: multiply; up a unit: divide. Bytes to bits: × 8. Binary to octal: groups of 3; binary to hexadecimal: groups of 4. Always check by converting back.
Key takeaways: count the steps between units and use 1024 for each one; state your convention when a question could use 1000. For number systems, use repeated division by 2, place values, and groups of three or four bits, and check every answer by converting it back.
Check your understanding
-
1. Taking 1 GB = 1024 MB, how many MB are there in 2 GB?
- 2,000
- 1,024
- 20,480
- 2,048
Show answer
Answer: D. 2 GB = 2 × 1024 MB = 2,048 MB. The value 2,000 uses the decimal convention, which the question rules out.
-
2. Taking 1 KB = 1024 bytes, how many bits are there in 4 KB?
- 4,096
- 32,000
- 32,768
- 4,000
Show answer
Answer: C. 4 KB = 4 × 1024 = 4,096 bytes, and each byte is 8 bits, so 4,096 × 8 = 32,768 bits. The figure 4,096 is the number of bytes, not bits.
-
3. What is binary 11010110 in hexadecimal?
- D6
- C6
- D5
- B6
Show answer
Answer: A. Split into groups of four: 1101 and 0110. 1101 = 13 = D and 0110 = 6, so the answer is D6. Check: 13 × 16 + 6 = 214, which equals the binary value 128 + 64 + 16 + 4 + 2.
-
4. What is decimal 100 in binary?
- 1100010
- 1010100
- 1100100
- 1001100
Show answer
Answer: C. Repeated division by 2 gives remainders 0, 0, 1, 0, 0, 1, 1; read from the last to the first: 1100100. Check: 64 + 32 + 4 = 100. The other options equal 98, 84 and 76.
-
5. Taking 1 MB = 1024 KB, how many files of 512 KB each fit exactly in 6 MB?
- 6
- 12
- 10
- 24
Show answer
Answer: B. 6 MB = 6 × 1024 = 6,144 KB, and 6,144 ÷ 512 = 12 files. A quick check: 512 KB is half an MB, so 6 MB holds 2 × 6 = 12 such files.
Sign in to keep track of the lessons you finish.