In: Computer Science
Add 011 0011 to 010 1100 and show the V and C bits (seven bits and show work)
V = 1 C = 0 because there was overflow and no carry Explanation: ------------- Adding 0110011 and 0101100 in binary 0110011 0101100 ------------ (0)1011111 ------------ Sum does not produces a carry So, sum of these numbers in binary is 1011111 Verification --------------- first = 0110011 since left most bit is 0, this number is positive so, we can directly convert this into a decimal value Converting 110011 to decimal 110011 => 1x2^5+1x2^4+0x2^3+0x2^2+1x2^1+1x2^0 => 1x32+1x16+0x8+0x4+1x2+1x1 => 32+16+0+0+2+1 => 51 Answer: 51 second = 0101100 since left most bit is 0, this number is positive so, we can directly convert this into a decimal value Converting 101100 to decimal 101100 => 1x2^5+0x2^4+1x2^3+1x2^2+0x2^1+0x2^0 => 1x32+0x16+1x8+1x4+0x2+0x1 => 32+0+8+4+0+0 => 44 Answer: 44 sum = 1011111 since left most bit is 1, this number is negative number. so, follow these steps below to convert this into a decimal value. I. first flip all the bits. Flip all 0's to 1 and all 1's to 0. 1011111 is flipped to 0100000 II. Add 1 to above result 0100000 + 1 = 0100001 III. Now convert this result to decimal value Converting 100001 to decimal 100001 => 1x2^5+0x2^4+0x2^3+0x2^2+0x2^1+1x2^0 => 1x32+0x16+0x8+0x4+0x2+1x1 => 32+0+0+0+0+1 => 33 Answer: -33 51+44 must be 95 This is not correct since we can verify that 51+44 not equals -33 So, there was an overflow.