Hi,

Regarding the exam mentioned in the subject - link.

Can somebody explain why is the suggested solution is correct?

I assume that the immidiate’s 16 bits are extended to 32 bit, so the AND operation with the MDR would be bitwise and each bit will have its pair.

Let PC be “00000000000000010000000000000000”, only the 16th bit is set. This number is 2^16-1 hence it’s greater than 2^15-1 and according to the desired functionality of the new instruction, C needs to be 0.

But the in the suggested solution:

MDR = 00000000000000010000000000000000 (16th bit set)

imm = 00000000000000001000000000000000 (15th bit set)

MDR & imm = 00000000000000000000000000000000

hence C = 1, so the desired functionality does not hold.

I guess that the suggested is valid and correct.

Which of my assumptions is wrong? What am I missing?

Thank you in advance,

Liav