Manoj Paul
Ranch Hand
Joined: Jan 18, 2007
Posts: 112
posted Jun 07, 2007 06:14:00
0

Consider a machine that performs calculations 4 bits at a time. Eight-bit 2's complement numbers can be added by adding the four least significant bits, followed by the four most significant bits. The leftmost bit is used for the sign, as usual. With 8 bits for each number, add -4 and -6, using 4-bit binary 2's complement arithmetic. Did overflow occur? Did carry occur? Verify your numeric result. Ans: Example: Decimal: 20 Binary: 10100 Binary (8 bits): 0001 0100 Machine performance: 0001 and 0100 (i.e. 4 bits at a time) Eight-bit 2�s complement numbers: 00010100 11101011 (1�s complement) +1 --------------------------------------------- 11011100 (2�s complement) --------------------------------------------- Machine performance: 1100 and 1101 (4 bits each) 1100 (i) 1101 (ii) --------------------------------------------- 11001 00011001 (8 bits) --------------------------------------------- For -4 = 1111 1100, (8 bits 2�s complement of 4) and For -6 = 1111 1010 (8 bits 2�s complement of 6) For (i) 0000 1100 Adding (-4)1111 1100 ---------------------------- 10000 1000 ---------------------------- 0000 1100 Adding (-6)1111 1010 ---------------------------- 10000 0110 ---------------------------- For (ii) 0000 1101 Adding (-4)1111 1100 ---------------------------- 10000 1001 ---------------------------- 0000 1101 Adding (-6)1111 1010 ---------------------------- 10000 0111 ---------------------------- So, from the above points (i) and (ii), we can find out that an overflow does occur and a carry does exist.
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
posted Jun 07, 2007 06:32:00
0

subject: Got The Answer... no help needed