The Gateway to Computer Science Excellence
0 votes
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)))
in Compiler Design by Active (2.3k points)
edited by | 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
According to your comment solution.
0
Yes sorry :P
0
:)
0

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

1 Answer

0 votes
It must be 16 temporary variable.

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

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,647 questions
56,492 answers
195,439 comments
100,698 users