Writing a Mandelbrot program for the IBM 1401 was an interesting project
March 23, 2015 6:43 AM   Subscribe

 
additional instructions were available for a rental fee.

that's really ahead of its time
posted by thelonius at 6:52 AM on March 23, 2015 [10 favorites]


With that hurdle cleared, I expect an Angry Birds port to quickly follow.
posted by Naberius at 6:58 AM on March 23, 2015 [1 favorite]


This is a great essay. I didn't know any of these details about the 1401 -- what an interesting machine. Thanks for posting!
posted by dylanjames at 7:01 AM on March 23, 2015


Paying more for existing additional features was an IBM hallmark. There's stories of people paying a lot for an upgrade to a system just to have an IBM tech come in and flip a switch. It's an old computer business practice, not a new one.
posted by jclarkin at 7:02 AM on March 23, 2015 [3 favorites]


All arithmetic is done in base-10. So if you divide two numbers, the IBM 1401 does base-10 long division, in hardware.

I suspect it was actually done in software. Addition was done by table lookup (which isn't mentioned). I've used the IBM 1620. You needed to load tables on punch cards or you couldn't use the add instruction.
posted by Obscure Reference at 7:04 AM on March 23, 2015 [1 favorite]


So, I had always wondered about the blinding hate certain crusty old programmers have for IBM. Now I kind of get it. This is worse than anything SAS or Mathworks could come up with.
posted by vogon_poet at 7:10 AM on March 23, 2015 [6 favorites]


"The 1401 I used is the Sterling model which it supports arithmetic on pounds/shillings/pence, which is a surprising thing to see implemented in hardware. (Up until 1971, British currency was expressed in pounds, shillings, and pence, with 12 pence in a shilling and 20 shillings in a pound. This makes even addition complicated, as tourists often discovered.) By supporting currency arithmetic in hardware, the 1401 made code faster and simpler."

This is something I had never even considered the existence of. That said, glancing through the Wikipedia list of non-decimal currency, this would seem to have only been relevant, by the late 50s, in the UK.
posted by frimble at 7:12 AM on March 23, 2015 [4 favorites]


Man, growing up, my dad wrote several different fractal programs (out of who knows what magazine) to run on our Kaypro 8088 CGA. It would run for hours - you could see it drawing the fractal very slowly, line-by-line on the monitor, in the 4-color glory (cyan, magenta, black, and hmm. white maybe ? ). When we got EGA, the pictures were a lot prettier, but still took forever to calculate.
posted by k5.user at 7:13 AM on March 23, 2015


Wait, so where do you even find paper and ink for the dot-matrix printer of a 50-year-old computer?
posted by leotrotsky at 7:17 AM on March 23, 2015


This reminds me of a period of intense boredom at work when I wrote a Mandelbrot set explorer in Excel. Most of it used built in functions, with one custom VBA function to calculate how many iterations until a point was determined to be outside the set. A page with cells set to a minimum size and axes that were dependent on limits entered on another page was the display. The gradients available for conditional formatting let me more or less replicate a traditional look, with points in the set being black, and a spectrum of colors when points fell out of the set.

I tell you, using enough iterations to use all of Excel's 15 digits of precision to determine if every point in a 1000x1000 array was in the set, especially when zoomed way in on some detail of the seahorse valley, that sure felt like the P4 with 1GB of ram I was using a 50 year old mainframe.

This exercise taught me a valuable lesson: using Excel's VBA debugger will always look like you are the hardest working person in the office, no matter how hard you are fucking the dog.
posted by [expletive deleted] at 7:21 AM on March 23, 2015 [11 favorites]


My favorite thing about decimalization in the UK is afterwards people complained the new money was too complicated.
posted by Artw at 7:22 AM on March 23, 2015 [9 favorites]


My favorite thing about decimalization in the UK is afterwards people complained the new money was too complicated.

To be fair, people who were accustomed to doing mental arithmetic with shillings and pence did have a point. 240 has way more factors than 100. You could divide a pound into thirds, sixths and eighths cleanly. After decimalization, you couldn't.
posted by [expletive deleted] at 7:30 AM on March 23, 2015 [1 favorite]


A friend proposed that we de-decimalise and go back to LSD (as in librae, solidi, denarii; it's how "pounds, shillings and pence" was shortened) in order to give the UK business software industry a chance. "That'll give Lotus 123 something to think about!" he chortled. This was some time ago, as you may gather...

I knew a bit about early mainframe architectures, but not that you could get UK currency hardware. There are plenty of arguments that duodecimal is a much more efficient base than any other for monetary calculations, which are all true but hopeless - yet I remain delighted to discover that the fight has not yet been conceded.
posted by Devonian at 7:44 AM on March 23, 2015 [2 favorites]


It blows my mind that memory storage of a bit is physically large enough to see with the naked eye.
posted by Monochrome at 7:53 AM on March 23, 2015 [3 favorites]


It's funny how this reads like a Story from the Long Long Ago, perhaps inscribed in scrimshaw by the light of a whale-oil lantern. The machine's only 50 years old, folks, there are plenty of people alive today who programmed like this all the time!

The modular card design of the 1401 is fascinating to me. It's like a Lego computer, you just snap it together out of blocks. Hmm, that gives me an idea for a game...

Also worth noting that "machine instruction" in this context is a little more like "library function" in the modern C world. With microcode (or the equivalent) taking place of the libc routines. Ie: instread of a strcpy function you have a machine instruction to copy a variable-length word to a new location in memory. A single machine instruction takes many, many cycles to complete; a variable number, at that. It's quite different from how CPUs are designed now in the post-RISC world, although some systems like IBM's System z are more like the old way.
posted by Nelson at 8:15 AM on March 23, 2015 [1 favorite]


leotrotsky: "...where do you even find paper and ink for the dot-matrix printer of a 50-year-old computer?"

The old fabric ribbons are pretty easy to re-condition. You could generally even get additional life out of them by spraying them with WD40 if you didn't have any ink to add. But even now you can buy "ink pad reinker" at pretty much any office supply store and, at least with the dot matrix cartridges we used back in the '80s, pretty easily re-ink a ribbon.

Green bar continuous paper is still a standard orderable item.

The output took me straight back to writing REXX to output Mandelbrot sets on the college's printer in the mid '80s.
posted by straw at 8:25 AM on March 23, 2015


This seems more complicated than connecting a Mac Plus to the web.
posted by fungible at 8:26 AM on March 23, 2015 [3 favorites]


The 1403 printer was not really a dot matrix in the sense that any configuration of dots was available. It had a character set (and the output of this program seemed to be made in 'X' characters for each pixel.)
posted by Obscure Reference at 9:00 AM on March 23, 2015


Here's a little more about the SMS card system on the same site, including a database of card types. One can certainly see HAL-9000's lineage in the removable racks.
posted by RobotVoodooPower at 9:01 AM on March 23, 2015 [1 favorite]


It's funny how this reads like a Story from the Long Long Ago, perhaps inscribed in scrimshaw by the light of a whale-oil lantern. The machine's only 50 years old, folks, there are plenty of people alive today who programmed like this all the time!

Yeah, I learned to code from people who programmed like this all the time. It turned out to be incredibly valuable to learn from people who had to code on machines with different word lengths. You learn things about calculations that can't be computed in binary, and when this is different from mere errors of precision. I remember at work a while ago, people were getting two wildly different answers to a calculation. Even the math PhDs were stumped. I worked the problem for a while and discovered that some of the people were using calculators with 12 digits of precision, while others were using calculators with 16 digits. Everyone was astonished, most of all me. I don't even remember how I knew this stuff.
posted by charlie don't surf at 9:45 AM on March 23, 2015 [3 favorites]




Oh, amazing. I didn't realize that the CHM had restored both of their 1401s to good working order. I remember there was a point when they were having serious doubts about both of the machines. It's really cool to see that both of them have been restored.

The efforts that the museum volunteers went through to restore the machine are nothing short of heroic. Their website is very much worth checking out. The "Connecticut" 1401 was in use by an actual business until 1995.
posted by schmod at 10:21 AM on March 23, 2015 [1 favorite]


... stories of people paying a lot for an upgrade to a system just to have an IBM tech come in and flip a switch. It's an old computer business practice, not a new one.
IBM calls this "capacity on demand" and still does it. IBM has always been as much a financial engineering company as a computing company (and I suspect the rest of the industry is headed that way too).
posted by Poldo at 10:22 AM on March 23, 2015 [2 favorites]


The modular card design of the 1401 is fascinating to me. It's like a Lego computer, you just snap it together out of blocks.

The transistors and other components were mounted on circuit boards about the size of a playing card. These boards were called Standard Modular System (SMS) boards and each one provided a function such as a flip flop or simple logic functions

This helps us understand what 2001's HAL is saying as he dies. "My mind is going..."
posted by justsomebodythatyouusedtoknow at 10:24 AM on March 23, 2015 [2 favorites]


To be fair, people who were accustomed to doing mental arithmetic with shillings and pence did have a point. 240 has way more factors than 100. You could divide a pound into thirds, sixths and eighths cleanly. After decimalization, you couldn't.

And this is one reason why I still defend the Imperial system over metric.
posted by dame at 10:37 AM on March 23, 2015


Addition was done by table lookup (which isn't mentioned). I've used the IBM 1620. You needed to load tables on punch cards or you couldn't use the add instruction.

Nope. The 1620 -- the CADET*-- was deliberately designed as an ultra "low cost" model, in fact, it was the very first IBM computer to rent for less than its model number. The 1400 series used hardware BCD add/multiply, as most IBM systems of the era did, and would use special purpose hardware if needed, like this particular model had for handling £/S/d currency math.

This isn't to mock the 1620, it was an important model in the history of IBM machines, but it wasn't the norm not having hardware adders, it was the outlier.



* CADET: Can't Add, Doesn't Even Try. The reason was a design decision to move as many possible functions from hardware to software, thus reducing the hardware needed, thus keeping the cost down.
posted by eriko at 11:01 AM on March 23, 2015 [1 favorite]


See also: RISC.
posted by schmod at 11:04 AM on March 23, 2015 [1 favorite]


With that hurdle cleared, I expect an Angry Birds port to quickly follow.

You just know some minecraft fan will build a working IBM 1401 in it, and then port Angry Birds to the Minecraft IBM 1401.
posted by drezdn at 11:27 AM on March 23, 2015 [4 favorites]


This was fascinating; literally nothing in this is not interesting:
  • The hardware BCD arithmetic, so much harder to implement than binary. T
  • The decimal addressing!
  • The Sterling hardware, with two different standards for representation, plus the mixed-mode representations (BSI PENCE/IBM SHILL).
  • The huge arrays of SMS cards, and how little was implemented on each: a few gates! (That surely makes the interconnections between them the bigger, and more critical, element of the overall design.)
  • The incredibly complex instructions, at variable length. (I wonder what this means for cycle count per instruction: scaling with length?)
  • The punch-cards containing their own loader code alongside the data. (Presumably the LOAD button bootstraps load of the first card?)
posted by We had a deal, Kyle at 11:33 AM on March 23, 2015


It's funny how technology evolves to seem simpler while in actuality becoming far more complex. You look at those pictures of the 1401 and it's got all this stuff — intricate wiring stuffed inside cases with custom designed hives that fold out to allow access for a technician who must have carefully studied a huge pile of documentation to know how everything is wired together and how to rewire when replacing a component or adding a feature. And then you look at something like a Raspberry Pi model A+. It costs $20, is smaller than a credit card, and is essentially a single chip, with a handful of discrete parts thrown in, and very little wiring; the PCB traces seem like the kind of thing you could actually sit down and look at without requiring a giant reference tome. And yet in every way this Raspberry Pi far outclasses everything about the 1401, both in terms of performance and complexity. There's far more going on, it's just that it's all hidden away rather than being visible as giant bundles of wire.

And the same thing broadly applies at the software level. You can run Python on that Raspberry Pi and write incredibly powerful programs in just a few simple lines of code that almost resemble English. You can teach it to a small child. Hardware wise you just plug in a keyboard and a display and that's that. You don't have to learn about punch cards that self-bootstrap themselves, or console switches, or how each machine instruction is encoded, and so on. But that's only because there exist abstraction layers sitting between you and those details, it's not because they no longer exist. Complexity is an illusion, as the modern system is almost unfathomably more complex.

I suppose in a way that's a demonstrable win for engineering. Modern systems are useful because of those layers and layers of abstractions, not in spite of them. Inventing creative ways to hide complexity is the only way that computers could evolve to the point where they are now. If their complexity was splayed out in full glory for all to see the way it was for the 1401, nobody would be able to get anything done, because you'd have to study a six foot high stack of manuals like a monk for years before being able to do anything useful.
posted by Rhomboid at 12:25 PM on March 23, 2015 [7 favorites]


The 1403 was a line printer that was driven from a horizontally traveling chain, which had each character in the character set on it individually and actual-sized. Synchronized hammers hit the chain when it was in the right place to print the desired letter.

Fan-fold green-bar sprocket-feed paper is still readily available.

There's nothing quite like generating your own line printer art and having it go wrong at 600 lines a minute. The printer can actually do form feeds, or page ejects, much faster than that.

Much, much, much faster.
posted by the Real Dan at 1:03 PM on March 23, 2015 [5 favorites]


Also, whoa, a 63-pass FORTRAN compiler [PDF]. (Is "a minimum of 8000 positions of core" 8000 6-bit bytes, or 8000 bits? Either way it's not much.)

PHASE 08 -- SQUOZE
posted by We had a deal, Kyle at 3:55 PM on March 23, 2015 [3 favorites]


Now - have it mine a bitcoin!
posted by symbioid at 6:33 PM on March 23, 2015 [2 favorites]


I am so jealous. Can anyone walk up to the 1401 and program it, or do you need to put in thousands of volunteer hours at the CHM first? This is one of the few reasons I'm sad that I don't live in Silicon Valley.
posted by monotreme at 11:23 PM on March 23, 2015


In case you need to remember how the AB8421 code matches up with the character set, you might tape a cheat-sheet on the top of the gate.
posted by MtDewd at 1:19 PM on March 25, 2015


I was out of town for a couple of weeks, without access to my 1401 Customer Engineering Manual of Instruction...

All arithmetic is done in base-10 / Addition was done by table lookup / The hardware BCD arithmetic, so much harder to implement than binary.
The arithmetic was actually done in 'qui-binary' and totally in hardware. There's a page in the Computer History Musem's site that talks about why. It looks like it had better error checking than binary.
Inputs came in BCD and were translated to qui-binary, run through the adder, and then put back in BCD, transparent to the operator or the programmer.

..."machine instruction" in this context is a little more like "library function" in the modern C world. With microcode (or the equivalent) taking place of the libc routines. .... A single machine instruction takes many, many cycles to complete; a variable number, at that. It's quite different from how CPUs are designed now in the post-RISC world
This describes 360's and 370's, but not the 1401. There is no microcode in the 1401, it's all in hardware circuitry. Even multiplying- which was an optional feature- was done with some additional registers. (See p.42ff)
(But it still does take many cycles)

(I wonder what this means for cycle count per instruction: scaling with length?)
This does take some figuring out. Of course it depends on the length of the operands, and also the length of the instruction. It looks to me like a regular true add instruction Aaaabbb first requires 7 I-cycles (which are not overlapped with the E-cycles), then 1 A-cycle for each character in the A-reg, 1 B-cycle for each character in the B-reg, plus 3 more E-cycles.
Example adding a 2 digit number to a 4 digit number would take 16 cycles, or 184ms.

The "Connecticut" 1401 was in use by an actual business until 1995.
This was mentioned in my previous post from 2009, which also has links for 1401 emulators, if you want to try this at home.
posted by MtDewd at 7:51 AM on April 14, 2015 [2 favorites]


« Older "Badgers? We don't need no stinking badgers!"   |   STREETWISE, a riveting 1984 doc that follows... Newer »


This thread has been archived and is closed to new comments