The digital circuitry you see inside computers and other electronic devices can only communicate via two concepts: on and off. These concepts are represented to us in the form of binary numbering, where 0 is off and 1 is on. To truly communicate with a computer, further conversions are necessary to bring the computer language to a more human format. The first step in the conversion process is to convert binary coding into a more readable decimal system. Weighted and non-weighted coding refers to the method in which binary numbers are converted to decimal. With weighted coding, each digit in a number is assigned a weighted value before the conversion. Non-weighted coding methods use slightly varied formulas but perform the conversions without the weight value.

Before understanding weighted coding, you must first understand numbering systems and positional notation.

## Numbering Systems

Numbering systems are indicated by a base, which is the highest number you can count to before having to add another digit. For example, the numbering system we all learn as children is called base 10, because the first ten numbers in the sequence, 0 through 9, can be counted using single digits. Once you get to 10, you have to shift everything over and count in two-digit numbers until you get to 100, and then you count in three-digit numbers. This base 10 system is also called the decimal system.

## Positional Notation

Positional notation occurs when you assign a positional value to each digit in a real number, from right to left. For the number 4782, for example, starting with the 2 and counting from right to left, the positions are 0, 1, 2, 3 as in the following:

## Video of the Day

4782 = number 3210 = positional values

## Weighted Coding

In the example above, the positional assignments 0 through 3 can be the weighted values of their assigned digits. So the weight of the 4 is 3 and the weight of the 7 is 2. The weight of a number comes into play when converting from any base numbering system to the decimal (base 10) numbering system. One formula for converting a weighted number is to multiply each digit by its base to the power of its position, and then add all the resulting digits. In the example below, 100101, which is a binary base 2 number, is converted to a decimal (base 10) number.

100101 = Binary (base 2) number 543210 = positional weights (1 x 2^5) + (0 x 2^4) + (0 x 2^3) + (1 x 2^2) + (0 x 2^1) + (1 x 2^0) = 32 + 0 + 0 + 4 + 0 + 1 = 37 37base10 = decimal conversion

Other weighted methods include BCD and 2421, each of which uses a similar formula to assign weights and convert to decimal.

## Non-Weighted Coding

Gray code is a non-weighted coding method that alters just one bit in a binary number when moving from one decimal number to the next. In normal binary coding, the digits 10 would represent the decimal number 2. When using gray code, one bit of that binary number changes so the decimal number 2 is represented by the binary digits 0011. Sequentially, the decimal number 3, which would normally be represented by the binary digits 0011, is now converted to 0010, because only the one bit can change.

Excess-3 is another non-weighted coding method and was once used in older computers and adding machines. With excess-3, you add 3 to a decimal number before converting it to binary. So the decimal number 2, for example, would first increase by 3, making it 5. The binary conversion of 2 using the Excess-3 method would be 0101 instead of its normal binary value of 0010.