Before I begin, I want to make something clear: I am not a computer-science major. I'm not even a physics/math major. I'm a biology major (at least that's the plan right now), so I apologize if I use some terms incorrectly. I also realize that this has been done before, but I still think it's cool and thought I should share it.
First, a bit of introduction:
I recently found Ben Eater's YouTube channel, and I watched his series on building an 8-bit computer entirely on breadboards. In his videos, he explained how every part of the computer works really well, and started to think, "I could build that with redstone." My computer isn't really mine; it's me translating his breadboard computer to Minecraft, so I should really give most of the credit to Ben Eater.
As I tried building this thing, I found that there are certain advantages to building a computer in Minecraft, most notably the fact that redstone is perfect. It is always on or off. I don't have to deal with voltages, capacitance, inductance, etc. I don't even really know what inductance is, and I've never seen a capacitor in my life, and with redstone, I don't need to. I don't need to mess with the real-world issues of real-world physics and electronics. I do, however, have to deal with size. On a breadboard, you can cram quite a few wires right next to each other, but in Minecraft, you have to have a 1-block gap between every separate line of redstone. There's also the issue of signal strength. On a breadboard, you can run a wire from one end of the computer to the other without any issues. Signals travel across the entire device in an instant. With redstone, I can only go 15 blocks before I have to introduce a delay of 0.1 seconds, which means this computer is very, very slow.
Here's a snapshot of the whole computer:
The computer is made up of the bus (brown wool in the center), the memory unit (the big, tall, magenta mess in the back towards the right), the CPU (the multicoloured mess closest to the camera on the right side), the program counter and clock (close to the camera on the left), the ALU (which is obscured from this point of view), and various registers all throughout the machine.
Let's start with the bus:
The bus is essentially just 8 lines of brown wool with redstone. The top layer is for outputs going onto the bus, and the bottom layer is for inputs coming off of the bus (I did this so that I didn't have to mess around with making a bunch of 2-way repeaters). Every device interfaces with the bus like the light blue wool shows here (or similar). The white line is supposed to be for the clock.
Before I go any further, I should probably mention this:
This is the design I used for a 1-wide and semi-tileable D-Latch (or flip-flop, I forget what it's actually called). The clock comes in the white line up top, the light blue wool is for data input, and the blue wool is for outputs. There is an item in the dropper, and it only latches when the clock pulses.
The memory unit is quite big, but it can store up to 16 different 8-bit values.
Each value is stored in a different set of D-latches (the dark grey). The clock is the white line running up, the purple lines are the outputs, the lime lines are the inputs, and the light grey lines are the address pointing to the specific set of D-latches. The orange line is a control signal (more on that later) governing when the memory unit will give an output. The slime blocks are just there to get the outputs from the top of the machine down to the bottom.
The address is stored in an address register, which connects directly up to the light grey lines pictured above:
Next I suppose I should show the system clock and program counter.
The system clock really isn't that complex. It's just a hopper clock with a halt line (yellow).
The counter is pretty weird since it needed to also be able to accept an input. The blue lines close to the camera are the counter's output lines.
The computer also has several registers:
The A (right) and B (left) registers are meant to simply store numbers and do arithmetic operations on them. Only the A register can output a value onto the bus.
The output register stores an 8-bit value and displays it on some lamps.
The flags register stores the carry bit (is on if an arithmetic operation goes over the 8 available bits) and the zero bit (is on if an arithmetic operation results in a zero). This is necessary for the computer to be Turing Complete (I think).
The instruction register is meant to handle instructions. Only half of it can output onto the bus, and the other half goes into the CPU, which I'll talk about next.
The CPU is essentially just a bunch of AND gates. The pink lines are outputs from the instruction register, and each different colour underneath those lines are separate commands you could theoretically give to the computer. The two shorter black lines up front are the fetch cycle, which gets the instructions from memory. The two purple lines near the bottom of the image come from the flags register. They are used in the conditional jump commands and make the computer Turing complete (I think).
The commands work by activating certain control lines:
All of the control lines are here. There's a control line for just about everything: turning on inputs for any register, halting the clock, turning on outputs for the registers, and incrementing the program counter.
Some instructions have multiple steps, and I kept track of the step using Sethbling's binary counter (see below the next picture), and it just updates every clock pulse.
The computer also has an ALU (Arithmetic Logic Unit) that can both add and subtract two numbers.
It's just a bunch of chained adders. The last one outputs into the carry bit, which is one of the flags in the flags register. The ALU takes inputs from the A and B registers, and adds them (unless the subtract signal is on, in which case it subtracts them).
I think that's all the "hardware," so here's how I program the computer:
First I switch it into programming mode using the lever closer to the bottom of the image. I can then set the address I want to program using the other 4 levers.
I then need to fly around the machine,
to here so I can input the exact value I want into that location in memory. I can then fly back to the previous picture and press the button to commit that change. Programs start at memory location 0000 and count up (with the program counter).
I think that's it, so thanks for making to the end of my long (and probably arduous) post. I'll try to answer any questions people have in the replies for this post. Once again, this is really just my building Ben Eater's breadboard computer in Minecraft, so I can't really take too much credit, but I still think this is pretty neat.
Nice to see people building computational redstone in the redstone section. Youtube recommends me Ben Eater videos but I don't watch any of them because I already have a little bit of background in digital logic and assembly level code.
Btw if you're interested in this kind of stuff, I'm part of a whole server, Open Redstone Engineers, that does this kind of redstone (assuming you're not already a member). See my signature.
Ah, that's interesting, I never expected there'd be dedicated servers only for redstone...
I'm not actually a computer science major and I really don't know what I'm doing, so I doubt I'd be any contribution. I'm actually more interested in devices like automatic farms and virtual pets (silly stuff like that). I just figured I'd give building a computer a try. Thanks for the invitation, though; those things mean quite a lot.
(Sorry for replying 4 days late; it appears as though I've stopped receiving notifications)
You do not need to have any formal background. My major is not in CS and many of our users are in middle school or high school. Don't be discouraged. When I was younger I always questioned if I had the background or maturity do try to design computer systems, and as I got older I realized that didn't matter in a game. By actually building the computer, you've already gone further than 99% of those interested in redstone.
ORE also has a school server that requires no application if you're interested. You get a little plot of land to build on.