Addition Assignment Help

Assignment Help: >> Microprocessor Instructions - Addition

Addition:

It is straightforward and is merely to add two numbers together and get the result. However there is one more thing. If, additionally, the result was too big to fit into the accumulator, part of it may be lost. There is a safeguard against this. Take the case of 11111111b (255) and 11111111b (255). These are the largest numbers that can fit into an 8-bit register or memory location. You can add these like decimal numbers, as I gave you their values in decimal also, and you would achieve 510. The binary value for 510 is 111111110b (9 bits). The accumulator is just 8 bits wide, it is a byte. How do you fit a 9-bit number into 8 bits of space? The answer is, you cannot, and it's called an OVERFLOW condition. Hence how do we get around this dilemma?

We do it with the CARRY (C) flag. If the result of the addition operation is greater than 8 bits, the CARRY (C) flag shall hold the 9th bit. In this case the accumulator would have in 11111110b (254) and the C flag would be a 1, or set. This 1 contain the value of 256 because this is the 9th bit. We have not covered a 9-bit number, however they come up all the time as overflows in addition. Adding 254 and 256, we get 510, the answer, and we didn't lose anything, due to the C flag. Had the result of the addition operation not caused an overflow, the C flag would be 0, or cleared.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd