Thursday, March 24, 2016

Translate the following assignment statement A : = -B*(C+D) into three address, quadruple & triple forms


Here, given the expression - A: = -B*(C+D)
Three-address code :    
T1 : = -B
T2 : = C+D
T3 : = T1+T2
A : = T3
These statement are represented by quadruples as shown in fig . (a) 

SL NO OP ARG1 ARG2 RESULT
(0) Uminus B - T1
(1) + C D T2
(2) * T1 T2 T3
(3) := T3 - A

Fig. (a) quadruple representation of three -address statements.


 These statement are represented by triples as shown in fig . (b) 


SL NO OP ARG1 ARG2
(0) Uminus B -
(1) + C D
(2) * (0) (1)
(3) := A (2)

Fig. (b) triple representation of three -address statements.

If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

Related Posts:

  • What is Prefix notation/Polish notation With Example? Prefix notation/Polish notation : It is the form of an expression obtained from preorder traversal of the tree representing this expression. So, in the prefix notation, operators must be placed before the operands.  … Read More
  • What is Intermediate Language with two properties? Intermediate Language with two properties : - After syntax & semantic analysis the compiler generates an explicit intermediate representation of the source program. This, intermediate representation as a program for an … Read More
  • What is infix notation with example? Infix notation : It is the form of an expression obtained from in order traversal of the tree representing this expression. So in the infix notation, Operators must be placed in the operands. Example :  A+B, C*D, /GH… Read More
  • What is Object Program? Object Program : The output  of a code generator is the object program. This takes a variety of forms : an absolute machine - language program, a locatable machine - language program, an assembly -language program &… Read More
  • What is Postfix notation/Reverse Polish notation With Example? Postfix notation/Reverse Polish notation : It is the form of an expression obtained from postorder traversal of the tree representing this expression. So, in the postfix notation, operators must be placed after the ope… Read More

0 comments:

Post a Comment