← 🧩 Instruction Formats & Addressing Modes
Subtopic 1 of 8

1.1Instruction = opcode + operand fields

The idea

An instruction is just a row of bits cut into fields. One field says what to do (the opcode); the others say which data to use (the operands).

Think of it like this: Like a form with a tick-box for the action and blanks for the items: "ADD" and "R1, R2, R3".

Why it exists

The CPU only understands bits. A fixed layout lets the hardware slice an instruction into pieces in one step, which keeps decoding fast.

How it works

  1. The opcode bits choose the operation (ADD, LOAD, JUMP...). With n opcode bits you can name at most 2n operations.
  2. Each operand field names a register or a memory address.
  3. Instruction length is fixed (say 16 bits), so every extra operand field takes bits away from the opcode.
  4. More addresses per instruction means shorter programs but longer instructions; fewer addresses means the opposite.

Worked example: 16-bit instruction, four 4-bit fields

3-address ADD R1,R2,R3: opcode (4) + dest (4) + src1 (4) + src2 (4). Only 4 opcode bits, so at most 16 operations. A 1-address instruction has a 12-bit opcode, so up to 4096 operations.

Now play with it

  • →Click through the four tabs and watch the opcode box get wider as operand fields disappear.
  • →Click any field to read what it holds.

Total 16 bits. Click a field for details.

ADD R1, R2, R3: both sources and the destination are named.

Check yourself

A 16-bit instruction has a 4-bit opcode and three 4-bit register fields. At most how many different operations can it encode?

Remember: Opcode says what, operands say on what; longer operand list squeezes the opcode.
Exam notes (the dense version)

Length = opcode bits + mode bits + register/address bits. Format decides how many distinct instructions are possible.

Previous year questions: Instruction Formats & Addressing Modes (12)

PYQs are grouped by topic, so this is the full set for Instruction Formats & Addressing Modes; try the ones that match this subtopic. Open all 12 on the topic page.