Explain Three, Two, One and Zero Address Instruction with Examples ?

1 comment



Three, Two, One and Zero Address Instruction :-

(a) Three Address instructions :- In these type of instructions, all operand addresses are explicitly defined. Here the instructions format has three different  address fields specifying or memory or processor register operand.

Example :- ADD R1,C,B ---> R1 <---M[C] +M[B] i,e the operands at memory addresses C and B are added and the resultant sum is stored at or third processor register R1.

Advantage :-
(i) It results in short programs when evaluating arithmetic expressions.
(ii) Less execution time.

Disadvantage :-
(i) Too many bits are required for binary-coded instructions to specify three addresses
(ii)More complex decoding and processing circuits are needed.

Uses :-
Cyber 170 is a Commercial Computer using three-address instructions.

(b) Two Address instructions :- Here the instruction format has two different address fields, each specifying either a memory or a processor register operand.

Example :- ADD X,Y --->AC<---M[X]+M[Y]
                  Here X,Y - explicit Operands
                                        OR
                  M[X] <---M[X]+M[Y]
                                         OR
                  M[Y]<---M[X]+M[Y]

Advantage :- 
(i)Less execution time compare to one-address instructions.
(ii) Number of instructions needed to evaluate a arithmetic expression is much less compared to are address instructions.

Disadvantage :-
(i) It result in comparatively longer programs, then three-address instructions, when evaluating arithmetic expression.
(ii) Comparatively more execution time then three address instruction.

Uses :-
Two address instructions are used in all commercial computer.

(c) One Address Instructions :- Such instruction format has a single explicit address field and uses an implied accumulator (AC) register for all data manipulation.

Example :- ADD X --->AC <---AC+M[X]

i.e The operand  at memory location X is added to the accumulator content and the result is stored in the accumulator it self. So there are only see explicit operand address field (i.e,x) and two implicit operand addresses.

Advantage :-
(i) Match L number of bets is required to Specify the single operand address.
(ii) Less complicated decoding is needed.

Disadvantage :-
(i) Number of instructions needed to evaluate an arithmetic expression is much more compared to two and three address instructions.
(ii)More execution time needed compare to two and three address instructions.
(iii) Limited range of functions each instruction can perform.

Uses :-
In INTEL 8085 machines.

(d) Zero Address Instructions :-
Such instructions do not contain any explicit addresses (except for PUSH and pop instructions). As the operand are stored in a pushdown stack (the operand required must be there in the to P Positions in the stack hence no addresses are required.

Example :- ADD--->TOS <--- X+Y
Here the top two operands X and Y in the stack are removed from the stack and added. The result is then  again placed at the top of the stack (TOS).

Advantage :-
Do not Contained any explicit address. So, instructions are simple.

Disadvantage :-
(i) To evaluate arithmetic expression in a stack computer.
It is necessary to convert the expression into Reverse POLISH Notation (RPN).

Uses :-
In all stack type computers.

1 comment :

  1. Nowadays, modern civilizations are mostly dependent on technologies. And the base of technologies is their database system. Here The company fungible helps you with IPU and solves most challenges like cost, production, supply chain, sourcing strategy, factor analysis, distribution business strategy. And their main goal and vision are to prevent invalid data-centric calculations between server nodes and invalid data exchanges between server nodes and to strengthen reliability security.

    ReplyDelete

Subscribe

Milan Panda
Admin
About Me | Contact
Copyright 2023-2024 © Programming1011 . 🎀 Developed and Design By- Milan Panda. Happy Holi All Of You 🎀