Generating The Mandelbrot Set With IBM Mainframes

[Ken Shirriff] is apparently very cool, and when he found out the Computer History Museum had a working IBM 1401 mainframe, he decided to write a program. Not just any program, mind you; one that would generate a Mandelbrot fractal on a line printer.

The IBM 1401 is an odd beast. Even though it’s a fully transistorized computer, these transistors are germanium. These transistors are stuffed onto tiny cards with resistors, caps, and diodes, than then stuck in a pull-out card cage that, in IBM parlance, is called a ‘gate’. The computer used decimal arithmetic, and things like ‘bytes’ wouldn’t be standard for 20 years after this computer was designed – 4,000 characters of memory are stored in a 6-bit binary coded decimal format.

To the modern eye, the 1401 appears to be a very odd machine, but thanks to the ROPE compiler, [Ken] was able to develop his code and run it before committing it to punched cards. An IBM 029 keypunch was used to send the code from a PC to cards with the help of some USB-controlled relays.

With the deck of cards properly sorted, the 1401 was powered up, the cards loaded, and the impressive ‘Load’ button pressed. After 12 minutes of a line printer hammering out characters one at a time, a Mandelbrot fractal appears from a line printer. Interestingly, the first image of the Mandelbrot set was printed off a line printer in 1978. The IBM 1401 was introduced nearly 20 years before that.

34 thoughts on “Generating The Mandelbrot Set With IBM Mainframes

  1. A minor point from an old timer – line printers were called that because they printed a line at a time, not character by character. The linked article actually says

    “and every few seconds the line printer hammers out another line of the fractal”

    For those too young to have met such a device, think of a parallel processing typewriter that hits all columns in a row simultaneously.

      1. Even more so it is why some unixes and unix-alikes have an error message telling you about the printer being on fire, e.g. Linux:

        “printk(KERN_INFO “lp%d on fire\n”, minor);”

        While modern printers are not likely to catch fire due to mishaps this was a potential problem in early high-speed printers; it was also thought that system operators would be more likely to attend to printer problems when being told the things were on fire.

    1. Arthur Chance, are you sure about ‘all columns simultaneously’? – One line at a time, yes, but all columns at one time… only in the special case when printing the chain’s or band’s sequence of characters, then yes… btw, the day of hour comment is my birthday and reminds me how old I am…

      1. Will we ever? all i see is people abandoning sciences, and even users of a system, being completely ignorant of how the machines work, with the rare decent students of those same systems that we as a society grown dependent being labeled geeks, nerds, like it was some sort of deficiency wanting to actually understand how stuff works. We currently live in denial, near complete automation is upon us and we are not yet prepared for a transition to a society where employment is obsolete and probably so little will be needed that it will be similar to today’s military draft, but who will keep those systems working when study, discipline and science is frown upon by most of the population?
        Idiocracy comes to mind… and get off my lawn

        1. Hmm. Strange how my impression is so radically different than yours. I grew up as an outcast geek, and I can’t help as I look around today to think how much better off geeks are now than before. It’s way more accepted… people ‘get’ how a lot of geek skills are useful now. Heck, most of what all my kid’s classmates are doing would be considered very geeky just 20 years ago. Even the jocks are online.

          Bullying is down, religion is down… you can learn anything you want online…

          Sure, there are painfully visible signs of idiocracy around… but how much of that just seems more common because the media world just brings way more of it to you?

          We may have a fair distance yet to go in a STEM sense, but my impression is we’re headed back in that general direction. It won’t necessarily be easy… and there are definitely a lot of people working hard to fight it in the name of their own ignorant biases… but generally to me the future looks bright.

          1. Bullying down? Are you serious? It’s more pervasive than ever before. Twenty years ago, you got bullied you were able to escape to a sanctuary. Your home, the library, a teachers class. Today, kids are wired together no thanks to crap like Facebook, and the bullying follows them “everywhere”.

            They aren’t learning the skills to just turn the damn thing off and the current school system isn’t helping. Homework assignments broadcast via SMS. Homework collaboration via Facebook (incrediably, some teachers are allowing kids to use FB during class).

            The bullying persists, it simply changed its appearance.

          2. I guess there’s a nesting limit on replies? I can’t directly reply to SavannahLion.

            When I was in school bullying consisted of way more physical violence than I ever hear about now. Schools looked the other way WAY more than I believe they do now. “Man up” was the general ADULT response to such things. Now, physical violence with actual evidence (bloody nose, bruises) is actually dealt with or(and?) the school gets sued. Adults are WAY less accepting of bullying as “just a fact of life”.

            I think an inability to escape means something way different now than it did. You HAD to go to school… even if that kid promised the entire school body he was going to beat you up there today.

            Maybe the social but “not so in” kid is moderately hurt more often now, but the real outcasts aren’t getting the crap beat out of them nearly as much and they probably don’t care as much about what others put on social media about them (at least relative to how much they care about not being assaulted).

            Maybe there are more victims now… but yes… the severity sure seems down to me.

        2. It is the difference between a driver and a mechanic. A driver can drive a car, the mechanic can too, but (s)he also knows how it works. As I took up my Computer Science degree, I was surprised by the number of classmates, even teachers, that didn’t care what happened in the processor (or hard drive, monitor, or ethernet), just the programming aspect. Knowing the “internals” may have actually been a handicap for me, but I prefer to know what’s under the hood.

          1. And musing further… now that CPU’s are running automobiles, even the mechanics are becoming “drivers” as they (most) don’t know what is happening inside the black box, but change it out when indicated by the manual. B^)

  2. The 1401 was the first machine I programmed. I still think the idea of working with that machine as fun. We used 1401s to go from card to tapes which were fed to 7080s. Then the IBM 360 arrived, a machine which awed most of us.

  3. Wow.
    Line printers…shudder. I remember cleaning the print trains and print bands of the printers at my 1st “real” job out of college. Then the joys of the anvil chorus that was the rotating drum printer attached to the Tandem NSII system. There’s reason a lot of us who started at the end of the punch card era are a little deaf

  4. I worked on 1401’s as an FE for IBM from 1967 – 1978. They were wonderful machines – they failed just often enough so one could get tons of experience troubleshooting. The entire schematic was always available to you down to the last transistor. What this meant was that a determined engineer could troubleshoot down to the individual transistor level, and in the process learn a great deal about digital design. The timing circuitry used with the line printers was a work of art, as also the weak signal data recovery from the early hydraulically activated disk drive access. Oh, and when a 729 tape drive kicked into high speed rewind at the end it sounded like a 747 revving up! What I learned then has allowed me to continue to have fun with PIC32’s and ARM’s today in my 70’s! If there are other geezers reading this, try to recall what the following instruction sequence would do: U%U1U.

      1. No, the 1401 predates the System 3 by 10 years and they are largely incompatible (different instrucitons, and completely different punched cards). However, later the System 3 was able to connect to the 1403 printer.

        1. I am not sure but I think the 1401 emerged in the late 60’s I recall Cable tags with 1959 markings, and also date markings in the Automated Logic Diagrams (ALD’s) – IBM-ese for schematics that may have had earlier time stamps.
          By the way the 1403 could print then at 600 Lines per minute, 132 print positions per line using a 48 character set.

          A few interesting 1403 facts that I’d deem fun for HackADay fans:
          You could programmatically generate what was called a “chain-break pattern” This would cause the printer chain to snap after a few minutes because of the intense loading produced by printing a specific pattern repeatedly. Nasty.

          The sound from the printer was not all noise – you could generate various popular musical notes by firing the hammers and also advancing the paper transport – this was a popular demo that way usually played to visiting stupid politicians (usually something jingoistic).

          The 1403 moved paper using a hydraulic motor with impressive acceleration times; a side effect of this was that leaking oil, combined with paper dust and loose high amperage fuse holders resulted in, you guessed right, occasional conflagrations. It was a pain to rebuild.

          1. @RAM Only saw one or two character chains. My calls were 1403 N1 with character trains. Never saw one that caught fire. Amazing machine and controller (2821). Separate core memory buffers that held train image and print data timed by index pulses from the train for hammer firing. Adjusting hydraulic drive by observing pencil trace during carriage skip. Punched paper tape for carriage control. And yeah, get off my lawn.

  5. Been interested in fractals a long time. Had an ancient computer back in school when one of my teachers put a fractal program on it. 2 days later we got to see the results. Running similar code today takes under a minute.

    After reading this article I took the inspiration and brought the book ‘chaos’ down off the shelf where its been sitting for a while. Really gives a good overview of fractals and where they came from, and why they were such a big discovery.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.