Adventures in Internet Publishing
Thursday, March 05, 2009
  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.
 
Comments: Post a Comment

Subscribe to Post Comments [Atom]





<< Home

Name:
Location: San Diego, California, United States

I program old computers and calculators in my spare time.

Archives
January 2006 / March 2006 / May 2006 / October 2006 / November 2006 / December 2006 / March 2007 / May 2007 / July 2007 / August 2007 / September 2007 / November 2007 / January 2008 / March 2008 / April 2008 / May 2008 / June 2008 / August 2008 / September 2008 / October 2008 / March 2009 / October 2010 / November 2010 / January 2011 / February 2011 /


Powered by Blogger

Subscribe to
Posts [Atom]