Instruction Formats and Addressing Modes: 7 Mistakes and How to Fix Them
Fix seven common COA errors by tracing effective addresses, memory reads, register updates, instruction fields and expanding opcodes step by step.
KnowledgeGate Team
Exam prep & CS education

You may know every addressing-mode definition and still lose the answer by treating a literal as an address, stopping at the effective address, using the wrong PC, or borrowing opcode bits from the wrong format. Seven errors recur in this topic. Each one has a cause, a wrong trace, and a correction. Use CS Fundamentals for Exams & Placements for the wider subject route.
Use one word-addressed machine, excluding instruction fetch from all data-read counts: A = 120, R1 = 320, R2 = 5; M[120] = 500, M[125] = 68, M[320] = 35, M[396] = 91, and M[500] = 42.
1. Immediate, direct and indirect modes: mistaking a value for an address

Why it happens: field 120 looks identical in every mode. What goes wrong: you report an EA instead of the operand, or look up a literal in memory. What to do instead: write field meaning -> EA if any -> operand -> data reads first. This prevents both confusions.
The mode decides whether the field is data, an EA, or a pointer. Immediate #120 has no EA: operand 120, 0 reads. Direct 120 gives EA = 120, operand M[120] = 500, 1 read. Indirect @120 reads pointer M[120] = 500, then operand M[500] = 42: EA = 500, 2 reads. Addressing Modes and Instruction Formats: Worked Examples owns the full concept-and-formula treatment. Instruction Formats & Addressing Modes in COA: Worked Guide provides a worked-guide walkthrough; the corrective traces isolate seven recurring mistakes.
![Flow chart compares immediate, direct and indirect addressing for field 120, showing operands 120, M[120] = 500, M[500] = 42 and 0, 1, 2 reads.](https://cdn.knowledgegate.ai/blog-assets/blog_asset_1786784519230_v14xno.jpg)
2. PC-relative addressing: using the wrong PC or an unsigned displacement
Why it happens: you retain the instruction address or read the displacement as unsigned. What goes wrong: either choice produces a plausible wrong address. What to do instead: identify the defined PC point, sign-extend, then add.
A one-word instruction at 399 leaves PC at 400 after fetch. The 8-bit 11111100_2 is two's-complement -4, so EA = 400 + (-4) = 396 and operand M[396] = 91. Using the instruction address wrongly gives 399 - 4 = 395; unsigned 252 wrongly gives 400 + 252 = 652. Negative four must move backwards from 400, which checks the direction.
3. Indexed and base addressing: dereferencing before the EA is complete
Why it happens: displacement 120 resembles a direct address, so you dereference early. What goes wrong: M[120] + R2 = 500 + 5 = 505, which is not indexed addressing. What to do instead: complete the EA, then dereference once.
For 120(R2), keep the labels visible: displacement = 120, index = 5, EA = 120 + 5 = 125, operand = M[125] = 68, with one read. Complete these stages in that order. Base and index registers may serve different purposes even when the stated EA formula uses addition. The supplied formula controls the arithmetic.
4. Register and auto-update modes: changing state at the wrong time
Why it happens: register and register-indirect notation merge in your head, and post-increment seems to update first. What goes wrong: you return the address, invent a read, or access the next word. What to do instead: track R1 before and R1 after.
Register mode returns 320 with 0 reads. Register-indirect (R1) gives EA = 320, operand M[320] = 35, and 1 read. Post-increment (R1)+ first reads M[320] = 35, then sets R1 = 321; reading M[321] reverses the order because access precedes update. The sequence is part of the mode. Now practise with Addressing Modes MCQs: 12 Solved COA Questions.
5. Instruction-format bit budgets: subtracting the wrong fields
Why it happens: you import an opcode width or treat a signed field as magnitude. What goes wrong: widths, code counts, or ranges stop fitting. What to do instead: draw the fields, sum them to the word size, then interpret each field.
For a fixed 32-bit format, opcode = 6, mode = 3, and register = 5, so displacement is 32 - 6 - 3 - 5 = 18 bits. Check 6 + 3 + 5 + 18 = 32. The maxima are 2^6 = 64 opcode patterns, 2^3 = 8 mode patterns, and 2^5 = 32 register codes, before reserved codes. Signed 18-bit two's-complement spans -2^17 to 2^17 - 1, or -131,072 to 131,071. The wrong maximum 262,143 is unsigned.
6. Expanding opcodes: forcing every class into four opcode bits
Why it happens: you compare all operations with 2^4 = 16. What goes wrong: a feasible allocation looks impossible. What to do instead: assign the longest-address format first, then extend only unused prefixes.
With a 16-bit instruction and 4-bit addresses, three-address form uses 4 + 3 x 4 = 16 bits. Assign eight operations 0000 through 0111 first. The eight unused prefixes 1000 through 1111, each extended by 4 bits, provide 8 x 16 = 128 two-address codewords. Allocate 32 as 1000 0000 through 1001 1111. Prefixes 1010 through 1111 leave 6 x 16 = 96 codewords. No assigned prefix collides. Check this with Instruction Structure MCQs: 12 Solved COA Questions.
7. Address counts: treating the format name as a memory-read count
Why it happens: address count is confused with access count. What goes wrong: implied machine state is ignored. What to do instead: trace one expression under fixed conventions.
With A=6, B=2, and C=5, X=(A+B)xC=8x5=40.
Format | Trace | Instructions |
|---|---|---|
Three-address |
| 2 |
Two-address |
| 4 |
One-address |
| 4 |
Zero-address |
| 6 |
Counts alone prove neither bytes, time, nor memory reads. Architecture and semantics decide.
8. Instruction formats and addressing modes: the 60-second mistake audit
Before finalising an answer, use notation | field meaning | EA | operand | data reads | register after. For formats, add word width = opcode + mode + register + address/displacement, then check prefix safety.
Recheck: immediate 120, direct 500, indirect 42, PC-relative EA 396, indexed EA 125, post-increment operand 35 and final R1 = 321, signed 18-bit range -131,072..131,071, and X = 40. Continue with Computer Architecture and Organisation for a structured next step.
Keep learning
Instruction Formats and Addressing Modes Formula Sheet: COA Revision Notes with Worked Examples
Revise COA instruction formats with one compact sheet covering field widths, address-count sequences, effective-address formulas, expanding opcodes and memory-reference checks.
Instruction Formats and Addressing Modes in COA: Complete Guide with Worked Examples
Learn how zero, one, two, and three-address instructions change a program, then solve expanding-opcode and effective-address questions step by step.
Instruction Formats and Addressing Modes for GATE: One Cross-Concept COA Problem Solved
Decode one teaching instruction from 0x2E35FFEC, calculate its effective address, read the little-endian value, and trace the result through a five-stage pipeline.
Addressing modes and instruction formats in computer architecture explained
Addressing modes and instruction formats explained: immediate, direct, indirect, indexed and PC-relative effective addresses, and 0/1/2/3-address machines.





