Binary Code:

The digital data is represented, stored and transmitted as group of binary bits. This group is also called as binary code.

Advantages of Binary Code
 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.

Classification of Binary Codes
The codes are broadly categorized into following four categories.
  • Alphanumeric Codes
    • ASCII CODE
    • EBCDIC CODE
  • Weighted Codes
    • 8421 code or Binary Coded Decimal Code (BCD)
  • Non-Weighted Codes
    • Excess 3 code
    • Gray code
  • Error Detecting Codes & Error Correcting Codes
    • Parity Bit
    • Hamming code
BCD Code
  • In this code each decimal digit is represented by a 4-bit binary number.
  • BCD is a way to express each of the decimal digits with a binary code.
  • In the BCD, with four bits we can represent sixteen numbers (0000 to 1111).
  • But in BCD code only first ten of these are used (0000 to 1001).
  • The remaining six code combinations
  • i.e. 1010 to 1111 are invalid in BCD.
Alphanumeric Code
  • A binary digit or bit can represent only two symbols as it has only two states '0' or '1’.
  • But this is not enough for communication between two computers because there we need many more symbols for communication.
  • These symbols are required to represent 26 alphabets with capital and small letters, numbers from 0 to 9, punctuation marks and other symbols.
  • The American Standard Code for Information Interchange (ASCII) was developed under the auspices of a committee of the American Standards Association (ASA), called the X3 committee.
ASCII code
  • Representing text strings, such as “Hello, world”, in a computer
  • Each character is coded as a byte
  • Most common coding system is ASCII (Pronounced ass-key)
  • ASCII = American National Standard Code for Information Interchange
EBCDIC Code
  • Extended Binary Coded Decimal Interchange Code (EBCDIC) is an eight-bit character encoding used mainly on IBM mainframe and IBM midrange computer operating systems.
  • EBCDIC descended from the code used with punched cards and the corresponding six bit binary-coded decimal code used with most of IBM's computer peripherals of the late 1950s and early 1960s
  • Extended BCD Interchange Code (pronounced ebb’-se-dick)
  • 8-bit code Developed by IBM
  • Rarely used today
Weighted code
  • The positional weighted are fixed. Each position within the binary number is assign a fix weight(value).
Example of BCD code or 8421 code
709310 = ? (in BCD or 8421 code)

     7     0       9      3
0111 0000 1001 0011

Non-Weighted code
  • That are not positional weighted. Each position within the binary number is not assign a fix value.
  • Example of Excess-3 code and Gray code
Excess-3 code
  • It is also called XS3, is non-weighted code, used to express decimal numbers.
  • The code derives its name from the fact that each binary code is the corresponding 8421 code plus 0011(3).
Example
0 is 0000 + 0011 = 0011
9 is 1001 + 0011 = 1100

Gray Code
  • It is the non-weighted code and it is not arithmetic codes. That means there are no specific weights assigned to the bit position.
  • It has a very special feature that, only one bit will change each time the decimal number is incremented.
  • As only one bit changes at a time, the gray code is called as a unit distance code.
  • The gray code is a cyclic code. Gray code cannot be used for arithmetic operation.
There are two types
Gray to binary
Binary to gray

Method to change binary to gray code
            1) Record the MSB.
            2) Add this bit to the next position. Recording the sum and neglecting the any carry.
            3) Record successive until completed.

Example of binary to gray code
Binary: 1 0 1 1
Gray:    1 1 1 0

Method to change gray to binary code
            1) Record the MSB.
            2) Add binary MSB to the next significant bit of gray code.
            3) Record this result ignoring carries.
            4) Continue the process until the LSB is reached.

Example of gray to binary code
Gray:    1 0 1 1
Binary: 1 1 0 1

Different Types of Codes


Download link for more detail: Different Types of Codes

Or follow my blog from below link

https://cdprajapati.blogspot.com/p/blog-page.html