5 ms·
This project specifically does not try to implement memory, leaving this to Raspberry PI. In this case (1), the simplest CPU (by part count) is a 1-bit one, suc
by theamk 10y ago
This project specifically does not try to implement memory, leaving this to Raspberry PI. In this case (1), the simplest CPU (by part count) is a 1-bit one, such as Motorola MC14500B. The application handbook http://tinymicros.com/mediawiki/images/e/ec/MC14500B_Handbook.pdf http://tinymicros.com/mediawiki/images/e/ec/MC14500B_Handboo... (pdf) explains how it works.
- CPU does not contain program counter: instead, a regular binary counter counts PC from 0 to max program ROM, then wraps. You can clear OEN bit to turn write operations into no-op's. (For an advanced usage, you have JMP and RTN instructions which just set corresponding pins. It is up to you to wire something to them.)
- CPU does not contain instruction decoder: instead, some bits from program ROM are wired to address bus. For example, 16-bit wide ROM will be split into 4 bit instruction and 12 bit memory address. Max amount of RAM supported depends on your ROM's width. RAM is bit-addressable. There is no indirect RAM access (unless you implement it yourself).
- CPU does not contain wide registers: you get one data bit, one result bit, and two flags, for 4 bits of state total.
- CPU does not contain ALU: you can do AND/OR/XOR, optionally inverted -- so just a single bit LU unit.
This machine is not Turing complete at all (2), but it is still possible to implement basic arithmetic, as well as simple games such as "pong".
(1) I am ignoring all other requirements here, like clear layout and educational value.
(2) Strictly speaking, no real machine is Turing complete, because Turing machines require infinite memory. But this machine is super bad because it has no indirect memory access at all.
- delinka 10y ago"...this machine is super bad because..." I can't tell if you mean it's awesome, or terrible.
- striking 10y agoMy opinion is that both are true.
- tonyRobinson 10y agoYes, I did consider implementing a simpler processor that ran a bit sliced ALU. I decided against it because registers are needed to see how the processor works (how it fetches and stores instructions, how the PC controls flow, how you can read in and out of memory using registers, how the ALU operates on registers). The original designs used a 1 bit ALU, then I decided that this wasn't intuitive, it would be a better learning experience and not many more transistors to have a 16 bit ALU.