CodesandTutorials
Home   Programming   Hardware   Networking
 
Next generation website theme is here (black, neon and white color) - Reduces eye strain and headache problems.  

Hardware Categories

Binary Number System

« Previous Point - Number System Next Point - Octal Number System »

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.

Binary addition :

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 :

Binary substraction :

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 :

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

Simple example :

Binary division :

Division is done same as two decimal numbers.

Simple example :


One's complement:

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

Two's complement:

  • 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 all conversions:

Binary to decimal conversion

Steps:

  • Multiply each bit by 2n, 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:


« Previous Point - Number System Next Point - Octal Number System »


Tip Box

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


Advertisement

Rate Website
   

 


Terms of Use | Privacy Policy | Contact Us
CodesandTutorials © 2013 All Rights Reserved