Converting punched codes to octal
A column of data may contain up to 12 codes. Quantum treats a column as a binary array in which a cell is set to 1 if a punch is present in that column, or zero if it is not. For example, if a column is multicoded ‘09’, the array will be:
& - 0 1 2 3 4 5 6 7 8 9
0 0 1 0 0 0 0 0 0 0 0 1
Quantum converts this into an octal value by reading the cells in the array three at a time. In the example above, the first three cells are 001. In octal, the first cell in the group has a value of 4, the second has a value of 2, and the third has a value of 1. If a cell is ‘on’ (that is, it is set to 1), Quantum adds the value for that cell into the total for that cell. When this rule is applied to the first three cells of the array, the result is a value of 1.
The second three cells are all zero, as are the third three, but the last set of three cells is 001 like the first set. The octal value of the array is therefore 1001.
Here is another example for a multicode of ‘&1’:
& - 0 1 2 3 4 5 6 7 8 9
1 0 0 1 0 0 0 0 0 0 0 0
Its octal value is 4400.
See also