Binary Arithmetic

The second part of our laboratory class yesterday was about Binary Arithmetic. We were taught how to add and subtract values using the binary values 0 and 1.

images

In Binary Arithmetic, values 0 and 1 are the only values used and that the computer only understands the use of these two values. That is why in n-bit representations, only 0 and 1 are used.

The addition operation is easy to understand while in the subtraction operation there are some things that need to be taken note of before doing the process. These are the following: the sign of the subtrahend should be changed and that the most significant bit tells the sign of the number.

Also, the 1’s complement and 2’s complement were discussed in class. I liked this part of the discussion because it is quite tricky but easy to understand and operate. The two operations are quite similar with each other. Only a few steps were added and changed for 2’s complement.

Aside from having a no error in these operations, results of arithmetic operations do not always end up with the answer that the computer understands. There are times wherein the result of the arithmetic operation exceeds the positive limit and also there are times wherein result of the arithmetic operation is less than the negative limit. These situations are called overflow and underflow, respectively.

There are ways to detect and know if the operation resulted to an overflow, underflow and no error. The steps were dicussed in class and that these helps us know if the answers of the operation we used resulted to the correct answer that the computer understands.

Leave a comment