What are the types of Instructions in Computer Architecture?


Instructions in a computer can be of multiple lengths with a variable number of addresses. The various address fields in the instruction format of a computer vary as per the organization of its registers. It depends on the multiple address fields the instruction can be categorized as three address instructions, two address instructions, one address instruction, and zero address instruction.

Three Address Instructions

The general format of a three address instruction is defined as −

operation source 1, source 2, destination

ADD A, B, C

where A, B, and C are the three variables that are authorized to a different area in the memory. ‘ADD’ is the operation that is implemented on operands. ‘A’ and ‘B’ are the source operands and ‘C’ is the destination operand.

Therefore, bits are needed to determine the three operands. n bit is needed to determine one operand (one memory address). Likewise, 3n bits are needed to define three operands (three memory addresses). Bits are also needed to determine the ADD operation.

Two Address Instructions

The general format of a two address instruction is defined as −

operation source, destination

ADD A, B

where A and B are the two variables that are designated to a specific location in the memory. ‘ADD’ is the operation that is implemented on the operands. This instruction adds the content of the variables A and B and saves the result in variable B. Here, ‘A’ is the source operand and ‘B’ is treated as both source and destination operands.

Bits are needed to determine the two operands. n bit is needed to define one operand (one memory address). Likewise, 2n bits are needed to determine two operands (two memory addresses). Bits are also needed to definite the ADD operation.

One Address Instruction

The general format of one address instruction is defined as −

operation source

ADD A

where A is the variable that is authorized to a specific location in the memory. ‘ADD’ is the operation that is implemented on operand A. This instruction adds the content of the variable A into the accumulator and saves the result in the accumulator by restoring the content of the accumulator.

Zero Address Instructions

The locations of the operands in zero address instructions are represented implicitly. These instructions store operands in a structure are known as a pushdown stack.

Updated on: 24-Jul-2021

15K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements