GATE CSE
First time here? Checkout the FAQ!
x
+12 votes
280 views
Write $3$ address intermediate code (quadruples) for the following boolean expression in the sequence as it would be generated by a compiler. Partial evaluation of boolean expressions is not permitted. Assume the usual rules of precedence of the operators.

$$(a+b) > (c+d) \text{ or } a > c \text{ and }b < d$$
asked in Compiler Design by Veteran (92.5k points) 967 2328 3115 | 280 views

1 Answer

+19 votes
Best answer

Each instruction in quadruples presentation is divided into four fields: operator, arg1, arg2, and result. The above example is represented below in quadruples format:

(a+b)>(c+d)OR a>c AND b<d

(t1>t2)OR a>c AND b<d

t3 OR t4 AND t5

t3 OR t6

--------------------

t1= a+b

t2= c+d

t3= t1>t2

t4= a>c

t5= b<d

t6= t4 AND t5

t7 =t3 OR t6

Op arg1 arg2 Result
+ a b t1
+ c d t2
> t1 t2 t3
.> a c t4
< b d t5
AND t4 t5 t6
OR t3 t6 t7

 

answered by Veteran (43.1k points) 20 212 553
selected by


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
Top Users Oct 2017
  1. Arjun

    23356 Points

  2. Bikram

    17058 Points

  3. Habibkhan

    8142 Points

  4. srestha

    6254 Points

  5. Debashish Deka

    5438 Points

  6. jothee

    4968 Points

  7. Sachin Mittal 1

    4772 Points

  8. joshi_nitish

    4298 Points

  9. sushmita

    3964 Points

  10. Rishi yadav

    3794 Points


Recent Badges

Popular Question Sonali Rangwani
Notable Question Sandeep Suri
100 Club stdntlfe
Nice Question thor
100 Club Vamp thehacker
Popular Question LavTheRawkstar
Notable Question shubham vashishtha
Nice Answer Habibkhan
Good Question jenny101
Regular Ashish Subscription
27,301 questions
35,155 answers
83,985 comments
33,244 users