Tip:A–D to answerE for explanationV for videoS to reveal answer
NIMCET 2008 — Computer PYQ
NIMCET | Computer | 2008
A CPU has an arithmetic unit that adds bytes and then sets its V, C and Z flag bits as follows: the V-bit is set if arithmetic overflow occurs. The C-bit is set if a carry-out is generated from the most significant bit during an operation. The Z-bit is set if the result is zero. What are the values of the V, C and Z flag bits respectively after the 8-bit bytes 1100 1100 and 1000 1111 are added?
Choose the correct answer:
A.
0, 0, 0
B.
1, 1, 0
(Correct Answer)
C.
1, 1, 1
D.
0, 1, 0
Correct Answer:
1, 1, 0
Explanation
Binary Addition Analysis
Hamare paas do 8-bit numbers hain:
A = 11001100
B = 10001111
Inka addition process niche table me dekho:
Carry In
Number 1
Number 2
Sum Bit
Carry Out
-
0
1
1
0
0
0
1
1
0
0
1
1
0
1
1
1
1
1
1
1
0
0
1
0
0
0
0
0
0
0
1
0
1
0
0
1
1
0
1 (C-bit)
Flag Calculation Logic
C (Carry Flag): Last column (MSB) me 1+1 karne par carry-out 1 bacha.
C=1
Z (Zero Flag): Addition ke baad result 01011011 aaya, jo ki zero nahi hai.
Z=0
V (Overflow Flag): Iska simple formula hota hai: V=(Carry into MSB)⊕(Carry out of MSB).
MSB me carry aaya tha: 0
MSB se carry bahar gaya: 1
V=0⊕1=1
V=1
Correct Sequence (V, C, Z):
1, 1, 0
Option: (b)
Explanation
Binary Addition Analysis
Hamare paas do 8-bit numbers hain:
A = 11001100
B = 10001111
Inka addition process niche table me dekho:
Carry In
Number 1
Number 2
Sum Bit
Carry Out
-
0
1
1
0
0
0
1
1
0
0
1
1
0
1
1
1
1
1
1
1
0
0
1
0
0
0
0
0
0
0
1
0
1
0
0
1
1
0
1 (C-bit)
Flag Calculation Logic
C (Carry Flag): Last column (MSB) me 1+1 karne par carry-out 1 bacha.
C=1
Z (Zero Flag): Addition ke baad result 01011011 aaya, jo ki zero nahi hai.
Z=0
V (Overflow Flag): Iska simple formula hota hai: V=(Carry into MSB)⊕(Carry out of MSB).
MSB me carry aaya tha: 0
MSB se carry bahar gaya: 1
V=0⊕1=1
V=1
Correct Sequence (V, C, Z):
1, 1, 0
Option: (b)
NIMCET 2008 Computer PYQ — A CPU has an arithmetic unit that adds bytes and then sets its V,… | Mathem Solvex | Mathem Solvex