Aspire's Library

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

Previous Year Question (PYQs)



The following program is stored in the memory unit of the basic computer. Give the content of accumulator register in hexadecimal after the execution of the program.
Location Instruction
010 CLA
011 ADD 016
012 BUN 014
013 HLT
014 AND 017
015 BUN 013
016 C1A5
017 93C6





Solution

Initially, accumulator register is cleared by instruction $CLA$.

So,

$AC=0000$

Next instruction is:

$ADD\ 016$

At location $016$, data is:

$C1A5$

So,

$AC=0000+C1A5=C1A5$

Next instruction is:

$BUN\ 014$

So, control goes to location $014$.

At location $014$, instruction is:

$AND\ 017$

At location $017$, data is:

$93C6$

Now,

$AC=C1A5\ AND\ 93C6$

Convert into binary:

$C1A5=1100\ 0001\ 1010\ 0101$

$93C6=1001\ 0011\ 1100\ 0110$

Now perform bitwise AND:

$1100\ 0001\ 1010\ 0101$

$AND$

$1001\ 0011\ 1100\ 0110$

$=1000\ 0001\ 1000\ 0100$

Now convert back to hexadecimal:

$1000\ 0001\ 1000\ 0100=8184$

So, final content of accumulator is:

$AC=8184$



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...