Online Book Reader

Home Category

Code_ The Hidden Language of Computer Hardware and Software - Charles Petzold [31]

By Root 1603 0
light is often called the film speed. A film that's very sensitive to light is said to be fast because it can be exposed very quickly. The speed of the film is indicated by the film's ASA (American Standards Association) rating, the most popular being 100, 200, and 400. This ASA rating isn't only printed on the box and the film's cassette but is also encoded in bits.

There are 24 standard ASA ratings for photographic film. Here they are:

25

32

40

50

64

80

100

125

160

200

250

320

400

500

640

800

1000

1250

1600

2000

2500

3200

4000

5000

How many bits are required to encode the ASA rating? The answer is 5. We know that 24 equals 16, so that's too few. But 25 equals 32, which is more than sufficient.

The bits that correspond to the film speed are shown in the following table:

Square 2

Square 3

Square 4

Square 5

Square 6

Film Speed

0

0

0

1

0

25

0

0

0

0

1

32

0

0

0

1

1

40

1

0

0

1

0

50

1

0

0

0

1

64

1

0

0

1

1

80

0

1

0

1

0

100

0

1

0

0

1

125

0

1

0

1

1

160

1

1

0

1

0

200

1

1

0

0

1

250

1

1

0

1

1

320

0

0

1

1

0

400

0

0

1

0

1

500

0

0

1

1

1

640

1

0

1

1

0

800

1

0

1

0

1

1000

1

0

1

1

1

1250

0

1

1

1

0

1600

0

1

1

0

1

2000

0

1

1

1

1

2500

1

1

1

1

0

3200

1

1

1

0

1

4000

1

1

1

1

1

5000

Most modern 35-millimeter cameras use these codes. (Exceptions are cameras on which you must set the exposure manually and cameras that have built-in light meters but require you to set the film speed manually.) If you take a look inside the camera where you put the film, you should see six metal contacts that correspond to squares 1 through 6 on the film canister. The silver squares are actually the metal of the film cassette, which is a conductor. The black squares are paint, which is an insulator.

The electronic circuitry of the camera runs a current into square 1, which is always silver. This current will be picked up (or not picked up) by the five contacts on squares 2 through 6, depending on whether the squares are bare silver or are painted over. Thus, if the camera senses a current on contacts 4 and 5 but not on contacts 2, 3, and 6, the film speed is 400 ASA. The camera can then adjust film exposure accordingly.

Inexpensive cameras need read only squares 2 and 3 and assume that the film speed is 50, 100, 200, or 400 ASA.

Most cameras don't read or use squares 8 through 12. Squares 8, 9, and 10 encode the number of exposures on the roll of film, and squares 11 and 12 refer to the exposure latitude, which depends on whether the film is for black-and-white prints, for color prints, or for color slides.

Perhaps the most common visual display of binary digits is the ubiquitous Universal Product Code (UPC), that little bar code symbol that appears on virtually every packaged item that we purchase these days. The UPC has come to symbolize one of the ways computers have crept into our lives.

Although the UPC often inspires fits of paranoia, it's really an innocent little thing, invented for the purpose of automating retail checkout and inventory, which it does fairly successfully. When it's used with a well-designed checkout system, the consumer can have an itemized sales receipt, which isn't possible with conventional cash registers.

Of interest to us here is that the UPC is a binary code, although it might not seem like one at first. So it will be instructive to decode the UPC and examine how it works.

In its most common form, the UPC is a collection of 30 vertical black bars of various widths, divided by gaps of various widths, along with some digits. For example, this is the UPC that appears on the 10 ¾-ounce can of Campbell's Chicken Noodle Soup:

We're tempted to try to visually interpret the UPC in terms of thin bars and black bars, narrow gaps and wide gaps, and indeed, that's one way to look at it. The black bars in the UPC can have four different widths, with the thicker bars being two, three, and four times

Return Main Page Previous Page Next Page

®Online Book Reader