This project elegantly bridges the gap between mid-century hardware constraints and modern mathematical complexity through sheer algorithmic discipline. It serves as a humbling reminder that true programming mastery lies in logic rather than raw processing power.
深掘り
前提条件
- データがありません。
次のステップ
- データがありません。
深掘り
How Do You Program a Computer From the 1960s?追加:
This is an LGP21, a fully transistorized computer from 1963. And this exact machine started life at the Los Alamos Scientific Laboratories in New Mexico, where it worked on a lot of very cool projects, including the UHTRE X or the ultra high temperature reactor experiment, as well as the molten sodium plutonium loop experiment. How do we know it worked on those? Well, in the previous episodes, we uh managed to pull all of the data off of the rotating disc memory in this machine. Now, that sounds like we did some hard drive recovery.
And while it does look like a hard drive, it's actually the working memory for the computer. Long-term storage is done via paper tape. And speaking of that paper tape, we have a beautiful tally paper tape reader on here that also appears to be fully working because we were able to load up a Fibonacci sequence program and get it fully properly executing. And it printed out in LGP's version of hexadimal which uses FG, J, K, Q, and W as opposed to ABCD and E and F. But it worked perfectly.
So, what I want to do today is run more software on this thing. Notably, I want to run some fractals because anything that doesn't require interaction is a fantastic demo program for an event like VCF Southwest, which is coming up in oh jeez, like only two weeks from now. Uh, but this machine is going to be at the event on display fully up and running.
And if you want to get handson with quite possibly the oldest running computer in Texas, please come join us at VCF Southwest. I think it's going to be an absolute blast. So, what are fractalss and why do I want to run those as demo programs on the LGP21? Well, it's not super easy to define, but essentially they're geometric patterns that feature a high level of mathematical recursion. You either get the same pattern repeating all the way down to infinity or in some fractals you get really cool evolutions of the pattern that creates really wild looking things as you zoom in further and further. And I think punching these out on the typewriter for the LGB2 will look absolutely stellar and it'll create a cool souvenir that I can hand out to people at the event. And a good example of a fractal that's pretty easy to understand is the Serpinsky triangle.
You essentially take an equilateral triangle and then you go to the halfway point between any two points on that triangle and you draw another triangle that's upside down in it. This divides that first equilateral triangle into three smaller equilateral triangles that are facing in the same direction. Then you do the same thing again. You go halfway between draw another inverted equilateral triangle and this repeats forever. This is called a self similar set. Now, computers, even if they're very old computers, are really good at math. And because fractal patterns are inherently mathematical, mathematically ma math math math-based math-based are inherently math-based. We can write a piece of software to punch out the Serpinsky triangle on a piece of paper.
And uh it's actually already been written. I've got it on a little piece of tape right here. All we have to do is put it in the tape reader, load it in, and we should get a pretty cool Serpinsky pattern on the typewriter. Our tape loader bootstrap should already be in memory, so we just got to do a uh U3 S0.
Uh that should load that up there. We'll do a fill clear to move that up. Um and then we can uh zero out the accumulator there. Then we move down to a one op execute. That loads our program counter up here. We move down to normal. We hit start and the tape reader should start GOING fully read in. Gave me a carriage return and it's starting to print out the Serpinsky triangle. That is awesome.
and there we go. Pretty beautiful looking Sir Pinsky triangle printed out using triangles actually on the Freeden Flexer writer here. If you put it into uppercase, the uh numbers now have symbols on them that you can print out.
And one of those symbols is a little triangle. And I think this looks really cool to have a Serpinsky triangle made of triangles. This is going to be a ton of fun handing these out at the event.
Uh now, while a Serpinsky triangle is pretty easy to grasp from like a conceptual standpoint, actually writing code to create one of these is pretty difficult. But we're doing this in hard mode because we're writing code for it on an LGP21.
Even though the LGP21 uses a 31bit word, an instruction is only composed of 17 bits. You have 12 bits for your operand address. That's going to be six bits for the track, six bits for the sector. And then you have four bits for what they're calling the command. This is your instruction. And then you have a sign bit. But if you only have four bits for your instruction, that means that you can only have 16 instructions total.
Well, this is where that sign bit comes into play. They're using that to modify some of the instructions to give you a total of 23 instructions. Now, 16 or 23, we're still talking about an incredibly small amount of instructions. So small, in fact, that I can actually run through all of them with you right here, right now, cuz they're pretty simple. Uh the first instruction that we're going to take a look at is add. you just add the uh contents of the accumulator to the memory that's at the address specified in your instruction and you store the result in the accumulator. The next one is divide. We're just dividing the number in the accumulator by the uh value that's in memory specified by the operand address. Then we store the result in the accumulator. Next, we have two multiply instructions. This is where it gets a little tricky because if you multiply a 30-bit number by a 30-bit number, you end up with a very large number that's bigger than 30 bits. And so our two multiply instructions do essentially the same thing. They multiply the contents of the accumulator with the value specified by the operand address that's in memory. And then depending on whether you're doing an M multiply operation or an N multiply operation, you store the least significant 31 bits in the accumulator or the most significant 30 bits into the accumulator. Now, there is an extra accumulator specifically for use with multiply called the extended accumulator. This one is essentially two words long that is specifically for this operation, but it's not available to the programmer. It's used pretty much just exclusively behind the scenes by the CPU. And then our last arithmetic operation is the subtract operation.
It's just the accumulator minus the contents of memory as specified by the operand address. After that, we get into logical instructions. And here's where the naming gets a little strange. E stands for extract. This is just a a bitwise and. You're justing the contents of memory as specified by the memory address with the contents of the accumulator and storing the result in the accumulator. Now, they have uh quite a few more instructions here that they're listing as logical instructions, but they're really more like program flow instructions. Uh the first one is what they call a conditional transfer.
This essentially sets the program counter to the address specified in the instruction if the sign bit in the accumulator is one, indicating that the accumulator has gone negative. This is kind of your only conditional. You can't check if the accumulator is zero. you have to check if the accumulator has rolled past zero into negative territory. Uh now after that we have a transfer control and this is an interesting one because you'll see it has a little minus sign next to the t.
This is our first instruction that sets the sign bit in the instruction register to uh modify the existing instruction.
And this one is essentially the same, but it also checks if the TC switch on the control panel of the CPU has been set. After that, we have an unconditional transfer. This is just a straight jump, a go-to. This is the one that I use whenever I tell the uh computer to go to the first word of the bootstrap. After that, we have a stop instruction. And this thing can actually do two things. If you set your operand to uh 0000 0 or 0 1 0 0, this actually halts the computer and the stoplight should come on. But if the operand is 020 0 or 030 0, this now becomes a no operation or a knop. Now after this, we have a since BS and transfer. Uh, and I can already hear the uh, comment section snickering about the sense BS here, but this is detecting the collection of switches on the front panel that are labeled BS. So, you can have certain ones set and then you jump to a specific place. Now, if the sign bit in the instruction is set, this now becomes a since overflow and transfer instruction.
Essentially, if the accumulator has overflowed, it sets the bit in the program counter. Uh, and if that's been set, it then transfers to whatever the memory address is that you've specified in the operand of the instruction. Now, we get into what they call manipulative instructions. Again, I can hear the snickering because this sounds hilarious.
Uh, but the first one is bring. Dead simple. You're taking the value specified by the operand in memory and copying it into the accumulator. After that, you have a clear. This takes the value in the accumulator and places it into memory at the address specified and then clears the accumulator. So it's not just a clear, it's a store and then clear. And then the next instruction is hold. This is essentially the same as clear only it doesn't clear the accumulator. It just takes the value that's in the accumulator and copies it into memory while preserving the accumulator as it was. Uh now next we're going to take a look at set return address. uh this takes the value of the program counter plus one and stores it in memory. So that way you can jump to a sub routine and know where to return back to. And then we have store address which takes the bits that are in the operand address location of the accumulator and stores them into memory.
Now we are getting into some pretty interesting IO operations. uh pretty much any kind of IO has to deal with shifting bits into the accumulator either four or six bits at a time. And the instruction that we have for that is they're shorthanding it to an I. You can only shift four or six bits at a time.
You can't do a one or a two bit shift.
Has to be four or six. And you can only shift left. You can't shift to the right. However, when you are shifting to the left, you're actually pulling something in from the right and you decide what you're going to pull in by setting the device code. If you set the device code to 6200, that is a special device that doesn't exist. So, you pull zeros in from the right. However, if you specify the correct device code for the flexoriter or the tally tape reader, you can pull in bits from those devices and fill the accumulator that way. But that's just input. If we want to output, which we have to do, we got to print something out on the flexor writer. They have a separate instruction for that called P, which stands for print. Now, what's important to note here is that this is not a shift. It just takes the leftmost six bits or four bits and sends those parallel out to the device. And that is it. That is the entire instruction set. I realize that uh I probably spent I don't know eight minutes talking about this, but the fact that I could explain the entire instruction set to you in under 10 minutes tells you how uh I was going to say simple, but I think limited is the more correct term for this computer.
With such a limited instruction set, it's pretty impressive that we can do something like the Serpinsky triangle or something even more complex like a mandelro.
Calling it the Mandler set is actually totally wrong because this particular fractal is named after Polishborn French American mathematician Benois Mandela. I I think I don't know. It's a very French name. And uh I I practiced that like 10 times before turning the camera on and I'm sure I still completely butchered the pronunciation of it. Uh I the reason I keep calling it mandler is because I learned of this fractal long before I ever decided to learn a second language.
And once I did decide to learn a second language, the language I chose to learn was Japanese and not French. So the like the neural pathways have already been made. It's very hard to break those once they've been made. So just roll with me here. When I say mandler, I mean mandelro or however it's properly pronounced in French. Now this uh particular fractal is really really fascinating because it's not a similar set. If you zoom in, you get all sorts of really different unique patterns, but eventually it does repeat and there are interesting repetitions of the total set within the set. uh it has a very clear mathematical definition which is uh zed = z^2 + c seems super simple but um I think as you iterate that across many iterations you get this really beautiful design and it is hyper mesmerizing because the mathematics are pretty well defined we can actually write code to calculate the mander set and print it out on the flexor writer well when I say we I mean Not I I mean somebody much much smarter than me. Bill, thank you so much for uh joining me again today.
>> Hey, no problem.
>> For anyone that doesn't remember Bill, he's the legend that programmed Doom for the Bendix G15, but you're not here today to program Doom. I'm uh I'm chatting with you because you've done some pretty cool stuff with fractals on the LGB21 recently. So the mantle brought set is a fractal that you generate through repeated multiplication and addition of complex numbers. All of the normal math operations like addition and multiplication work on complex numbers but some of them have slightly surprising results and the mandler set is a great example of the sometimes surprising results you get with complex numbers. For each point on the complex plane, we do a iterative process where we start with the number zero. We square that and then we add the coordinates of the point we're looking at. Then we iterate again. Whatever result we got, we square it and we add that point. In normal numbers, if you do that process, they just keep getting bigger and bigger and bigger. With complex numbers though, they don't always get bigger. And what the mandler set is that bulbous shape in the center. Those are the points where if we do that complex squaring and addition over and over and over again they never get big. They tend to hang around pretty close to zero.
>> Uh okay. So ever the problem with programming the the mathematical concepts are moderately understandable. Um, but how do you translate that into 23 instructions on a computer from 63 years ago?
>> The instruction set on the LGB21 is pretty simple, but it's got everything you need. And mostly all I used was the addition, subtraction, multiplication, and conditional jump. The outermost loop of the Mandelro program is really just two nested for loops for each real valued row. for each imaginary valued column perform this. And then for each one of those characters, we need to determine what we're going to print out.
That's a loop that performs that iterated multiplication and addition over and over and over again until either the value gets large enough that we decide we're outside of the mandler set and print a character or until we hit that limit of 32 iterations, decide that it's in the mandler set and print out a space.
>> I've got the tape loaded up. We just need to jump to the bootstrap loader which is uh 0000 U3 S 000.
We do a fill clear. Move that instruction up. We'll clear out the accumulator here to all zeros. Change over to one off. Hit an execute. Moves our instruction up to the program counter. Go down to normal. Hit start.
And it's going to read in our tape.
An hour and 10 minutes later and we have this beautiful little mandler printed out on our piece of paper here. You can clearly see the fractal in it. Now, Bill wrote this program to print the man out in three different resolutions, and it started with the very large resolution up here, but I quickly realized that was going to take like 4 hours to print out.
So, I halted the machine and jumped to the entry point for the medium-sized one. But even the medium-sized one still took an hour and 10 minutes. Bill also wrote a Mandlero program for the Bindix G15, the full vacuum tube computer from 1956. and running that program on that machine to print on a man roughly the same resolution as this one only takes about 15 to 20 minutes. But on the LGP21, it takes an hour and 10. This computer is like 8 years newer and fully transistorized. It should be way faster.
So what gives? The Bendix G15 had several they called them short lines of memory where the same values were available to you about 24 times per revolution. So you could access those pieces of memory almost any time you wanted. On the LGP, you always have to wait for the value to come all the way around. There's no short lines. I mentioned those first two for loops to go over each character we're going to print out. And then the innermost one iterates that math over and over and over again up to 32 times. And one of the most basic things it has to do is calculate x^2 + r. Step one is you load x from memory. And now you've got x in the accumulator. What value do you want to multiply it by? Well, for x^2 you're multiplying by x. Unfortunately, that X is the one piece of memory that's now right behind the readwrite head. So, you have to wait for the disc to spin all the way around before you can multiply by that value X. So, we've got a Serpinsky triangle and a Mandlerought fractal that we can print out as demo programs. And both of these, I think, are going to be absolutely awesome at the event. But, there is one more demo program that I want to try and run on this machine. And that is Conway's Game of Life. Conway's Game of Life is a cellular automat simulation proposed by mathematician John Conway in 1970.
It's a incredibly simple rule set that generates life. Essentially, the output looks like cellular life. It's really fascinating and it's one of my all-time favorite programs ever made. Now, to create Conway's Game of Life, it's really simple. Just imagine a 2D grid and the fate of any cell is decided by its eight neighbors. If a cell is currently alive and it has two or three neighbors that are also currently alive, then that cell survives on to the next generation. However, if that cell has less than two neighbors that are alive, that cell dies as if by underpopulation.
And conversely, if that cell has four or more neighbors that are alive, that cell dies as if by overpopulation.
Now, if a cell is currently dead and it has exactly three neighbors that are alive, that cell is born, creating new life. And that's it. With those rules alone, you create this beautifully complex simulation. And interestingly, Conway's game of life is also touring complete. It is in itself a computer. So if you simulate Conway's game of life on a computer, you're simulating a computer within a computer. Like this is it's so super cool. But in order to program Conway's game of life for something like the LGP21, we've got a massive problem that we got to learn how to overcome.
and that is that Conway's game of life is based on an XY grid. Essentially, we need to be able to draw the entire field and then move our cursor around and redraw over it. Not a problem if we have a CRT, but on a printing teletype, this is a huge essentially obstacle that we can't overcome. However, a cellular automaton doesn't have to be on an XY grid. John Milan proposed a version of life that is onedimensional.
The fate of the cell in question is decided by its neighbors to its left and its right. And so if that cell is alive and exactly two or exactly four of its neighbors are also alive, that cell lives on to the next generation.
Otherwise, that cell dies. However, if a cell is currently dead and it has exactly two or three neighbors, it is born again. And so in this way, you draw out a single line and that represents one generation. Then you move to the next generation and the next generation and the next generation and the next generation all the way down and you get this kind of record of all of the generations of life as they move around in chaos, generating beautiful patterns.
And that's the type of life that I want to run on the LGP21. But uh like the Mandel brought, I am nowhere near smart enough to program that for the LGP21. So I'm going to need a little bit of help.
All right, Reese, thank you so much for joining me. It's good to have you from the other side of the planet.
>> Thanks, David. Thanks for having me.
>> Thank Well, thank you for uh all the help with the LGP21. I mean, it's it's been massive. You've been writing all sorts of test programs and routines that have really helped us get as far as we have. So like why but why the LGBT 21? I have a ton of other projects but you seem really like really emotionally invested in this one.
>> Uh I really like the computer but uh there's a sort of an Australian connection. Uh I was there's a Australia's first transistorized computer was a thing called snowcom. It was made around about 1960 and it was used by the snowy mountains hydroelectric scheme in Australia which is a huge nation building project in the late 50s early 60s and it was based on the LGP30. The uh designer of that computer David Wong came across a conference paper on the design of the machine and he basically pirated and then made his own version. So Snowcom has same instruction set but a different IO and memory system. And so because of that Australian connection I was very interested in in this project. I hammered out a one-dimensional Conways game of life the other night in basic and it was moderately easy, but that's because it was basic. I got a feeling that when I said, "Hey, I would love to have one-dimensional Conway's game of life on the LGBT 21." That it was something that was far easier said than done, right?
>> Yeah, absolutely. I first of all, because there's no tools, I first of all had to build an assembler to allow me to write the program and an emulator to run it to test it. And then there's the the issue that Conway's game of life tends to work with arrays. LGB21 is terrible at arrays. It only has absolute load and store instructions. That's all it has.
And so to be able to do an array access, you have to first construct the address, store it into an instruction with selfmodifying code to do the load or the store, and then do the instruction. And so every time around the loop, I'm modifying half the code to change all the load and store instructions. Another thing uh that the machine is bad at is comparisons. You you can check to see if something is negative, but you can't say is it exactly something. So if I want to check does this have two or three cells as neighbors, I have to subtract two, see if it went negative, subtract another two, see if it went negative. In the first version, I was using the sign bit of uh the word in Parel to indicate that it was alive or dead. Because, as I said, it's easy to check if something's negative. And so, I had this whole bunch of code that was going if this one is negative, jump over here and add one to the count. Otherwise, check the next one is negative. And that was like 50 or 60 instructions just to count the neighbors. I then rearranged that. And what I did is I actually put a count in each of the words. That allowed me to do my selfm modifying code to set all the addresses and then do load the first add add and so it reduced down to more like 15 instructions instead of 50. doing mathematics on this thing is so weird because uh so you can't use the low bit and so everything has to be shifted by two at least and it's very efficient to shift by four or six bits when you're doing things but you can't shift by three bits and so it's and you can't shift right so everything you do on this you basically everything's shifted over a couple of bits or shifted down a couple of bits from where you would like to do it so you can't add one and one to get two you have to add two and two to get four and just pretend that it's two by just keeping the bit count in your head. Just like before, I've got my entry point punched into the accumulator. So, I'll do a fill clear to move that up. We'll clear out the accumulator to all zeros.
And then I'll come down to one operation, hit execute to copy that up into the uh program counter up there, then normal and start. And it should start reading in the 1D life program.
And away we go. The first generation here is just kind of a randomized uh generation. And we can see it printing out stars for each cell that is alive.
This is really cool.
and there we go. 25 generations of John Millan's 1D Conway's game of life.
That's a mouthful there. But we can see some really fascinating stuff here because it starts off as pretty wild chaos and then after about five generations we start to see some order emerge and then after about five more generations there's a large chunk that just dies out completely and the remaining bits fall into what's called a stable life. Now uh ignore the extremely light printout here. The uh ribbon in this thing is falling apart. Um, it's the ribbon that was in the typewriter when I got it. So, who knows how many decades old it really is, but also I think the platin on this thing is probably a bit hard. And so, when the hammers are hitting, they're hitting so hard they're actually tearing the ribbon. I have a new ribbon on the way that I'll get installed into it. And, uh, I think after VCF Southwest, when we send the power roller in this thing out to get redone, I'll send the platin out as well. So, they both come back nice and soft and rubbery. Uh, but for the event, this is awesome because every time we run it, it's a brand new random seed up top. So, how that evolves and turns into stuff down here is going to be wildly different, which means every one of these pages that I hand out is going to be completely unique. This is really cool. I love one-dimensional life. But also, I love the Mandelro. I love the Serpinsky triangle. And we have one more that we've been working on that I think is going to be really cool at the event. But the LGB21 is performing admirably. The Flexo Rider still needs a little bit of help, but I think this thing is going to be a hit at the event.
So, if you can make it out to VCF Southwest next weekend, I hope to see you there. I think it's going to be an absolute blast. But I want to thank all of you for hanging out with me today and I hope to see you in the next one.
関連おすすめ
Agentforce NOW AMA: Build with React and Salesforce Multi-Framework
SalesforceDevs
490 views•2026-05-28
How agent o11y differs from traditional o11y — Phil Hetzel, Braintrust
aiDotEngineer
450 views•2026-05-28
Re: 🗣️📍theprophedu📍2026 GST 103 CLASS (E-EXAM REVISION)
theprophedu
636 views•2026-06-04
WEB TECHNOLOGIES UNIT-2 | Degree 4th sem BCOM Computers web technologies unit-2 full explanation💯✅
LearnwithSahera
1K views•2026-05-29
More tests are always better? How to use AI to identify tests that bring little value
Alliance4Qualification
335 views•2026-05-29
Search Algorithms Explained in 60 Seconds! 🤖💨
samarthtuliofficial
218 views•2026-06-01
People of Game of Thrones using JavaScript DOM
AltCampus
296 views•2026-05-30
Instagram accounts got PWNed
EricParker
13K views•2026-06-03











