Zero flag is set to 0(False), if result is non-zero.

The Gateway to Computer Science Excellence

+13 votes

Best answer

I think it is D

11000011

01001100

= (1) 00001111 with Carry =1 (specified in bracket )

The zero flag will be set if result is 0 . but here the result is not 0 so zero flag is set to 0

For overflow we have condition of C = Carryout Exor Carry In

where Carry out is carry from MSB (bit 8 ) // taking byte as from bit1 to bit 8

Carry in carry from bit 7

So carry out = 1

carry in 1

so exor of both of them is 0 --- which will be carry flag

So option d

carry flag - 1sum -- 0 overflow is 0

0

@bhuv from this we can conclude that first number is negative and second no is positive . now addition of these can not overflow (try to understand the reason )

so we can directly say that overflow flag is 0

0

@Gurdeep Saini It is given that condition for overflow is Cout exor Cin = 1. But if Cin=1 and Cout=0 then how can we say overflow is there? Please explain this I am having serious doubt in this concept

+3 votes

Cout = 1 Carry) |
Cin = 1 |
|||||||

A |
1 |
1 |
0 |
0 |
0 |
0 |
1 |
1 |

B |
0 |
1 |
0 |
0 |
1 |
1 |
0 |
0 |

Result |
0 (Sign Flag) |
0 |
1 |
0 |
1 |
1 |
1 |
1 |

Carry Flag = 1

Overflow Flag = Cin **XOR **Cout = 1 **XOR** 1 = 0

Sign Flag = 0

+2 votes

1 1

11000011

01001100

1 00001111

zero flag=0 (final answer is non zero)

overflow flag=0(since both in carry out carry =1 and it is addition of -ve and +ve number so overflow should be equals to 0)

carry flag=1(extra bit out of msb)

- All categories
- General Aptitude 1.9k
- Engineering Mathematics 7.5k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.4k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.2k
- Non GATE 1.4k
- Others 1.4k
- Admissions 595
- Exam Queries 573
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 18

50,737 questions

57,324 answers

198,405 comments

105,169 users