Designing a 4-bit CPU
Yup. I've finally been making some progress on the CPU design front. This all came from a couple of realizations:
1. AND and NAND gates can be used to effectively decode opcodes.
2. AND gates can also be used to activate or deactivate entire subcircuits.
I was hung up before because I couldn't really figure out how to make bits in memory cause the CPU hardware to assume a different state. But... it works! So far, this CPU only has a few opcodes, but I can add numbers together and store arbitrary values into registers. It's far from being Turing complete, but with a little more work I can get it to compute the Fibonacci sequence.
Basically, I need to get it to swap the two main registers and one register with the accumulator. Then I need to figure out how to implement branching. And some logic operations would be nice.
Oh, hey! Turns out there's an IC out there that does exactly what I'm doing with all the AND gates. It's called a demultiplexer. Hooray for parallel invention.
So now I just need to figure out how to do a branch. It's impossible with the simple counter I have - I need to design one that can take input (like a 74193). Yup, that'd do it.