Pages

Saturday 5 April 2014

Binary Number System

Human beings use base 10 (decimal) arithmetic

There are 10 distinct symbols, 0, 1, 2, …,9

Computers use base 2 (binary) system

There are only 0 and 1
These two binary digits are commonly referred as bits


(25)10 indicates number 25 base 10 i.e number in decimal system.
(25)2   indicates number 25 base 2 i.e number in binary system.

Conversion of Decimal number into Binary number :

Divide the decimal number by 2 repeatedly
Keep track of the remainders
Continue this process until the quotient becomes zero
Write the remainders in reverse order to obtain the binary number
Ex. Convert (25)10 to binary
               Quotient      Remainder
      25/2 =     12                  1                  LSB (least significant bit)
      12/2 =      6                   0
        6/2 =      3                   0
        3/2 =      1                   1
        1/2 =      0                   1                  MSB (most significant bit)

so (25)10  = (11001)2

Conversion of  Binary number into Decimal number :

now the weight of each bit in a binary number
‰Add them together to get its decimal equivalent

similarly you can use the concept of weight to convert a decimal number to a binary directly

No comments:

Post a Comment