---
title: "Instruction fields and address formats for X=(E+F)*(G+H)"
subject: "Computer Organization and Architecture"
chapter: 2
key: "semester_5/computer_organization_and_architecture:code-fields-e-f-g-h"
source: https://www.bctengineer.com/q/semester_5/computer_organization_and_architecture/code-fields-e-f-g-h
site: BCT Engineering
---

# Instruction fields and address formats for X=(E+F)*(G+H)

Computer Organization and Architecture · Chapter 2: Central Processing Unit

- Asked in: 2068 Chaitra, 8 marks
- Video: [Instruction Format | zero, one, two and three address instructions program | CAO | COA](https://www.youtube.com/watch?v=Htw_NTvj1ss) — Techno Tutorials ( e-Learning)
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/computer_organization_and_architecture/code-fields-e-f-g-h
- Whole chapter: https://www.bctengineer.com/md/semester_5/computer_organization_and_architecture/chapter-2

## Question

What are the most common fields in an instruction? How can you perform X=(E+F)*(G+H) operation by using zero, one, two and three address instruction format. Assume that E, F, G, H and X are memory addresses.

## Short answer

Common instruction fields are opcode (operation), address field(s) (operand locations), and mode field (addressing mode). For X = (E+F)*(G+H), postfix is E F + G H + *. Three-address uses 3 instructions (ADD, ADD, MUL). Two-address needs 6 with MOV overhead. One-address accumulator requires 7 with temporary T1. Zero-address stack uses 8 instructions (PUSH, ADD, PUSH, ADD, MUL, POP). Fewer addresses yield shorter instructions but longer programs.

## Answer

#### Common fields of an instruction
1. **Operation code (opcode):** specifies the operation to be performed (add, load, jump).
2. **Address field(s):** give the location of the operands or result: a memory address or a register number. The number of address fields depends on the instruction format.
3. **Mode field:** specifies how the address field is used to find the operand (direct, indirect, immediate, indexed, ...).

#### X = (E+F)*(G+H)
Assumptions: the operands are memory locations, `R1, R2, ...` are CPU registers, `T1, T2, ...` are temporary memory locations, and `X` receives the result. Multiplication and division are done before addition and subtraction, and equal-priority operators go left to right. All of E, F, G, H and X are memory addresses.

Fully bracketed: **X = (E+F)*(G+H)**. Postfix (reverse Polish) form: `E F + G H + *`.

#### Three-address instructions (OP dest, src1, src2)
```text
ADD R1, E, F   ; R1 = E + F
ADD R2, G, H   ; R2 = G + H
MUL X, R1, R2  ; X = R1 * R2
```
Number of instructions: 3. Shortest program, but each instruction is long (three addresses).

#### Two-address instructions (OP dest, src; dest = dest OP src)
```text
MOV R1, E   ; R1 = E
ADD R1, F   ; R1 = R1 + F
MOV R2, G   ; R2 = G
ADD R2, H   ; R2 = R2 + H
MUL R1, R2  ; R1 = R1 * R2
MOV X, R1   ; X = R1
```
Number of instructions: 6. A MOV is needed first because the destination operand is overwritten.

#### One-address instructions (accumulator AC is the implied operand)
```text
LOAD E    ; AC = E
ADD F     ; AC = AC + F
STORE T1  ; T1 = AC
LOAD G    ; AC = G
ADD H     ; AC = AC + H
MUL T1    ; AC = AC * T1
STORE X   ; X = AC
```
Number of instructions: 7. Intermediate results that cannot stay in AC are saved in memory temporaries.

#### Zero-address instructions (stack machine)
```text
PUSH E  ; push E
PUSH F  ; push F
ADD     ; pop two, compute, push result
PUSH G  ; push G
PUSH H  ; push H
ADD     ; pop two, compute, push result
MUL     ; pop two, compute, push result
POP X   ; X = top of stack
```
Number of instructions: 8. Only PUSH and POP carry an address; ADD, SUB, MUL, DIV work on the top two stack items, so the program follows the postfix form directly.

**Summary:** 3-address = 3, 2-address = 6, 1-address = 7, 0-address = 8 instructions. Fewer addresses per instruction means shorter instructions but more of them.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Which are the most common fields in an instruction?
   A. Opcode, stack field and flag field
   B. Opcode, address field(s) and mode field
   C. Address, data and status fields
   D. Opcode, clock and mode fields
   Answer: B. The opcode gives the operation, the address fields locate operands, and the mode field says how to interpret the address. (Key point: Common instruction fields)

2. What does the mode field specify?
   A. Which operation is performed
   B. How many bits the operand has
   C. How the address field is used to find the operand (direct, indirect, immediate, indexed)
   D. Which register is the accumulator
   Answer: C. The mode field decides how the effective address or operand is obtained from the address field. (Key point: Mode field)

3. How many three-address instructions compute X = (E+F)*(G+H)?
   A. 3
   B. 2
   C. 4
   D. 6
   Answer: A. ADD R1,E,F; ADD R2,G,H; MUL X,R1,R2. (Key point: Three-address count)

4. How many zero-address instructions are needed for X = (E+F)*(G+H)?
   A. 5
   B. 6
   C. 7
   D. 8
   Answer: D. Four PUSH, two ADD, one MUL and one POP make 8. (Key point: Zero-address count)

## Related in Computer Organization and Architecture

- [Address-format code for unspecified-2075-asoj](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Aaddress-code-15) — Computer Organization and Architecture, chapter 2
- [Address-format code for Y=A+(B*C)+D](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Aaddress-code-16) — Computer Organization and Architecture, chapter 2
- [Address-format code for Y=(A+B)*(C+D)](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Aaddress-code-7) — Computer Organization and Architecture, chapter 2, asked 16×
- [Address-format code for X=(A*B/C)-(D+E/F)](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Aaddress-code-1) — Computer Organization and Architecture, chapter 2, asked 16×
- [Address-format code for X=(P+Q)×(R+S)](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Aaddress-code-2) — Computer Organization and Architecture, chapter 2, asked 16×
- [Address-format code for Y=A*(B+D/C)+(G*E)/F](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Aaddress-code-3) — Computer Organization and Architecture, chapter 2, asked 16×

## Related in other subjects

- [Instruction and data format, addressing modes](https://www.bctengineer.com/question.md?key=semester_4%2Fmicroprocessor%3A8085-instruction-data-format-addressing) — Microprocessor, chapter 2, asked 2×
- [USB protocols and common packet fields](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Ausb-packet-fields) — Instrumentation II, chapter 3, asked 2×
- [Full vs partial address decoding for memory](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Afull-vs-partial-decoding) — Instrumentation II, chapter 2
- [Datapath operation and instruction cycles](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Adatapath-operation-instruction-cycles) — Embedded System, chapter 2
