Intermediate

Number Systems and Data Units

AicademyAicademy
·OCR GCSE Computer Science·OCR J277·7 min
1.2.3 Units·1.2.4 Data storage (numbers)

Why Computers Use Binary

All data processed by a computer is ultimately stored as binary — sequences of 0s and 1s. This is because electronic components (transistors) have two stable states: on (1) and off (0). Binary maps directly onto this physical reality.

A single binary digit is a bit. Bits are grouped into units:

UnitSizeEquivalent
Bit1 bitSmallest unit of data
Nibble4 bitsHalf a byte
Byte8 bitsSmallest addressable unit in most systems
Kilobyte (KB)1,000 bytes~1 thousand bytes
Megabyte (MB)1,000 KB~1 million bytes
Gigabyte (GB)1,000 MB~1 billion bytes
Terabyte (TB)1,000 GB~1 trillion bytes
Petabyte (PB)1,000 TB~1 quadrillion bytes

OCR J277 uses powers of 1,000 (kilobyte = 1,000 bytes). Using powers of 1,024 is also acceptable in calculations.

Binary to Denary Conversion

Each bit position in a binary number has a place value that doubles from right to left. For 8 bits:

Bit position76543210
Place value1286432168421

Worked example — convert 10110101 to denary:

Place1286432168421
Bit10110101
Value128032160401

Denary to binary — repeatedly divide by 2 and record the remainder, reading remainders bottom-up:

Worked example — convert 77 to binary:

DivisionQuotientRemainder
77 ÷ 2381
38 ÷ 2190
19 ÷ 291
9 ÷ 241
4 ÷ 220
2 ÷ 210
1 ÷ 201

Reading remainders bottom-up: 01001101

Verify:

The most significant bit (MSB) is the leftmost bit (highest value). The least significant bit (LSB) is the rightmost bit (lowest value).

Binary Addition and Overflow

Binary addition rules:

  • (write 0, carry 1)
  • (carry) (write 1, carry 1)

Worked example — add 01001101 (77) + 00110010 (50):

  01001101   (77)
+ 00110010   (50)
----------
  01111111   (127)

Step-by-step (right to left): 1+0=1; 0+1=1; 1+0=1; 1+0=1; 0+1=1; 0+1=1; 1+0=1; 0+0=0. Result: 01111111 =

Overflow occurs when the result of an addition is too large to be stored in the available number of bits. With 8 bits, the maximum value is 255 (11111111). If the result exceeds 255, a carry bit is generated beyond the 8th bit — that extra bit cannot be stored, so the result is incorrect. This is an overflow error.

Worked example — overflow: add 11111110 (254) + 00000011 (3):

  11111110   (254)
+ 00000011   (3)
----------
 100000001   (257 — requires 9 bits)

In 8 bits, only the lower 8 bits are kept: 00000001 (1). The true answer is 257 but only 1 is stored — overflow error.

Hexadecimal

Hexadecimal (base 16) uses 16 symbols: 0–9 and A–F, where A=10, B=11, C=12, D=13, E=14, F=15.

DenaryHexBinary
000000
991001
10A1010
15F1111
16100001 0000
255FF1111 1111

Each hex digit represents exactly 4 binary bits (one nibble). This makes hex a convenient shorthand for binary.

Denary to hex — divide by 16, record remainders:

Worked example — convert 181 to hex:

DivisionQuotientRemainder
181 ÷ 16115
11 ÷ 160B (11)

Reading bottom-up: B5

Verify:

Binary to hex — split binary into groups of 4 from the right; convert each group:

Worked example — convert 10110101 to hex:

  • Split: 1011 | 0101
  • 1011 = 8+2+1 = 11 = B
  • 0101 = 4+1 = 5 = 5
  • Result: B5 ✓ (consistent with the denary→hex example above)

Worth saving these ideas?

Turn what you've read into instant revision cards. Free to get started.

Make flashcards

Binary Shifts

A binary shift moves all the bits in a binary number left or right by a specified number of positions.

Left shift — each shift left multiplies the value by 2:

BitsValue
000001015
0000101010 (shifted left 1)
0001010020 (shifted left 2)

Bits shifted off the left end are lost. Empty positions on the right are filled with 0.

Right shift — each shift right divides the value by 2 (integer division):

BitsValue
0001010020
0000101010 (shifted right 1)
000001015 (shifted right 2)

Bits shifted off the right end are lost. Empty positions on the left are filled with 0.

Worked example — shift 00000110 (6) left by 2:

  • 00000110 → 00011000 =

Worked example — shift 00011000 (24) right by 3:

  • 00011000 → 00000011 =

File Size Calculations

OCR J277 requires the ability to calculate file sizes for sound, image and text files.

Text file size:

Worked example — a text file with 500 characters, each stored in 8 bits: bits bytes ✓

Image file size (uncompressed):

Worked example — a 200 × 100 pixel image with 24-bit colour depth: bits bytes KB (using 1,000 bytes = 1 KB) ✓

Sound file size (uncompressed):

Worked example — a 10-second audio clip, sample rate 44,100 Hz, 16-bit depth: bits bytes KB ✓

Common Exam Mistakes

1. Getting bit order wrong in binary-to-denary conversion

The rightmost bit is always worth 1 (LSB), doubling leftward: 1, 2, 4, 8, 16, 32, 64, 128. A common error is reversing the order or using the wrong place value for a given position.

2. Confusing overflow with rounding

Overflow is not rounding — it is a structural failure when the result exceeds the storage capacity. The stored result is wrong, not merely imprecise.

3. Confusing left and right shift effects

Left shift multiplies by powers of 2 (each position = ×2). Right shift divides by powers of 2 (each position = ÷2). Confusing direction reverses the effect.

4. File size formula errors

Always check units in file size calculations. The image formula uses colour depth × height × width in pixels. The sound formula uses sample rate × duration × bit depth. Swapping values (e.g. using resolution in dpi instead of pixels) gives a wrong answer.

MistakeCorrection
"Shifting left by 1 adds 1 to the value"Shifting left by 1 multiplies the value by 2
"KB = 1,024 bytes only"OCR J277 uses 1 KB = 1,000 bytes (1,024 is also acceptable)
Writing 10110101 as B5 without checkingVerify: 1011=B, 0101=5 → B5 = (11×16)+5 = 181

Generate revision on any topic you study

Type any topic you're studying and Aicademy generates a complete lesson, quiz, and flashcard set — personalised to your level.

Lessons on anything

Structured, level-matched lessons on any topic you study

Practice quizzes

Find out what you actually know before the exam does

Flashcard sets

Lock in key concepts with instant revision cards

Ask Aica

Stuck on something? Get a clear explanation, any time

Prev

Primary and Secondary Storage

Next

Data Representation

Related lessons

8 Slides

Lesson

Primary and Secondary Storage

OCR GCSE Computer Science · OCR J277

1 day ago

6 Slides

Lesson

Data Representation

OCR GCSE Computer Science · OCR J277

1 day ago

7 Slides

Lesson

Boolean Logic

OCR GCSE Computer Science · OCR J277

2 days ago

7 Slides

Lesson

Data Types and Casting

OCR GCSE Computer Science · OCR J277

2 days ago