UW AMath High Performance Scientific Computing
 
AMath 483/583 Class Notes
 
Spring Quarter, 2011

Previous topic

Computer Memory and Storage

Next topic

Machine code and assembly language

This Page

Punch cardsΒΆ

Once upon a time (through the 1970s) many computer programs were written on punch cards of the type shown here [image source]:

_images/punch-card.png

This is a form of binary memory (see Computer Memory and Storage) where a specific set of locations each has a hole punched (representing 1) or not (representing 0).

This particular card has had the sequence of ASCII characters typed on it so that you can see the binary sequence the corresponds to each.

When programs were written on cards, one card was required for each line of the program. The early conventions of the Fortran programming language are related to the columns on a punch card. Only the first 72 columns were used for the program statements. The last 8 columns could be used to print a card number, so that the unlucky programmer who dropped a deck of cards had some chance of reordering them properly. Many Fortran 77 compilers still ignore any characters beyond column 72 in a line of a program, leading to bugs that can be hard to find if care is not taken, e.g. a called xnew might be truncated to x if the x is in column 72. If the program also uses a variable called x, this will not be caught by the compiler.

Punch cards were a great step forward from punched tape [wikipedia] where a long strip of paper was used to store the entire program (and making a mistake required retyping more than just one card).