IAT Calendar Bulletin Board: Register Bulletin Board: Login

Integrated Coordinated Science for the 21st Century

+ Chapter 5
Long-Distance Communication
Activity 8
Bar Codes
Background Information

The bar code is a digital representation of numbers from zero to nine. The representation of a single number is a series of five bars, which are either long or short. Each bar in the series of five is assigned a value. Only two bars in a series are long, and the values of these are added together to give the number that series represents. The short bars are disregarded. Since two bar values are added together to give numbers from one to nine, no value can be greater than nine. Suppose a bar has the value one. Then a bar must have the value zero, so that adding one and zero generates one. To generate three, a bar must have the value two, since three equals two plus one. Assuming each bar has a different value, the only way to generate four is by adding four to zero, so a bar must have the value four. Adding four to one gives five. Adding four to two gives six. The only way to generate seven is to add seven and zero, so a bar must have the value seven. Seven plus one gives eight, and seven plus two gives nine. The example on page 292 shows the values and positions for the bars, and the sums below generate the numbers from 1 to nine:
1 + 0 = 1
2 + 0 = 2
2 + 1 = 3
4 + 0 = 4
4 + 1 = 5
4 + 2 = 6
7 + 0 = 7
7 + 1 = 8
7 + 2 = 9

That takes care of one through nine, but what about zero? Since only one bar has value zero, there is no way to generate zero by adding the values of two bars. Zero must be an exception. Since the code generates only numbers up to nine, a pair of bar values that adds up to a value greater than nine can represent zero. As it happens, there is only one such pair, seven and four. So long bars in the first two locations—the two locations on the left—provide the code for zero.

Although a complete ZIP code has nine digits, the bar code has ten. The final digit is called the check digit, and it provides a way to catch many mistakes in barcode printing or reading. The check digit is equal to the difference between the sum of the first nine digits and the next higher multiple of ten, as shown in the example below.

Here is the bar code example from the Student Book:

1 2 3 4 5 6 7 8 9 5

The sum of the first nine digits is

1+2+3+4+5+6+7+8+9 = 45

The next multiple of ten is 50. The difference between this next multiple of ten and the sum above (45) is the value of the check digit.

check digit = 50 - 45 = 5

Each time a code is read, a computer adds the check digit to the sum of the first nine digits.

45 + 5 = 50

This sum should be a multiple of ten, which it is.

But suppose there is a smudge over the bars for the first digit. Suppose this smudge makes all the short bars look like long bars. The scanner would then read zero for the first digit. But now the sum of the first nine digits is 44 (the first digit was originally one, but now it is zero, so the sum is diminished by one). The computer adds 44 to the check digit, which is still 5.

44 + 5 = 49

The sum is no longer a multiple of ten, and the computer flags this piece of mail for an error in the ZIP code.