13

In the ASCII table, punctuation characters appear between the non-printing characters and before the numbers (!"#$%&')*+,-./), between the numbers and the uppercase letters (:;<=>?@), between the uppercase letters ([\]^_`) and the lowercase letters, and after the lowercase letters ({|}~).

On first glance, one would expect these to be grouped together; possibly either before all alphanumerical characters or behind them. But this is not the case; they apprear spread out in these different groups.

Why is this the case? Is there some (possible historical) reason why the characters are grouped this way?

  • 3
    The numbers and letters were positioned so that they were 0-indexed and 1-indexed respectively, from 0110000, 1000000 and 1100000 respectively, to make them easier to decode. The punctuation characters then fill in the gaps. – David Arno Sep 13 '16 at 11:43
  • 3
    See the accepted answer to stackoverflow.com/questions/1136156/… for more details. – David Arno Sep 13 '16 at 11:44
9

According to Wikipedia ASCII article:

The code itself was patterned so that most control codes were together, and all graphic codes were together, for ease of identification. The first two columns (32 positions) were reserved for control characters.) The "space" character had to come before graphics to make sorting easier, so it became position 20hex for the same reason, many special signs commonly used as separators were placed before digits. The committee decided it was important to support uppercase 64-character alphabets, and chose to pattern ASCII so it could be reduced easily to a usable 64-character set of graphic codes, as was done in the DEC SIXBIT code (1963). Lowercase letters were therefore not interleaved with uppercase. To keep options available for lowercase letters and other graphics, the special and numeric codes were arranged before the letters, and the letter A was placed in position 41hex to match the draft of the corresponding British standard. The digits 0–9 were arranged so they correspond to values in binary prefixed with 011, making conversion with binary-coded decimal straightforward.

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.