-
Consider the basic block given below.
a = b + c
c = a + d
d = b + c
e = d - b
a = e + b
The minimum number of nodes and edges present in the DAG representation of the above basic block respectively are
-
- 6 and 6
- 8 and 10
- 9 and 12
- 4 and 4
- 6 and 6
Correct Option: A
The given block is
a = b + c
c = a + d = b + c + d
d = b + c
= b + b + c + d = 2b + c + d
e = d – b = b + b + c + d – b = b + c + d
a = e + b = b + b + c + d = 2b + c + d
Therefore e and c are same, a and d are same. The DAG generated is as follows:
The maximum number of nodes and edges is (6, 6)