Why do upper case letters come before lower case letters in the ASCII table?

Judking picture Judking · Oct 21, 2012 · Viewed 15.7k times · Source

In one of my interview, the interviewer asked me why the upper case letters are before the lower case letters in ASCII table, I searched on google.com but found nothing, could anyone gave me the answer? Thx a lot!

Answer

Mark Reed picture Mark Reed · Oct 21, 2012

I'm only guessing, but I imagine it's because the earliest character sets had no lowercase at all. The Baudot telegraph code was only 5 bits, and CDC mainframes natively used a 6-bit code; there was no room for lowercase. When ASCII was developed as a 7-bit code which finally had enough room for lowercase letters, they were considered something of a luxury add-on, so it made sense to put them in the back half of the set.

But it's worth noting that this ordering is specific to ASCII, and not necessarily true of other character sets; for example, EBCDIC has the lowercase letters first. Commodore microcomputers could switch between two character sets, and even though both were based on ASCII, the one with lowercase letters had them first. (The other set had extra graphic characters in place of lowercase.)

Unicode has taken its cue from ASCII (and the extended-Latin character sets based on it), so most of the alphabets that have case distinctions have the uppercase versions come first within their code blocks. But there are exceptions, and of course many other alphabets don't have case distinctions at all, while others have more complicated relationships than our simple 1-to-1 mapping.