6,970 views
7 votes
7 votes

Two eight bit bytes $1100  0011$ and $0100  1100$ are added. What are the values of the overflow, carry and zero flags respectively, if the arithmetic unit of the CPU uses $2$'s complement form?

  1. $0, 1, 1'$
  2. $1, 1, 0$
  3. $1, 0, 1$
  4. $0, 1, 0$

6 Answers

Best answer
17 votes
17 votes
I think it is D

      11000011

      01001100

    ………………...

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

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

For overflow, we have a condition of  $C=C_{out} \oplus C_{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 the exor of both of them is 0 --- which will carry a flag

So option d

carry flag - 1sum -- 0  overflow is 0
edited by
5 votes
5 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

4 votes
4 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)

1 votes
1 votes

   11000011

   01001100


1  00001111

so finally we have result as 00001111


now herre discard the carry in red digit becoz we are using two's complement method therefore  we have 

zero flag=0 

overflow flag=1

carry flag=0

Answer:

Related questions

5 votes
5 votes
2 answers
1
makhdoom ghaya asked May 13, 2016
2,904 views
The binary equivalent of the decimal number $42.75$ is$101010 . 110$$100110 . 101$$101010 . 101$$100110 . 110$
5 votes
5 votes
1 answer
2
makhdoom ghaya asked Apr 26, 2016
5,311 views
The number $1102$ in base $3$ is equivalent to $123$ in which base system?$4$$5$$6$$8$
10 votes
10 votes
4 answers
3
makhdoom ghaya asked Apr 26, 2016
6,989 views
When two $\text{BCD}$ numbers $0\times14$ and $0\times08$ are added what is the binary representation of the resultant number ?$0\times22$$0\times1c$$0\times16$results in...
5 votes
5 votes
3 answers
4
makhdoom ghaya asked Apr 25, 2016
7,406 views
Which logic gate is used to detect overflow in 2's compliment arithmetic?OR gateAND gateNAND gateXOR gate