This is the result of about a year's worth of work, on and off. I was teaching myself architecture concepts while building this, so it's intentionally modular and very simple. It should be easy to understand, which makes it more useful as a teaching tool than anything else. (It's pretty cool; the cycles move so slowly while it's running that you can explain what each step of the instruction is doing while it's doing it.)
This uses a layer-based design, with each layer processing all of the operations for a single bit. It's a 16-bit system, and each layer is 5 blocks high, so it's ~80 block tall, which isn't too bad. When I started building it the height limit was still 128, so I had to sink it into the ground to make it so tall; that's why the computer is in a valley.
One thing I'm sort of proud of is the 7-segment displays, which ended up being really compact. Each display takes 4 input bits and outputs one of 16 different characters, in this case the 16 hex digits. What you see on the display (in columns) is the value in each processor register as the computer updates it. This makes programming and debugging the machine very friendly.
The program it's running calculates primes using a very simple repeated division algorithm. This is complicated by the computer's lack of a hardware divide, which necessitates repeated subtraction. This is further complicated by the lack of a hardware subtract, but it's overflow to the rescue by adding negative numbers, so it all works out in the end. (I could retrofit the CPU with a hardware subtract without too much fuss, but I enjoyed the challenge of writing the routine with that limitation.)
It's *very* slow, but what redstone computer isn't? If I'm doing my math right, each cycle has a 64 redstone tick delay, which equates to a clockspeed of 0.15 Hz. There are 7 cycles in one instruction, so it takes close to a minute per instruction. (This could be optimized by having it skip many of the steps, which is something I hope students will figure out on their own.)
There's a world download and a full instruction reference in the video description. If you're redstone inclined (and you remember to manually disengage the sequence counter before programming the machine; I never did include a way to shut it off completely) you can program it entirely in minecraft. The basic process is to write the address you want to modify to R1 (The address register) and then write the opcode to R0, which will write to that word in RAM. There are 32 words on the system; anything above 0x1F is mirrored. To start the machine, write 0x0000 to R4 (the program counter) and flip the switch to start up the clock. (remember to manually re-engage the sequence counter by first writing 0x0000 to IR, then resetting the torch to put it into the "PC++?" state, so that the next state is the first cycle.)
Makes perfect sense, non? Like I said, still needs some work.
Enjoy!
-Zeta
Edit: Oh yeah; there's a hidden message in the world download, which means the machine won't be in a fit state to start running if you just turn it on. You'll need to write 0x0000 to PC and IR first; the primes program is already loaded. I'll fix the world download later today.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumThis is the result of about a year's worth of work, on and off. I was teaching myself architecture concepts while building this, so it's intentionally modular and very simple. It should be easy to understand, which makes it more useful as a teaching tool than anything else. (It's pretty cool; the cycles move so slowly while it's running that you can explain what each step of the instruction is doing while it's doing it.)
This uses a layer-based design, with each layer processing all of the operations for a single bit. It's a 16-bit system, and each layer is 5 blocks high, so it's ~80 block tall, which isn't too bad. When I started building it the height limit was still 128, so I had to sink it into the ground to make it so tall; that's why the computer is in a valley.
One thing I'm sort of proud of is the 7-segment displays, which ended up being really compact. Each display takes 4 input bits and outputs one of 16 different characters, in this case the 16 hex digits. What you see on the display (in columns) is the value in each processor register as the computer updates it. This makes programming and debugging the machine very friendly.
The program it's running calculates primes using a very simple repeated division algorithm. This is complicated by the computer's lack of a hardware divide, which necessitates repeated subtraction. This is further complicated by the lack of a hardware subtract, but it's overflow to the rescue by adding negative numbers, so it all works out in the end. (I could retrofit the CPU with a hardware subtract without too much fuss, but I enjoyed the challenge of writing the routine with that limitation.)
It's *very* slow, but what redstone computer isn't? If I'm doing my math right, each cycle has a 64 redstone tick delay, which equates to a clockspeed of 0.15 Hz. There are 7 cycles in one instruction, so it takes close to a minute per instruction. (This could be optimized by having it skip many of the steps, which is something I hope students will figure out on their own.)
There's a world download and a full instruction reference in the video description. If you're redstone inclined (and you remember to manually disengage the sequence counter before programming the machine; I never did include a way to shut it off completely) you can program it entirely in minecraft. The basic process is to write the address you want to modify to R1 (The address register) and then write the opcode to R0, which will write to that word in RAM. There are 32 words on the system; anything above 0x1F is mirrored. To start the machine, write 0x0000 to R4 (the program counter) and flip the switch to start up the clock. (remember to manually re-engage the sequence counter by first writing 0x0000 to IR, then resetting the torch to put it into the "PC++?" state, so that the next state is the first cycle.)
Makes perfect sense, non? Like I said, still needs some work.
Enjoy!
-Zeta
Edit: Oh yeah; there's a hidden message in the world download, which means the machine won't be in a fit state to start running if you just turn it on. You'll need to write 0x0000 to PC and IR first; the primes program is already loaded. I'll fix the world download later today.