← Go Back

Chapter - 5 Code

Types of Codes

  1. Numeric codes: a code that contains numbers, is called numeric code
  2. Alphabetic code: a code that contains alphabets, is called alphabetic code
  3. Alphanumeric code: a code that contains alphabets and numbers
  4. Digital or binary code: a code that contains 0’s or 1’s
  5. BCD code (Binary Codeed Decimal): A BCD code is a four bit code this code is used to represent decimal numbers from 0-9. BCD code is used to simplify decimal conversions.
  6. Excess-3 Code: Excess-3 code is a four bit code. this code is un-weighted code. the important property of this code is that, this code is self complementary code. that is i.e. 9’s complement of the decimal number can be obtained directly by complementing its excess-3 code. An excess-3 code of a decimal number can be obtained by adding 3 to each decimal digit and then write that digit in BCD ( 8 4 2 1).
  7. Self-Complementary Code: 9’s complement of decimal number is directly obtained by complementing its excess-3 code. This property is called self-complementary property.

Bianry to Gray Code conversion

  1. Rule 1: the MSB (most significant bit) of gray number remains same as binary
  2. Rule 2: start from left to right, add each pair of binary bits obtain new gray bits. Discard the carry

Gray to Binary Code

Following rules are applied to convert a gray number into binary number.

  1. Rule 1: the MSB (most significant bit) of binary number remains same as gray number
  2. Rule 2: add each granted gray bit with next binary to obtain new gray bit. Discard the carry