Yet Another Project Red build guys...and this is quite an interesting one.
I was inspired to build this based on WireWorld....If you don't know what that is, think Conways Game of Life but with a ruleset designed to mimic the properties of electrons running around circuits. a google search will show you images of a strange contraption that is a working computer, with numeric display, registers, clocks, the works. It even has a working program that calculates prime numbers. There's even a few youtubers that have made working, 3d, wireworld sims...in minecraft itself. You gotta see it work, they are amazing.
This build is based exactly on that computer from WireWorld. It's really what's called a TTA cpu, or Triggered Transfer Architecture. In basic english...this type of cpu has only 1 instruction: move data from a source register to a destination register. How does it do anything useful then if all it does is move data around? There are special registers that perform basic operations like add, shift, and/not, if/then/else. Writing to these registers will 'trigger' the operation, and reading them will get the result of that operation. In particular:
reg 0: write updates the display. read = 0
reg 53: read = reg 54 and NOT(reg 53) (some processors call this a bit clear instruction, or BIC)
reg 54: read = reg 53 and NOT(reg 54)
reg 55: read = 0
reg 56: read = if (reg 56 != 0) return reg 55, else return reg 57
reg 57: read = 0
reg 58: read = reg 58 rotate right 1 bit
reg 59: read = reg 59 rotate left 1 bit
reg 60: read/write
reg 61: read = reg 60 + reg 61
reg 62: read = not reg 62
reg 63: program counter, write to branch
and here it is:
theres a lot going on here. The main component is that long stack of registers. 64 in all..each 16 bits. They have dual address buses (seen in last image) that control read/writes. On top of the registers is a 16 bit binary to bcd decoder. this uses the double-dabble algorithm, so each ic chip you see in the decoder is a 4bit bin 2 bcd decoder that performs the conversion. See Newomasters youtube vids..he explains the entire thing very nicely. this is just a much more compact (and faster) version of his design.
looking at the other side of the registers, you can see theres stuff going on with the last set of registers, these are the special registers (reg 0 is the farthest in the back of the stack, connected directly to the bcd decider, and 63 is up front where all the control logic is)
in the first image, that mess in front of the registers is the part that handles the opcode fetch/decode/memory transfers. This is really the 'core' of the cpu...there's not much to do in this type of cpu. the closest circuit with the orange wires is a failed attempt at getting the cpu timing to work...i'm using an advanced CC computer (you can just barely see it in the first pic) to handle loading the program and juggling the cpu control lines to make the computer run. it even runs the exact same code that is found at https://www.quinapalus.com/wi-index.html. go to the last page and you'll see the opcodes that runs on the wireworld computer...the same program runs on this build! (I did have to tweak the negative constants. The WW computer does 1's compliment math while this build does 2's compliment. The difference is how negative values are represented in binary)
this build is also the first success I've had using many PR ic chips. there are quite a few of them, 13 different ics in all. the registers use at least 2 chips per register, plus the extra chips for the special operations. the bcd decoder has almost 40 ics. all the blueprints are tucked away in a chest so once i post the download, you can play with them and do cool stuff
ive had the computer run for 5 minutes and it does find primes from 2 up to 17. it runs about 1 op per second...not too bad at all I'd let it run more but it takes longer as the number gets higher. I did a simulation in c# and it takes over 50mil cycles to start seeing primes in the 20000 range. ill post a download shortly, still trying to sort out the timing circuit.
I was inspired to build this based on WireWorld....If you don't know what that is, think Conways Game of Life but with a ruleset designed to mimic the properties of electrons running around circuits. a google search will show you images of a strange contraption that is a working computer, with numeric display, registers, clocks, the works. It even has a working program that calculates prime numbers. There's even a few youtubers that have made working, 3d, wireworld sims...in minecraft itself. You gotta see it work, they are amazing.
This build is based exactly on that computer from WireWorld. It's really what's called a TTA cpu, or Triggered Transfer Architecture. In basic english...this type of cpu has only 1 instruction: move data from a source register to a destination register. How does it do anything useful then if all it does is move data around? There are special registers that perform basic operations like add, shift, and/not, if/then/else. Writing to these registers will 'trigger' the operation, and reading them will get the result of that operation. In particular:
reg 0: write updates the display. read = 0
reg 53: read = reg 54 and NOT(reg 53) (some processors call this a bit clear instruction, or BIC)
reg 54: read = reg 53 and NOT(reg 54)
reg 55: read = 0
reg 56: read = if (reg 56 != 0) return reg 55, else return reg 57
reg 57: read = 0
reg 58: read = reg 58 rotate right 1 bit
reg 59: read = reg 59 rotate left 1 bit
reg 60: read/write
reg 61: read = reg 60 + reg 61
reg 62: read = not reg 62
reg 63: program counter, write to branch
and here it is:
theres a lot going on here. The main component is that long stack of registers. 64 in all..each 16 bits. They have dual address buses (seen in last image) that control read/writes. On top of the registers is a 16 bit binary to bcd decoder. this uses the double-dabble algorithm, so each ic chip you see in the decoder is a 4bit bin 2 bcd decoder that performs the conversion. See Newomasters youtube vids..he explains the entire thing very nicely. this is just a much more compact (and faster) version of his design.
looking at the other side of the registers, you can see theres stuff going on with the last set of registers, these are the special registers (reg 0 is the farthest in the back of the stack, connected directly to the bcd decider, and 63 is up front where all the control logic is)
in the first image, that mess in front of the registers is the part that handles the opcode fetch/decode/memory transfers. This is really the 'core' of the cpu...there's not much to do in this type of cpu. the closest circuit with the orange wires is a failed attempt at getting the cpu timing to work...i'm using an advanced CC computer (you can just barely see it in the first pic) to handle loading the program and juggling the cpu control lines to make the computer run. it even runs the exact same code that is found at https://www.quinapalus.com/wi-index.html. go to the last page and you'll see the opcodes that runs on the wireworld computer...the same program runs on this build! (I did have to tweak the negative constants. The WW computer does 1's compliment math while this build does 2's compliment. The difference is how negative values are represented in binary)
this build is also the first success I've had using many PR ic chips. there are quite a few of them, 13 different ics in all. the registers use at least 2 chips per register, plus the extra chips for the special operations. the bcd decoder has almost 40 ics. all the blueprints are tucked away in a chest so once i post the download, you can play with them and do cool stuff
ive had the computer run for 5 minutes and it does find primes from 2 up to 17. it runs about 1 op per second...not too bad at all I'd let it run more but it takes longer as the number gets higher. I did a simulation in c# and it takes over 50mil cycles to start seeing primes in the 20000 range. ill post a download shortly, still trying to sort out the timing circuit.
Last edited: