The Gateway to Computer Science Excellence
+1 vote
118 views

I AM UNABLE TO DO THIS QUES EVERYTIME, CAN SOMEONE TELL ME THE CORRECT APPROACH ?

in Compiler Design by Active (2.5k points)
edited by | 118 views
0
Pls someone give short explanation to how to solve these :)
0

Here, some people are saying that the answer is 0 for this.

https://gateoverflow.in/199287/madeeasy-series-compiler-design-single-static-assignment 

2 Answers

+1 vote
Best answer
There is  a phase in compiler processing called as code optimization either it could be Machine independent or dependent .
So the term minimum here always refer to optimization and that too without losing the crisp of the program i.e correctness of program should be maintained.
here,

$c=b+a$

$e=c-a$ $\color{Red}{\text{(This is redundant)}} \ b+a-a=b$

$f=c \times e$

$h=c+a$

$i=h+f$

Therefore,

$T_1=b+a$

$e=c-a$ $\color{Red}{\text{(Redundant)}} $

$T_2=T_1 \times b$

$T_3=T_1+a$

$T_4=T3+T_2$
by Active (1.3k points)
selected by
+1 vote
c = b + a

and in next step

e= c-a which is nothing but b+a-a=b

hence no need to assign e as b

instead whenever value of e is required we can conveniently refer to value of e.

c1=b+a

f1=c1*b

h1=c1+a

t1=h1+f1
by (215 points)
0
so, first we have to check for minimization ,then assigning variables?

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,339 answers
198,450 comments
105,205 users