2

Does anyone know what is the meaning of the numbers in punch cards? I need an example of any language, it's important for me to understand which information could be manipulated.

migrated from stackoverflow.com Jan 16 at 20:00

This question came from our site for professional and enthusiast programmers.

  • 2
    It might be helpful if you could explain what exactly you're looking for, as well as what's the intended usage. Punch cards are a quite wide field with many many different use cases. – Raffzahn Jan 16 at 20:35
  • 2
    As far as any computer is concerned, there are no numbers on punch cards -- just holes. – A. I. Breveleri Jan 16 at 21:53
  • 3
    This is really the type of question where a picture is mandatory. numbers can be in a several places and with several functions. (And, as already been pointed out in several places, the numbers written on the card is not read by the card reader.) – UncleBod Jan 17 at 7:50
  • 2
    This is a link-only response, so wouldn't pass muster as an answer: Douglas W. Jones's punched card index has almost everything you could ask for. As he writes: “There were multiple mappings between the 12 holes of one card column and the character sets of various machines and keypunches.” For pre-computing tabulation applications, Punched cards; their applications to science and industry shows many ways that punch cards were used for record management. – scruss Jan 17 at 13:26
  • 2
    @SolomonSlow: Punched cards were used by Jacquard Looms in the 18th century. Predating computing. – Chenmunka Jan 17 at 18:20
3

Fundamentally the card is just an 80x12 array of bits (punch = 1, no punch = 0) and it's up to the system reading the card to interpret them. For example, the IBM 701 could read a card in "binary" mode, which interpreted the card as 12 rows of 72 bits (the rightmost 8 columns were ignored). Each 72-bit row represented two 36-bit machine words, which could be data or a pair of 18-bit instructions. This article describes a single-card boot loader for the 701 that was used to load larger programs from a stream of cards.

(As an aside, this is why early FORTRAN versions imposed a 72-character limit on source lines: the first FORTRAN compiler ran on the 701's successor, the IBM 704, which could only read 72 columns of a card - see p. 39 of the 704 Manual of Operation (31 MB PDF). As others have noted, the 8 ignored columns were often used to encode a sequence number for each card, which could be a lifesaver for the unfortunate programmer or operator who dropped a card deck on the floor.)

Normally though the card would be interpreted as representing 80 characters, one per column, in a binary-coded decimal (BCD) format. While they could have treated each column as a 12-bit integer which would have given 4096 possible characters (prehistoric Unicode, anyone?), a simple BCD encoding would treat it as two fields: a decimal part in rows 1-9, where a single row was punched to represent that digit, and a "zone" using rows 0, 11 and 12, which allows four values (one of the three rows punched, or no row punched).

In theory this would give you 36 characters to play with (4 zone values times 9 digit values), but real BCD encodings allowed multiple punches in the decimal field so you'd typically have 48 or 52 characters: there's a nice example in this description of the IBM 026 card punch, and Wikipedia lists many more encodings. Note that a column with only row 0 punched has an obvious interpretation as "no zone, digit 0" but strictly speaking it's "0 zone, no digit" which was used to encode the numeric character 0.

As another aside, once you've seen how the structure of BCD character sets relates to physical cards, the layout of EBCDIC starts to make a little more sense. But only a little.

  • The last time someone claimed the card reader on a 701/704 could not actually read more than 72 columns, it was downvoted, despite the existence of manuals saying so. Link here – another-dave Jan 17 at 0:25
  • I think the distinction being pointed out there is that the card reader itself can read all 80 columns, but it's the 701/704 host that can only transfer 72 bits per row to core (the manual page I referenced does say that the reader(?) control panel can be wired to present any 72 of those 80 columns to the host, not necessarily columns 1-72), So to be accurate I should probably say "early FORTRAN compilers" since it's an implementation-specific limit that became enshrined in the language standard. – Simon Brady Jan 17 at 0:38
2

Does anyone know what is the meaning of the numbers in punch cards? I need an example of any language, it's important for me to understand which information could be manipulated.

It's not entirely clear what you mean by numbers. Is this about the numbers printed on the cards, or how numbers are encoded?

In general, punch cards do not encode any binary code, but characters (*1), based on a decimal code. Each character is encoded in one (of usually 80) columns. In the beginning punch cards were only meant to encode numbers and had 10 rows, numbered from zero (0), at the top, to nine (9), at the bottom. To hold a number, one and only one hole was punched for each column, at the according position.

Later on, the code was extended to cover letters and other symbols as well. To do so the space above the zero row, originally intended to be printed on or hold instructions, was used for two additional punching positions called 11 and 12 with 12 being the topmost. A decimal code grouping the letters in 3 groups of 9, 9 and 8 was developed. To punch a letter its basic row (1..9) within the group was punched, plus a hole in row 12, 11 or 10 (when encoding letters row zero (0) was called row 10) as follows:

A..I  ->  Row 12 + Row 1..9
J..R  ->  Row 11 + Row 1..9
S..Z  ->  Row 10 + Row 2..9  (*2)

Except for a few early symbols (*3), encoding for symbols differed a lot between manufacturers and systems. In the long run IBM's basic encoding became standard within the mid 1960s. Here most symbols are identified by a punch in Row 8 plus a combination of 10..12 and 2..7 making it three holes per column (*4).

There are also standardized punch sequences for extended codesets as well as special usage, adding encodings with up to 6 holes per column. But that as well needs a separate look, depending on what you want to do with it.


*1 - There are also encodings based on properties but that's custom and a complete different story.

*2 - Since only 26 or the 27 available combinations are needed, one stays unused. By choosing the 10+9 combination as such, the encoding made sure to keep a minimum distance between two holes at two rows, thus working more reliably on weak paper or worn out cards.

*3 - Like minus which was a single 11 punch

*4 - Emphasis on most, as there are also a few dual punch symbols.

  • 1
    IBM computers also supported "column binary" mode for pure binary data. The 2x12 hole positions on two adjacent columns stored 3 8-bit bytes of data in pure binary - no hole for a zero bit and a hole for a one bit. If course this created rather fragile cards, with 50% of the hole positions punched on average! – alephzero Jan 16 at 20:50
  • @alephzero Interesting, I worked for 25+ years on /370 mainframes and never ever seen the format you mention. Not even read in a manual or program or heared form the usual 'back then' stories by older peers. Sure, there where several binary or binary like formats encoding one binary byte per column, but no 24 bit one. I'd put it on the list of many custom formats - after all, one could control a punch in raw mode - and read cards in raw mode. – Raffzahn Jan 16 at 21:03
  • 1
    @alephzero, You might want to avoid using an 029 keypunch to duplicate those "column binary" cards. At least anyway, don't try using an 029 to duplicate lace cards. (Don't ask me how I know!) – Solomon Slow Jan 17 at 19:45
1

The answer may depend on which format you are referring to. For the IBM 80-column punched card, I found this information from this wiki link

...alphabetic and special characters was added through the use of columns and zones. The top three positions of a column are called zone punching positions, 12 (top), 11, and 0 (0 may be either a zone punch or a digit punch).[46] For decimal data the lower ten positions are called digit punching positions, 0 (top) through 9.[46] An arithmetic sign can be specified for a decimal field by overpunching the field's rightmost column with a zone punch: 12 for plus, 11 for minus (CR).

But, as you read further down, the "zones" differ in meaning.

As for manipulation, I'm not sure. The few times I got to use punch card systems, any change in data or code required creating all new cards.

The order the cards were fed into the system made a difference too. It was common to number the cards sequentially in case the cards became disorganized (like from from dropping them on the way to class)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.