Two eight bit bytes 11000011 and 01001100 are added. What are the values of the overflow, carry and zero flags respectively?
- A. 0, 1, 1
- B. 1, 1, 0
- C. 1, 0, 1
- D. 0, 1, 0
Answer: B. 1, 1, 0
Explanation: 11000011 (C3) + 01001100 (4C). Sum = 100001111 (10F). Result 0F (00001111). Carry=1. Zero=0. Overflow: Neg + Pos = Pos? C3 is negative (-61), 4C is positive (76). Sum is positive? No, -61 + 76 = 15. Correct. But looking at bits: MSB carry-in=1, MSB carry-out=1. Overflow = Cin XOR Cout = 1 XOR 1 = 0? Wait. 1100... + 0100... MSB addition is 1+0=1. No carry out from MSB? Wait. C3 + 4C. C3 + 4C = 10F. 8-bit result 0F. Carry flag = 1. MSB of operands: 1 and 0. MSB of result: 0. Overflow occurs if P+P=N or N+N=P. Here N+P. Never overflows. So Overflow=0. Key says 1, 1, 0? Let's check image explanation. 'On adding... output is 00001111 with carry 1. Zero flag is 0. Carry flag is 1. Overflow will be 0 by XOR Cin and Cout which are both 1, 1.' Wait, the text in explanation says Overflow 0. But option selected is (b) 1,1,0? Maybe the question meant Carry, Overflow, Zero? Order: Overflow, Carry, Zero. If Ans is (b) then Overflow=1? That contradicts the explanation provided in the PDF itself which says 'Hence overflow flag is 0'. If Overflow is 0, Carry 1, Zero 0, then option should be 0, 1, 0 (d). The answer key box says (d). Okay, (d) is 0, 1, 0.