UGC Net Computer Science Paper II Dec 12 Page 2 (Solved)
11. In compiler design ‘reducing the strength’ refers to
(A) reducing the range of values of input variables.
(B) code optimization using cheaper machine instructions.
(C) reducing efficiency of program.
(D) None of the above
Answer : B
Explanation :I
n compiler design , strength reduction is a compiler optimization where expensive operations are replaced with equivalent but less expensive operations. The classic example of strength reduction converts "strong" multiplications inside a loop into "weaker" additions – something that frequently occurs in array addressing.
Most of a program's execution time is typically spent in a small section of code (called a hot spot), and that code is often inside a loop that is executed over and over.
A compiler uses methods to identify loops and recognize the characteristics of register values within those loops.
12. In which addressing mode, the effective address of the operand is generated by adding a constant value to the contents of register ?
(A) Absolute
(B) Indirect
(C) Immediate
(D) Index
Answer : D