Saturday 27 September 2014

BINARY CODES


BINARY CODES :
    
   Computer work with binary numbers, we work with decimal number.
   A code is needed to represent decimal numbers as binary numbers.
   The digital data is represented, stored and transmitted as group of binary digits(bits)
   The group of bits are also known as binary codes.
   Binary code can be classified as numeric codes and alphanumeric codes.
   Numeric codes are used to represented numeric information,  i.e, only numbers.
   Alpha numeric codes are used to represent alpha numeric information i.e , letters of the alphabet and        decimal number.

Classification of Binary codes:-
        The different binary codes can be classified as
        1.Weighted codes
        2.Non-weighted codes
        3.Reflective codes                                        
        4.Sequential codes
        5.Alpha numeric codes
        6.Error correction &Detection codes

        1.Weighted codes:-
              In weighted codes, each digit position of the number represents a specific weight.
             Examples for weighted codes are:
                               Binary, Octal, Decimal, Hexadecimal and BCD(8-4-2-1)codes.
ü  Binary code is a weighted code. The LSB in the binary code has a weight of 1, next digit has a                                                                                                              weight   of 2, next digit has a weight of 4 and next digit has a weight of 8.
                  Ex: 1 0 1 0
ü  Octal code is also weighted code. Starting from LSB the weights of different digits are 1,8,64,512..etc
                   Ex: 2 4 1 3
ü  Decimal code is also weighted code Starting from LSB the weights of different digits are 1,10,100,1000.
                                 Ex: 5 2 4 1
ü  Hexadecimal code is also weighted code. Starting from LSB the weights of different digits are 1,16,256..etc.
                                 Ex: 2 3 c
ü  BCD(8-4-2-1) is also a weighted code . Starting from LSB the weights of different digits are 1,2,4,8.
ü  The codes 8421,2421,5211 are weighted codes.

2.Non-Weighted Codes:-  

Non-weighted codes are not assign with any weight to each digit position . Each position   with the number does not have any fixed weight.
Ex: Excess-3 codes and  Gray codes are non weighted codes.

 3.Reflective Codes:-
A code is reflective if the code for 9 is the complement of code for  zero, 8 for 1,7 for 2, 6 for 3 and 5 for 4. 2421,5211,excess-3 are reflective codes.
However 8421 code is not reflective.

 4.Sequential Codes:-
A code is sequential when each succeeding code is one binary number greater than its preceding code. This property is useful in mathematical manipulation of data.

 Ex: 8421, excess-3 are sequential codes. 

Advantages of Binary Code

Following is the list of advantages that binary code offers.
·         Binary codes are suitable for the computer applications.
·         Binary codes are suitable for the digital communications.
·         Binary codes make the analysis and designing of digital circuits if we use the binary codes.

·         Since only 0 & 1 are being used, implementation becomes easy.

No comments:

Post a Comment