We have studied in previous point that binary number system consists of two numbers 0's and 1's, now we are going to learn binary related arithmetic operations, complements and conversions.

Performing addition of two binary number is same as addition of two decimal numbers i.e. add individual bits and propagate the carry.

Rules of binary addition

Augend | Addend | Sum | Carry | Result |

0 | 0 | 0 | 0 | 0 |

0 | 1 | 1 | 0 | 1 |

1 | 0 | 1 | 0 | 1 |

1 | 1 | 0 | 1 | 10 |

Simple example :

Is same as performing substraction of two decimal numbers.

Rules of binary substraction

Minuend | Subtrahend | Difference | Borrow |

0 | 0 | 0 | 0 |

0 | 1 | 1 | 1 |

1 | 0 | 1 | 0 |

1 | 1 | 0 | 0 |

Simple example :

Binary multiplication is done similar to multiplication of two decimal numbers.

Simple example :

Division is done same as two decimal numbers.

Simple example :

- In binary system, if each 1 is replaced by 0 and each 0 by 1, then resulting number is called as one's complement of the that number.
- If first number is positive then resulting will be negative with the same magnitude and vice versa.

- If 1 is added to the complement of a number then resulting number is known as two's complement.
- If MSB is 0 then the number is positive else if MSB is 1 then the number is negative

Binary to decimal conversion

Steps:

- Multiply each bit by 2
^{n}, where n is the weight of the bit. - Wieght is calculated by the position of bit, starting from 0 on the right.
- Add the results.

Example:

Binary to octal conversion

Steps:

- Group three bits starting from right.
- If group of three bits is not formed, add extra zeros to the left for integer part and to the right for fractional part.
- Convert to octal digits.

Example:

Binary to hexadecimal conversion

Steps:

- Group four bits starting from right.
- If group of four bits is not formed, add extra zeros to the left for integer part and to the right for fractional part.
- Convert to hexadecimal digits.

Example:

Every communication between the electronic componets inside the computer system takes place using binary number system.

Terms of Use | Privacy Policy | Contact Us | Advertise

CodesandTutorials © 2014 All Rights Reserved