could ne one pls tell me how to add 10101010 + 10101010 and how to handle carry over

anil bisht

Ranch Hand

Posts: 81

posted 15 years ago

0

10101010 + 10101010 we will try this 10 + 10 0+0 = 0 1+1 = 2 but its binary so u have to write 1+1 = 10( binary) so 0 is to be placed there and 1 is the carry now add 0 + 0 + 1 = 1 so the answer is 100 so ur answer is 101010100 but if u have the size of 8 bits the last bit will be lost and u will get 1010100 HTH anil

bill bozeman

Ranch Hand

Posts: 1070

posted 15 years ago

0

For this I usually find it easier to convert them to decimal, then do the addition, and then convert them back to binary. So you are adding 170 + 170 = 340, then take 340 to binary and you get 101010100. Bill