147 views
a x b x c + d - a + e x f - g + h
order of precedence : x>+>- ; with x is left associative and +, - as right.
Min number of variables required in TAC?
Should'nt the expression be expressed as :

((a x b) x c) + d - a + (e x f) - g + h
(((a x b) x c) + (d - (a + (e x f)) - (g + h)))

edited | 147 views
0
Minimum number of variables required in Three address code?Is it your question
0
((((a x b) x c) + d) - ((a +( e x f) )- (g + h)))
0
Yes @manas please explain wht's wrong in what I am doing.

@shivam yes
+1
@manisha11 while paranthising you forgot that + has higher precedence over - and you treated as if both have same precedence and are right to left associative.
0
yeah
THANKS!
0
We have different types of 3address code representations like triple, quadruple ,indirect in which does the result wanted to be in?

Indirect doesn't use any extra variables I guess.
0
@hemanth i think in gate they ask to represent in general form of 3 address code
0
Will someone tell me how many minimum number of variables will be used in this question? @hemanth

@manisha11

@manas mishra
0

Shivam Kasat

Got 15 as below. manisha11 what is the answer they have provided?

0
8 temperory variables + a-h(8)

16 ! Isn't it?
0
no its 15--> 7 temp + a-h(8)
0
t1-t8(8)+a-h(8)=16
0
Yes sorry :P
0
:)
0

@Hemanth_13 The question is minimum number of variables required in three address code, does that mean SSA?

It must be 16 temporary variable.

(T1 to T8) and (a to h )
by (273 points)

+1 vote