I started this blog as a way of documenting something crazy I’ve just started doing in my spare time. Perhaps my wife will see it and it might help her understand what’s going on. Perhaps it will help someone else out there who is having similar thoughts about doing crazy things like this. So what’s it all about? To find out, you’ll have to wait a while while I explain to myself why I’m doing this.
I’ve been interested in computers for most of my life. I mean, I’m 54 right now and I’ve been interested in them since I was about 9. Wait, what? That means I was interested in computers as early as 1970. Yep, that’s right. When I was 9 or 10, I got a book from somewhere (did someone give me it?) called Teach Yourself Computer Programming. It was yellow and black like all books in the Teach Yourself series were. I still remember lying in bed reading it and not understanding what in blazes it was about. The book was basically an introduction to the FORTRAN programming language, pretty heavy stuff for a kid of that age. Back in 1970 the only computers I’d seen were the massive boxes with panels of flashing lights and tape reels that one would see in Lost In Space and The Time Tunnel. I couldn’t relate the text in the book to any of that. But something hooked me. The one part of the book I understood was the flowcharts; the diagrams with diamonds and squares that give step-by-step instructions for doing something. Is the fish cooked yet? Yes: Eat it. No: Go back and wait. Is the fish cooked yet…?
Fast forward to the mid to late 70s. I was an avid reader of the UK electronics magazine Practical Electronics and used to build some of the simpler circuits I found there. I had become interested in electronics at the age of 12 when my parents had bought me an electronics kits, the educational kind with a board you could put components on and make a flashing light or a beeper. In the mid to late 70s, Practical Electronics started publishing projects that used these annoying little things called integrated circuits. They were annoying because they were new and I have always hated change. I was used to transistors and resistors, and now they wanted me to learn how to use these silly little black plastic things with 14 little legs that all looked the same and didn’t seem to have any well-defined purpose. I resisted for a while and eventually decided to buy a few of these things and see what all the fuss was about. I remember the first chips I played with were the 74 series TTL chips, 7400, 7404 and 7490. Using those you could make a counter with an LED digit display that counted up to 9. With more, you could make a digital clock. Suddenly I understood why this change was happening. These things were powerful. (I recently found out that these chips were actually invented in the early 60s. I’m not sure how I managed to miss or ignore them until the late 70s but I think my magazine was partly to blame.)
Around 1977 or 1978, another magazine whose name I forget started publishing a project about building your own computer. I jumped right in and started reading with glee — only to find that I couldn’t make head nor tail of it. “Read? Write? Bit? Byte? RAM? ROM? Bus?” I would mutter to myself in anger. What is this stuff? Hell, forget it!
Around the same time, at school, the maths teacher introduced us to computers by letting us use a teletype which was connected to a university computer through a modem. I got my first real taste of programming in BASIC. I was terrible at it but once a week or so the teacher let me stay after school for an hour and practice. This experience really got the juices flowing. I wanted one of these things at home!
In the summer of 1979, I saw an advert for a home computer kit which was about £40 and looked like a big calculator that had been taken out of its case. It was called the Science Of Cambridge MK14 and it changed my life. It only had 256 bytes of memory and no BASIC, with a simple digit display and a machine code ‘monitor’. Learning to program it was a huge challenge with only the manual to go on and no one to ask for help. I remember being completely unable to understand why they would tell you to type in ‘-1’ as ‘FF’. I’m sure anyone reading this who does not understand computers very deeply would also ask ‘why FF?’ and I can answer that now, but I couldn’t understand it back then and had no one to ask. “Mum, why is -1 typed as FF?” Yeah, right.
I can barely understand how anyone did anything before we had the Internet. To unravel this FF thing and other mysteries, I went up to Foyle’s in London and scoured the shelves for books about computers. I managed to find two books that looked promising. One was called The Architecture of Small Computer Systems and the other was Small Computer Systems Handbook. I learned the meaning of all those mysterious bits and bytes, why -1 is FF and a whole lot more from those books. I was hooked and I wanted more.
Shortly after building the MK14, I got my first proper job which happened to be in a computer room at an insurance company. The computers they had were huge and absolutely fascinating machines, full of flashing lights and with tape reels just like on TV. Although a few of the people I had to work with were abusive arseholes, I still enjoyed working on those machines and miss them bitterly even today.
So where was I at home? Yes, I remember drooling over a picture of an Apple II in bed one night in 1980 or so (other young men were probably drooling over Mayfair, but hey). I couldn’t justify buying the Apple but I found something else — an Ohio Scientific Superboard II. This was a ‘proper’ computer with a real keyboard and the BASIC language built in. I had to have one! I ordered it and waited weeks for it to arrive. When it arrived, there was no power supply, so I had to order a power supply for it and wait a few more weeks. Every day I got up and typed on the keyboard FOR I=1 TO 10 : PRINT I : NEXT. What a sad nerd! But the power supply never showed up — or something — I don’t really remember now but I had to go out and find a surplus electronics shop and buy a 5 volt power supply so I could use my computer. I powered it up and the display was all garbled. I opened up the (very simple plastic) case and found that they had soldered a small board with extra chips over the top of the circuit board. I had read in the magazines that this was routinely done to convert the US video circuitry to work on British TVs. I had no test equipment and no way to know what was wrong, and the bastards had sanded the chip designations off so I didn’t even know what chips they were. In desperation I simply cut the board off — and the display started working normally! It was an unbelievable piece of luck. This ‘convert US to UK’ stuff didn’t work and wasn’t even needed. The thing worked just fine on my portable black and white TV. With that, my life changed again. I learned 6502 machine code to the point where I could (and still can) write the machine code straight out on paper without an assembler (didn’t have one of those). I’m sure I’m not the only one who has 6502 machine code stuck in their head. Even Robocop (or was it Terminator?) had that.
Time to fast forward or I’ll never get through this. Atari 400, Atari 800 XL, Atari ST, Amiga 500, and finally a PC at home, mainframes and minis at work… and then a job actually writing games on Amiga and later Nintendo consoles. Assembler, C, C++… I was snowed under by computer programming for the whole of the 80s and most of the 90s. My electronics hobby was left in the dust and I didn’t really do any electronics again until 1993 when I made a radio-controlled digital clock from a Maplin radio and my own decoder / display design. After that, electronics was left behind again until 2005 when I built an analogue modular synth. Programming really took over my whole life. I lost my first wife because of my coding obsession and really only stopped programming in my spare time once I got the day job I have now. I love my job but it’s sometimes so gruelling that I don’t want to even see any code in my spare time 😎
Bear with me, I’m almost done. I have this recurring dream. Every now and then I have a dream that I’m looking at an old computer of some kind, something with lights, a small screen, and printouts with listings of some kind of unknown assembler code. In the dream, I know that this computer is something amazing, something that I was somehow responsible for creating. I certainly wrote the code, and I even know what it does. It’s code for a CPU I’m not familiar with but I know I wrote it somehow. When I wake up, I’m always left with a sense of loss because the thing was so real and now it’s gone and I can’t remember the details. During the dream I relive that early fascination I had with using a computer that I had soldered together myself from a pile of little plastic chips.
Every now and then I get the itch to ‘surf old computers’ and start reading about the old ICL and DEC computers that I used to work with. I tend to listen to Music For Airports while doing this because for some unknown reason that music evokes in me the feeling of ‘old computers in a clean room’. One day, about 18 months ago, I found a web page written by a guy who had designed and built his own computer with a custom-designed CPU. This
nutter genius had actually constructed a working CPU at home, from 74 series TTL chips. I found that he was not alone; there are quite a few people out there who have done this. I remember looking at this work and thinking I could never, ever, do that. So I went back to my normal life and occasionally I would surf old computers and listen to Music For Airports.
Then, about 6 weeks ago, I had been up late ‘surfing old computers’ again, and the next morning I woke up with an idea in my head. I wanted to see if it was possible to design a CPU instruction set that would have only 8-bit-wide instructions. That was when I started typing up a document called Design for CPU with 8-bit opcodes (which is incorrectly named as an 8-bit opcode is not the same thing as an 8-bit instruction). I soon found that I was designing an abomination which was a cross between a 6502 and a Z80 and was most likely impossible to actually build. I decided it was not possible to design a useful instruction set with only 8-bits to play with in a single instruction, not unless you are doing it just for fun or to learn about the concepts. So I abandoned that idea and decided to have a go at designing a 16-bit instruction set for no reason other than the intellectual challenge.
Shortly after I started on that, I found this lovely little logic simulation program called Logisim. I started playing with it and thought I would try to just make a couple of registers that could move an 8-bit value between them. I figured out how to do it pretty quickly and then decided to see if I could make an actual ALU. By the end of the day that I installed Logisim, I had made a simulation of an electronic circuit that could add or subtract two numbers. I didn’t know I had it in me to do that; it wasn’t even terribly hard. It was fascinating and I got rather excited by having done this. I just had to take the next step and see if I could make the circuit do something with the ALU automatically. Over the next few days I started developing a simulation that was turning into a real (albeit simple) CPU. I showed it to my boss over Skype and he said “You should build it out of transistors (lol)!”. Of course, I told him “That would be very hard. Even making it out of logic chips would be too hard for me.”
Then came a trip to Yosemite that my wife had planned and I found myself in a car with four other people and a lot of time to think on the journey. So I thought about my CPU design. I had my laptop with Logisim installed on it and during the coming days, I worked the instruction set out in my head while I was supposed to be ‘looking at rocks and trees’, and in the evening tested it out on Logisim while everyone else played with their phones or slept. By the time we got back from the trip, I had a simulation of a working CPU. I could hardly believe it. In order to test it properly I had to type instructions into it as 16-bit codes. I couldn’t handle it without making mistakes so I spent a few days writing an assembler for the instruction set and that made it easier to test programs by pasting the assembler output into Logisim’s ROM simulation. I found and fixed some problems and got jumps and branches working. Because of the way Logisim works, I found I had actually designed a whole computer with my own CPU as the centrepiece of it. I called the CPU LEO-1 and the computer LEO-1-HC. Since Leo is my wife’s nickname for me and everyone here calls me Leo, I thought that would be a good name for my CPU.
So I have a working CPU in an educational simulator. What can I do with that? Not much really. But I now know I have the ability to design a CPU from scratch at least in theory, so what’s to stop me seeing if I can make a prototype? A real prototype using those ‘silly little black plastic things’, the 74 series ICs.
This blog is a diary of my attempt to do something I didn’t think I was smart enough to do 18 months ago. If I fail, well, what the hell. At least I tried. I know there’s no real point in spending money on making something that looks and works like it’s from 1976. I know I’m going to come up against annoying problems that I can’t foresee, as Logisim is not designed to completely simulate real electronics in a way suitable for production. But I don’t care. This is probably the most interesting (technical) thing I’ve done since I built my MK14. That’s why I just ordered a PB-503 prototyping workstation 😉
Let’s see how far I get… 🙂