Skip to main content

UNITS OF STORAGE IN COMPUTER -JH2

Units of Storage in Computer — Student Guide (Interactive Q&A)
STOR

Units of Storage in Computer — Interactive Guide

Bits, Bytes, KB, MB, GB... conversions, worked examples and clickable practice answers for students.

Introduction

A number system is a collection of symbols (digits) used to represent numbers, and a unit of storage tells us how much digital information can be held. Computers use bits and bytes to measure and store data. This guide covers the common storage units, how to convert between them, and many worked examples.

Basic Units — Definitions

  • Bit (b): Short for binary digit. The smallest unit of data; value is 0 or 1.
  • Byte (B): 1 byte = 8 bits. Used to store a single character (letter, number, symbol).
  • Kilobyte (KB): Usually 1 KB = 1024 bytes in computing contexts.
  • Megabyte (MB): 1 MB = 1024 KB = 1,048,576 bytes.
  • Gigabyte (GB): 1 GB = 1024 MB.
  • Terabyte (TB): 1 TB = 1024 GB.
Note: Some manufacturers use decimal units (1 KB = 1000 bytes). In computer memory and most teaching contexts we use binary units (1 KB = 1024 bytes).

Storage Units Table (binary)

UnitAbbreviationValue (bytes)
Bitb— (1 bit)
ByteB8 bits
KilobyteKB1024 B
MegabyteMB1024 KB = 1,048,576 B
GigabyteGB1024 MB
TerabyteTB1024 GB

Conversions — Practical Methods & Worked Examples

Bits ↔ Bytes

1 byte = 8 bits. To convert bits → bytes divide by 8; bytes → bits multiply by 8.

Q: Convert 64 bits to bytes.
Answer: 64 ÷ 8 = 8 bytes.

Higher units (using 1024)

Use 1024 when converting between KB, MB, GB, etc. Example: 1 MB = 1024 KB.

Worked example — 2048 bytes to KB

2048 ÷ 1024 = 2 → 2048 bytes = 2 KB

Worked example — 5 GB to MB

5 × 1024 = 5120 MB → 5 GB = 5120 MB

Conversions Between Number Systems (Binary / Octal / Hex / Decimal)

Binary → Octal (group by 3 bits)

Group binary digits into sets of 3 (from right). Use the table below.

Binary (3 bits)Octal
0000
0011
0102
0113
1004
1015
1106
1117
Example: Convert 11100101₂ to octal.
11100101₂ → group: (011)(100)(101) → 3 4 5 → 345₈

Binary → Hex (group by 4 bits)

Group binary digits into sets of 4 (from right). Use the table below (0–F).

Binary (4 bits)Hex
00000
00011
00102
00113
01004
01015
01106
01117
10008
10019
1010A
1011B
1100C
1101D
1110E
1111F
Example: Convert 11100101₂ to hexadecimal.
11100101₂ → group (from right): (1110)(0101) → E 5 → E5₁₆

Binary → Decimal (place-value)

Multiply each binary digit by powers of 2 and add results.

Example: Convert 111100000000₂ to decimal.
1×2¹¹ + 1×2¹⁰ + 1×2⁹ + 1×2⁸ = 2048 + 1024 + 512 + 256 = 3840₁₀

Decimal Conversions (to Binary / Octal / Hex)

Decimal → Binary (division by 2)

Example: Convert 1920₁₀ to binary.
1920 ÷ 2 = 960 rem 0
960 ÷ 2 = 480 rem 0
480 ÷ 2 = 240 rem 0
240 ÷ 2 = 120 rem 0
120 ÷ 2 = 60  rem 0
60 ÷ 2  = 30  rem 0
30 ÷ 2  = 15  rem 0
15 ÷ 2  = 7   rem 1
7 ÷ 2   = 3   rem 1
3 ÷ 2   = 1   rem 1
1 ÷ 2   = 0   rem 1
Read bottom→top = 111100000000₂
          

Decimal → Octal (division by 8)

Example: Convert 1792₁₀ to octal.
1792 ÷ 8 = 224 rem 0
224 ÷ 8  = 28  rem 0
28 ÷ 8   = 3   rem 4
3 ÷ 8    = 0   rem 3
Read bottom→top = 3400₈
          

Decimal → Hex (division by 16)

Example: Convert 47806₁₀ to hexadecimal.
47806 ÷ 16 = 2987 rem 14 → E
2987 ÷ 16  = 186  rem 11 → B
186 ÷ 16   = 11   rem 10 → A
11 ÷ 16    = 0    rem 11 → B
Read bottom→top = BABE₁₆
          

Octal and Hexadecimal Conversions

Octal → Binary (lookup each digit → 3 bits)

Example: Convert 345₈ to binary.
3→011, 4→100, 5→101 ⇒ 011100101₂ ⇒ 11100101₂ (leading zero optional)

Octal → Hex (two-step: octal → binary → hex)

Example: 345₈ → binary → hex = E5₁₆ (see earlier examples)

Hex → Binary (lookup each digit → 4 bits)

Example: A2DE₁₆ → A=1010, 2=0010, D=1101, E=1110 ⇒ 1010001011011110₂

Hex → Octal (hex → binary → octal)

Example: A2DE₁₆ ⇒ binary ⇒ group in 3s ⇒ octal = 121336₈ (worked in full steps earlier)

Hex → Decimal (place-value)

Example: Convert A2DE₁₆ to decimal:
A2DE₁₆ = (10×16³) + (2×16²) + (13×16¹) + (14×16⁰)
      = 40960 + 512 + 208 + 14 = 41694₁₀
          

Practice Questions (click to reveal answers)

Q1: Convert 11100101₂ to octal.
Answer: 345₈
Q2: Convert 11100101₂ to hexadecimal.
Answer: E5₁₆
Q3: Convert 111100000000₂ to decimal.
Answer: 3840₁₀
Q4: Convert 1792₁₀ to octal.
Answer: 3400₈
Q5: Convert 47806₁₀ to hexadecimal.
Answer: BABE₁₆
Q6: How many bytes are in 5 GB (binary)?
Answer: 5 × 1024 × 1024 × 1024 = 5,368,709,120 bytes

Teacher Tips & Notes

  • Use grouping shortcuts for binary↔octal (3 bits) and binary↔hex (4 bits) to save time.
  • When converting fractions (binary fractions), multiply fractional part by base and take whole parts in order.
  • Clarify manufacturer vs OS displays: manufacturers may use 1000-based units while OS often shows 1024-based units.

Prepared for classroom use — clear definitions, worked examples and interactive practice. Reference materials: CMPNote & FCTEMIS notes on Units of Storage.

Comments

Post a Comment

Popular posts from this blog

The Internet JSS2

PROGRAMMING IN BASIC II - Built-in Functions

FILE SHARING -JS2