edited by
25,804 views
41 votes
41 votes

Consider the intermediate code given below.

(1) i=1    
(2) j=1    
(3) t1 = 5 * i    
(4) t2 = t1 + j    
(5) t3 = 4 * t2    
(6) t4 = t3    
(7) a[t4] = -1    
(8) j = j + 1    
(9) if j <= 5 goto (3)    
(10) i = i +1    
(11) if i < 5 goto (2)

The number of nodes and edges in control-flow-graph constructed for the above code, respectively, are

  1. $5$ and $7$
  2. $6$ and $7$
  3. $5$ and $5$
  4. $7$ and $8$
edited by

7 Answers

0 votes
0 votes
1. First statement is a leader. 2.target of go to is leader. 3.next statement of goto is leader. so

1.leader.

2.leader.

3.leader

10.leader.

now there will be 4 basic blocks made out of it.

Add start and stop to these four blocks.

Also number for nodes would be 6.and edges would be 7..

 

1 is b1.

2 is b2.

3-9 is b3

10-11 is b4
1 flag:
✌ Prohibited (Ray Tomlinson)
Answer:

Related questions

34 votes
34 votes
3 answers
1
go_editor asked Feb 12, 2015
6,985 views
Match the following:$$\begin{array}{ll|ll}\hline \text{P.} & \text{Lexical analysis} & \text{1.} & \text{Graph coloring} \\\hline \text{Q.} & \text{Parsing} & \text{2.}&...
80 votes
80 votes
7 answers
2
makhdoom ghaya asked Feb 13, 2015
29,055 views
The least number of temporary variables required to create a three-address code in static single assignment form for the expression $q + r / 3 + s - t * 5 + u * v/w$ is_...