5 ms·
Binary coded decimal makes perfect sense if you're going to output the value to a succession of 7 segment displays (such as in a calculator). You would have to
by IIAOPSW 4y ago
Binary coded decimal makes perfect sense if you're going to output the value to a succession of 7 segment displays (such as in a calculator). You would have to do that conversion in hardware anyway. A single repeated circuit mapping 4 bits to 7 segments gets you the rest of the way to readable output. Now that I think about it, its surprising ASCII wasn't designed around ease of translation to segmented display.
- bregma 4y agoMaybe because ASCII is from the early 1960s and 7-segment displays didn't become widespread until 15 years or so later.
- kibwen 4y ago> Now that I think about it, its surprising ASCII wasn't designed around ease of translation to segmented display. Wikipedia has a section on the design considerations of ASCII: https://en.wikipedia.org/wiki/ASCII#Design_considerations https://en.wikipedia.org/wiki/ASCII#Design_considerations
- jodrellblank 4y agoI love that there's a fractal world down there; from that the digits 0-9 start with bit pattern 0011 and then their value in binary to make easy convertion to/from BCD, and that control codes Start Message and End Message were positioned to maximise the Hamming distance so they're maximally different and least likely to be misinterpreted as each other in case of bits being mixed up, that 7-bit ASCII used on 8-bit tape drives left room for a parity bit for each character, that lowercase and uppercase letters differ only by the toggling of a single bit, that some of the digit/shift-symbol pairings date back to the first typewriter with a shift key in 1878...
- jasomill 4y agoAnd my personal favorite: DEL is 1111111 so it could be punched over any other character to "delete" it from a paper tape.
- IIAOPSW 4y agoIn the 8 bit variant you could also interpret it as the Morse Code letter ........, which is an early form of non-printable character known as a "procedure sign" (aka "pro-sign"), and is often transcribed as letters without the inter-letter spacing (Eg <SOS> is the transcription of ...---...). The prosign <eeeeeeee> means the sender has mis-keyed something and you should ignore the previous character.
- kps 4y agoThe Wikipedia section is pretty good now. There are a few notable omissions. The backslash was added so that logical ∧ and ∨ could be written as /\ and \/ — two operators for the price of one. The characters : and ; were considered the least important punctuation, so they were placed immediately after 9, where they could be replaced by single-character 10 and 11 for shillings. And the characters *+,-./ were placed in rows 10-15 so that they could easily be combined with the digits to make a 16-bit subset suitable for writing numbers and basic arithmetic.
- karmakaze 4y agoEBCDIC 1963/64 (i.e. E-BCD-IC) was an extension of BCD to support characters. [0] https://en.wikipedia.org/wiki/EBCDIC https://en.wikipedia.org/wiki/EBCDIC
- dhosek 4y ago370 Assembly had a machine operation for converting an EBCDIC-encoded digit string into an internal integer which seemed odd at the time, but the more I think about it (converting digit strings to integers is a surprisingly subtle operation), the more it makes sense to do this at the lowest level possible. The other interesting thing about EBCDIC was that character codes with A–F in the lower nibble of the code were generally unused or reserved for uncommon characters. This restriction didn’t apply to the upper nibble (most notably the digits were encoded as F0–F9).
- jasomill 4y agoThat's not unusual for a CISC instruction set; even x86 has rudimentary decimal (BCD and ASCII) arithmetic support. Modern z/Architecture (64-bit 360/370/390 successor) has instructions to convert numbers between EBCDIC, ASCII, Unicode, packed decimal, zoned decimal, and binary, and to convert Unicode character strings between UTF-8, UTF-16, and UTF-32. In addition to conversion instructions, z/Architecture has full arithmetic support for binary and decimal integer operations and binary, decimal, and hexadecimal floating-point. POWER6 and later instruction sets also include full support for decimal floating-point.
- karmakaze 4y agoI assumed that packed decimals operations were already supported in old processors. E.g. COBOL had the 9(7)V9(2) implied-decimal-point style of money format that was well supported. Or do you mean all operations and not only conversion and basic + - * /.
- Smoosh 4y ago"A program running on z/OS and the zSeries mainframe can run with 24-, 31-, or 64-bit addressing (and can switch among these if needed)." https://www.ibm.com/docs/en/cics-ts/5.4?topic=basics-24-bit-31-bit-64-bit-addressing https://www.ibm.com/docs/en/cics-ts/5.4?topic=basics-24-bit-...