← Back to subjects
0
IB Diploma Computer Science HL · Topic 2 — Computer organisation
Mini-Lesson

Computer organisation

Topic 2 opens the box: the CPU and its registers, the fetch to decode to execute cycle, primary and secondary memory, how numbers are stored in binary and hexadecimal, two’s complement and binary arithmetic, and Boolean logic gates.

Work through each screen, answer the questions as you go (some are wordy, some are calculations) and collect ⭐ stars. Press Start when you are ready.

CPU

The central processing unit

The CPU executes instructions. Its main parts are:

  • Arithmetic and logic unit (ALU) — does calculations and logical comparisons.
  • Control unit (CU) — directs the flow of data and decodes instructions.
  • Registers — tiny, very fast stores inside the CPU.

Key registers: the program counter (PC) holds the address of the next instruction; the memory address register (MAR) holds the address being accessed; the memory data register (MDR) holds the data in transit; the accumulator holds results from the ALU.

Quick check

Which register?

?Which register holds the memory address of the next instruction to be fetched?
Cycle

The machine instruction cycle

The CPU repeats the fetch to decode to execute cycle:

  • Fetch — the instruction at the PC address is copied from memory; the PC then increments.
  • Decode — the control unit works out what the instruction means.
  • Execute — the ALU or CU carries it out; results go to the accumulator or memory.
Memory

Primary and secondary memory

Primary memory is directly accessible by the CPU:

  • RAM — volatile, read and write, holds running programs and data.
  • ROM — non-volatile, read-only, holds start-up firmware.
  • Cache — very fast memory near the CPU that stores frequently used data.

Secondary storage (hard disk, SSD, USB drive, optical disc) is non-volatile, larger, slower and not directly addressable by the CPU.

Sort it

Sort the storage

Tap an item, then the category it belongs to.

⚙️ CPU component

📍 Primary memory

🗄️ Secondary storage

Binary

Binary and denary

Computers store everything in binary (base 2). Each bit is a power of two. In an 8-bit byte the place values are 128, 64, 32, 16, 8, 4, 2, 1.

Denary 156 = 128 + 16 + 8 + 4 = 1001 1100. To convert back, add the place values wherever a bit is 1.

Calculate

Binary to denary

1Convert the 8-bit binary number 1011 0101 to denary (base 10).
Hint: 128 + 32 + 16 + 4 + 1.
Quick check

Denary to binary

?Convert denary 156 to an 8-bit binary number.
Hex

Hexadecimal

Hexadecimal (base 16) is a short way to write binary. Digits run 0 to 9 then A to F (A=10 ... F=15). Each hex digit maps to exactly 4 bits.

Denary 220 = 13 remainder 12 in base 16, so 220 = D (13) then C (12) = DC. Check: 13 times 16 + 12 = 220.

Calculate

Hex to denary

2Convert the hexadecimal number A7 to denary.
Hint: A is 10, so 10 times 16 plus 7.
Quick check

Denary to hex

?Convert denary 220 to hexadecimal.
Twos

Two’s complement

To store negative integers, computers use two’s complement. To find the pattern for a negative number in 8 bits: write the positive value in binary, invert all the bits, then add 1.

Minus 40: 40 = 0010 1000. Invert: 1101 0111. Add 1: 1101 1000. The leading 1 shows it is negative.

Quick check

Two’s complement

?Using 8-bit two’s complement, how is minus 40 represented?
Arithmetic

Binary arithmetic and shifts

Binary addition works column by column, carrying when the total reaches 2 (10 in binary).

0101 1010 + 0010 1110 = 1000 1000 (90 + 46 = 136).

A logical left shift by n places moves every bit left and fills with zeros. Each single left shift multiplies by 2, so shifting left by 2 places multiplies by 4. A logical right shift by n divides by 2 to the power n (integer division).

Quick check

Logical shift

?A logical left shift by 2 places has what effect on an unsigned binary number?
Logic

Boolean logic gates

Digital circuits are built from logic gates. The core gates are:

  • AND — output 1 only when both inputs are 1.
  • OR — output 1 when at least one input is 1.
  • NOT — inverts a single input.
  • XOR — output 1 only when the inputs differ.
  • NAND / NOR — AND / OR followed by a NOT (the output is inverted).
Match it

Match the logic gate

Tap a behaviour on the left, then the gate that produces it.

Behaviour
Gate
Quick check

Volatile memory

?Which type of primary memory loses its contents when power is switched off?
Recap

The big ideas to know

CPU: ALU, control unit, registers (PC, MAR, MDR, accumulator)

Cycle: fetch to decode to execute

Memory: RAM and ROM and cache are primary; disks and SSD are secondary

Number bases: binary (base 2), hexadecimal (base 16, one digit = 4 bits)

Negatives: two’s complement = invert bits then add 1

Logic gates: AND, OR, NOT, XOR, NAND, NOR

You have covered the whole of Topic 2 — computer organisation. Press Finish to see your score.

🏆

Mini-lesson complete!

⭐⭐⭐

You have worked through Computer organisation. 🎉

Your stars: 0 / 0

Next: test yourself in the Evaluate stage Confidence Quiz, then lock it in with Verify.

📣 Smashed it? Share your score

Challenge a mate to beat your stars, or show a parent how you got on.

→ Back to all subjects