Weighted
Codes
Weighted binary codes are
those binary codes which obey the positional weight principle. Each position of
the number represents a specific weight. Several systems of the codes are used
to express the decimal digits 0 through 9. In these codes each decimal digit is
represented by a group of four bits.
Non-Weighted
Codes
In this type of binary codes,
the positional weights are not assigned. The examples of non-weighted codes are
Excess-3 code and Gray code.
EXCESS-3 CODE
The Excess-3 code is also
called as XS-3 code. It is non-weighted code used to express decimal numbers.
The Excess-3 code words are derived from the 8421 BCD code words adding (0011)2
or (3)10 to each code word in 8421. The excess-3 codes are obtained as follows
Example
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 has only one
bit will change, each time the decimal number is incremented as shown in fig.
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.
APPLICATION OF GRAY CODE
·
Gray code is popularly used in the shaft position encoders.
·
A shaft position encoder produces a code word which represents the
angular position of the shaft.
No comments:
Post a Comment