Fixing the core memory in a vintage IBM 1401 mainframe
righto.com
righto.com
The 1401 is a strange machine. It's a direct descendant of IBM's electromechanical card machines, and it shows. It has a memory layout and ALU designed for fixed length strings of decimal digits of arbitrary length. The end of a number is indicated by a "word mark" bit, a special 7th memory bit on each 6 bit character.
In early computers, "business" computers had decimal arithmetic hardware, and "scientific" computers had binary. The IBM System/360 had both. This lives on in the binary-coded-decimal instructions in x86, which are used by almost nobody. (You can only do one digit at a time, because the x86 decimal instructions haven't been upgraded since x86 machines really were 8 bit.)
I think it probably comes down to cost. Just to support two packed digits, you need a fair bit of extra hardware (or a little extra hardware and a bunch of microcode) so you can properly calculate the correction factor. Expanding this to a full word means you need to be able to do that calculation for 4 nibbles instead of 2 which is about 3 times worse (you effectively get the most significant nibble "for free" so it's 3 extra nibbles to support instead of just 1).
The 8080, Z-80, 6502, etc are 8-bit processors that support BCD arithmetic, 2 digits at a time. The 6502 has a decimal mode flag that enables BCD arithmetic. The 8080 and descendants use a DAA (Decimal Adjust Accumulator) instruction that fixes up the BCD digits after doing a binary add.
The x86 supports packed BCD (2 digits per byte) or unpacked BCD (1 digit per byte) in the general purpose registers, and 10-byte, signed 18 digit BCD integers in the FPU registers. It has additional adjust operations DAS (Decimal Adjust after Addition), AAA, AAS, AAM, AAD (ASCII Adjust after Addition/Subtraction/Multiplication/Division for unpacked values).
The 1401 is a decimal machine with one BCD digit per character. It has 6-bit characters, along with a word mark bit and a parity bit with each character.
http://www.visual6502.org/wiki/index.php?title=6502DecimalMo...
(I haven't heard of the 1401 called Mainframes before, though)
But whatever you call it, the 1401 is an interesting computer.
I am wondering if the mainframe tag is a more recent thing, as I don't remember that description back when it was still in production.
Weekend Project: A Tiny Core Memory Array: http://mikesmods.com/mm-wp/?p=556
Weekend Project: Determining Operating Parameters of a Memory Core: http://mikesmods.com/mm-wp/?p=610