Computer arithmetic is a field of computer science that investigates how computers should represent numbers and perform operations on them.
Binary arithmetic includes the basic arithmetic operations of addition,subtraction,multiplication and division.It has only two to digits:0and1.
The addition table for binary arithmetic consists of only the following five entries:
- 1+1=0 (plus a carry of 1 to next higher column)
- 1+1+1=11(carry 1 to the next)
Note: 1 is the largest digit in binary number system.
If the subtrahend(the lower digit) is larger than the minuend(the upper digit),it is necessary to borrow from the column to the left.In decimal 10 is borrowed,in binary 2 is borrowed,in octal 8 is borrowed,and in hexadecimal 16 is borrowed.
The subtraction table for binary arithmetic consists of only the following four entries:
- 0-1=1(with a borrow from the next column)
Additive method of subtraction is known as complementary subtraction.
The multiplication table for binary arithmetic consists of only the following four entries:
Additive method of binary multiplication:-Computers can perform multiplication operation by the way of addition also.Ex:We can obtain 4*8 by adding the digit 8 four times(8+8+8+8).
The division table for binary arithmetic consists of only the following four entries:
- 0÷0= Divide by zero error
- 1÷0=Divide by zero error
Division by zero in any number system is meaningless,computers deal with this problem by raising an error condition called 'Divide by zero' error.
Additive method of binary division:-
Computers can perform even division operation by the process of addition also.A computer performs division operation by repeating complementary subtraction method.
Ex:- we can obtain 35÷5 as follows:
Divisor is subtracted repeatedly from the dividend until the result of subtraction becomes less than or equal to zero.