Computer arithmetic

COMPUTER ARITHMETIC

Computer arithmetic is a field of computer science that investigates how computers should represent numbers and perform operations on them.
 

BINARY ARITHMETIC 

Binary arithmetic includes the basic arithmetic operations of addition,subtraction,multiplication and division.It has only two to digits:0and1.
 

Binary addition

The addition table for binary arithmetic consists of only the following five entries:
  1. 0+0=0
  2. 0+1=1
  3. 1+0=1
  4. 1+1=0 (plus a carry of 1 to next higher column)
  5. 1+1+1=11(carry 1 to the next)
Note: 1 is the largest digit in binary number system.
 

Binary subtraction

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:
  1. 0-0=0
  2. 0-1=1(with a borrow from the next column)
  3. 1-0=1
  4. 1-1=0
Additive method of subtraction is known as complementary subtraction.
 

Binary multiplication 

The multiplication table for binary arithmetic consists of only the following four entries:
  1. 0×0=0
  2. 0×1=0
  3. 1×0=0
  4. 1×1=1

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).
 

Binary Division

The division table for binary arithmetic consists of only the following four entries:
  1. 0÷0= Divide by zero error
  2. 0÷1=0
  3. 1÷0=Divide by zero error
  4. 1÷1=1
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:
  1. 35-5=30
  2. 30-5=25
  3. 25-5=20
  4. 20-5=15
  5. 15-5=10
  6. 10-5=5
  7. 5-5=0
Divisor is subtracted repeatedly from the dividend until the result of subtraction becomes less than or equal to zero.
 
© 2016 - 2022, All Rights are Reserved.