📜 ⬆️ ⬇️

Educational program for working with punch cards (or the story of how “big data” were processed from 1890 to 1970)

In the period 1890-1970, all processing of big data was carried out through punch cards. Punch cards, in turn, were processed using so-called. “Recording equipment”, the central element of which was the electromechanical “punch card sorter”. Punch cards and related equipment were used to solve a wide variety of tasks: population census, accounting, inventory, payroll, etc.


How did people work with punch cards? What algorithm followed the electromechanical punch card sorter? How did you sort by numeric data fields? And on the string? About all this - below.




How did people work with punch cards?



The principle of operation of the electromechanical punch card sorter



Algorithm of bitwise sorting of numbers


How, then, does the punch card sorter manage to cope with their work? It implements an elegant “bitwise sorting” algorithm. Essence: the punch card sorter processes one digit of the data field at a time; to sort by three-digit field, a deck of punched cards must be passed through the sorter three times. So, the algorithm:


  1. By ordering punch cards by a numeric data field specified by the operator, the sorter processes only the low-order bit of this field during the first run. And in accordance with the value of this category, it decides where to drop the current punch card: which of the 10 digital pockets (from zero to ninth).
  2. After the sorter has completed the distribution of punch cards in the pockets, the operator takes them out and folds them into a common pack. In order: from the zero pocket to the ninth.
  3. The operator again puts the assembled punch card into the sorter, and repeats steps 1 and 2 sequentially for each digit.
  4. Everything, now punched cards are sorted.


Advantages of the Bitwise Sorting Algorithm



How to encode string data



Algorithm for sorting character strings


Thanks to this encoding, the sorter can sort the string data fields alphabetically. On this he needs two runs. The algorithm is as follows:


  1. On the first run, the punch sorter orders the cards in much the same way as when sorting numeric data fields. The difference is that in alphabetical sorting only nine pockets are involved: from the 1st to the 9th.
  2. At the end of the sorting, the operator removes punch cards from digital pockets. Again, in order (as is the case with the ordering by the numeric data field): starting with the first pocket and ending with the ninth. The operator sends the assembled pack of cards for sorting a second time.
  3. On the second run, the punch card sorter reads only the lines of the “zones” (0, 11 and 12), and ignores the lines with numbers.
  4. As a result, the ordered punch cards are distributed by the sorter into three “zonal” pockets: from A to I are placed in the 12th pocket; from J to R - in the 11th; from S to Z - to 0th.
  5. If the sorting needs to be performed not by one first character, but for example, by two or three first, then the process described above (steps one through four) is performed sequentially for each character. Those. for each character, two runs are made through the punch card sorter.


So, when there were no computers yet, enterprises processed large data using punched cards. Despite the fact that punch cards are irrevocably outdated, we are still confronted with their influence on the current state of computer technology - every time we have to put up with text formatting with 80-character strings. Something similar is observed, for example, when working with Far Manager.


')

Source: https://habr.com/ru/post/426499/


All Articles