Aspire's Library

A Place for Latest Exam wise Questions, Videos, Previous Year Papers,
Study Stuff for MCA Examinations - NIMCET

Previous Year Question (PYQs)



Consider the expression $(a-1)*\left(\dfrac{(b+c)}{3}+d\right)$.
Let $x$ be the minimum number of registers required by an optimal code generation (without any register spill) algorithm for a load/store architecture in which
(i) Only load and store instructions can have memory operands and
(ii) Arithmetic instructions can have only register or immediate operands.

The value of $x$ is _______.





Solution

The expression requires evaluation of $(b+c)$, then division by $3$, then addition with $d$, and finally multiplication with $(a-1)$.
Minimum registers needed to hold intermediate results without spill = 3.


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More

Ask Your Question or Put Your Review.

loading...