The idea of the project is the fun of playing around with electronics, something I have not done before, and trying to understand everything about a real computer. Starting with the CPU and then building it out with a simple graphics card. After that create an assembler/compiler for RISC-V and write a small OS. Yes, all of these will be relatively simple and not of a commercial standard, but building a machine and watching it run with all the hardware and software written from scratch is the longer term goal.
This is an awesome & crazy project! I'll be watching. Would love to read a little bit about how much time it's taking as you go, and how it balances against your work & life.
Ever since I was an undergrad many moons ago, I thought a 4-year CS degree that ran on this same premise would be amazing. Say, spend your first year learning hardware logic and building a CPU. Year 2 is a basic operating system & compiler. Year 3 networking & a graphics system, and year 4 maybe a game or application or research project of the student's choice. Or something like that. Wouldn't it be cool to graduate having built your own computer from the ground up?
Second. The register file could be implemented with far fewer chips if only a single output was used. The A and B register select bits would need to go through a quad 2-1 multiplexor and the output would need to be latched for either A or B and some sequencing logic added to make it work. In other words it would take 2 cycles to read from both A and B operands.
Oh, and don't forget that in RISC-V register 0 is always read as zero so no actual storage is needed for that one.
Or you could read one register on the rising and the other on the falling edge of the clock, if timing permits. A lot of real microprocessors were designed with this techinque.
I used a photo-resist process based on transparencies that I made in the department Xerox machine.
The biggest improvement in moving to real manufactured boards was plated-through holes. For that reason alone, I wouldn't go back. Not only are boards easier to route with PTH's, but they are also more robust -- it's harder to lift a pad off the board when removing a component.
Solder mask is a boon as well, especially for surface mount.
[1]: http://www.dirtypcbs.com [2]: https://www.youtube.com/watch?v=6LCuZCmttIQ
I loved inventing the instruction set, which made me realise why opcodes are encoded the way they are. Probably one of the best learning experiences I ever had.
I was going to try to build it out of 74' series logic as a summer project last summer. Then I did a count of the gates I was using. In the following, a number after a gate type means the number of inputs. My gate count:
295 AND2
8 AND3
3 NOR2
4 OR2
96 OR3
20 OR4
226 XOR2
6 NOT
563 MUX2
161 MUX4
32 D FLIP FLOPS
I'm not including memory for the registers. I would probably not have tried to make that out of 74' series logic.In terms of chips, it is something like
140 4xMUX2
75 4xAND2
81 2xMUX2
55 4xXOR2
plus a few more.The project pretty much died at that point.
I could cut a lot of those out by moving some functions from hardware to software. My design includes a shifter than can left or right, logical or arithmetic shift 1 to 32 bits in one cycle. 353 of the MUX2s are involved in that.
I could take that out, add a much simpler unit that can only do logical right shift by 1, add a new shift instruction that uses that simpler shifter, and make the current shift instruction into illegal instructions. They would then trap, and the illegal instruction handler could emulate the missing instructions.
Still too many chips after that, though.
I may still build it someday, but rather than making it out of real chips I'll use it as an excuse to learn about FPGAs.
If any of this seems interesting, I highly recommend 6.004 at MITx.
Is that an euphemism to avoid saying "MIPS"? ;-)
One way to really cut down on hardware (and speed) is to use a bit-serial design, as found on some minicomputers in the 70s. Memory elements like registers still need the full width, but by processing only 1 bit at a time, many of the other components in the datapath can be reduced by a factor of 32. You can also get left and right shifts for "free" since that's intrinsic in the design. Another strategy is to use microcode to break down instructions even further, e.g. reuse the ALU to do address calculations and incrementing the instruction pointer.
6.004 is a ton of fun. If you want to build something, I recommend a CISC-like multi-cycle design that uses micro-code (or a hardware sequencer) to dramatically reduce the HW costs (pdf warning):
http://inst.eecs.berkeley.edu/~cs152/sp13/handouts/microcode...
And it could still run a RISC ISA like Beta or RISC-V.
Anyway, this project won't be the first 32 bit homebrew TTL processor. But it seems it will be able to claim to be the first still on the web :-(
There are some old parts from the 74 family which were never brought over (like the 7447 seven-segment decoder), but all of the basic logic parts are still around.
Hardware freedom will become increasingly important in the future, and I predict it will be harder to achieve that software freedom.
I remember working out the logic of "JK" flip-flops and the like. At one time I'd acquired some ancient vacuum tube versions of said flip-flops. Wish I'd kept them, they'd be a great curiosity today, a collector's item of sorts.
Should evoke some good memories looking through the catalogs of current versions of those venerable products. Won't be surprising if they'll be around for a long time into the future.
This is the technology in the common 74' series integrated circuits that became popular in the late 1960's and 1970's. You can get basic IC's that perform AND, NOT, XOR operations but also more complex IC's that perform as multiplexors, buffers, registers and so forth. You can find these in computers like the PDP or VAX series machines.
They are not used as much today and so less of them are still manufactured.
Today you can get the basic logic, of course, because a little bit of glue and duct tape is still necessary. And the super basic shift registers and I/O buffers are still useful. But all computation has moved into much more highly integrated chips or FPGAs.
From a practical standpoint, going with 32-bit over 16-bit means not much more than making the datapath twice as wide --- which increases area but not actual complexity per se. And seeing a discrete i386 would actually be pretty interesting, especially if implemented on top of this one as an x86-to-RISCV uop-based decoder like the original P5.
Here's another well-known one, although it's 16-bit and uses a custom ISA (but its creator ported a whole OS to it):
Actually, that is more true from a theoretical standpoint.
From a practical standpoint you have twice as many traces to fit on your board and route, you have more chips, higher power requirement, etc.
LTSpice is free, and quite good: http://www.linear.com/designtools/software/#LTspice
A good tutorial page: http://www.simonbramble.co.uk/lt_spice/ltspice_lt_spice.htm
LTWiki page on component libraries, Bordodynov's library in particular contains lots of 74HC and 74HCT series chips: http://ltwiki.org/?title=Components_Library
With discrete logic, the design can be done on paper and with standard EDA tools, and you can prototype it and test and build it on your workbench, and all the signals are exposed so you can inject and probe signals with standard test equipment.
I like the discrete logic approach because it feels more tangible and it's fun from an electronics tinkering perspective. But the FPGA method is for sure gonna be faster and smaller and cheaper, you just have to do all the work in software.
Depends on the experience you want in your hobby project, I guess. :)
Before you write off prototyping large sections on breadboards, I highly recommend you take a look at the Vulcan-74:
This would allow system level testing, and get to a working device sooner. Over time migrate everything to TTL
If you just need to test a unit (and don't need full functionality), a nice logic analyzer works well... I have an HP 16700A with pattern generator, which I can use to simulate just about anything (more or less.. sometimes it's a bit cumbersome to use.)
[0] https://www.youtube.com/playlist?list=PLowKtXNTBypGqImE405J2...