8 comments

[ 24.2 ms ] story [ 1631 ms ] thread
This is a project to teach myself more about the inner workings of CPUs, so I'll need to learn a lot in the course of this project.

So far I've just defined some basic components (logic gates, adders, latches), working from class notes, Wikipedia, and the computer built in Wireworld. If any HNers can point me in the direction of better resources, it would be much appreciated.

Another direction you might want to explore is to learn VHDL or Verilog and implement the CPU on an FPGA board.

You can get a prototype board for around $100 and should be able to build something to cover most of, say, the MIPS instruction set.

This would be a more engineering oriented project; I would follow along an 'introduction to computer organization' style course from a university (just google and you can determine the required textbook, exercises etc).

It's exciting to write some C code, compile it to mips instruction set with gcc (I had to do some fudging here because my cpu didn't implement the entire instruction set) -- and then run it on the fpga and get the right numbers.

That's definitely a great way to learn more about CPUs. In school we designed a simple 8-bit CPU and loaded it into an FPGA. This included coming up with a simple assembly language and building a compiler.
That sounds like an interesting approach, it would certainly be cool to play around with some actual hardware - I'll certainly think about trying it out of I have success with the software implementation.
Awesome! The intro computer architecture class at MIT (6.004) actually does this same thing over the course of the term. (http://6004.csail.mit.edu/). Of course it's not just NANDs, but the basic idea is working from the FET level in the first lab, then building up abstractions each subsequent lab until a Beta processor is built by the 6th. You might find some of the resources on that website helpful. Everything is built using a program one of the professors built where you define lists of components and subcircuits. Good luck!
Looks like a good resource, cheers!
This semester I had a course where we had to implement a MIPS based processor from the ground up, with pipeline, caches, forwarding, and other techniques. I recommend starting with a basic non-pipelined MIPS processor, as it is not hard to find information, and go from there.

We had to use VHDL, and also used some predefined ports, so we hadn't to create everything from nand gates like you are trying to do. The book we used was "Computer Architecture: A Quantitative Approach" by Hennessy & Patterson.