Guide to the TD4 4-bit DIY CPU
5 hours ago
- #DIY Computer
- #Educational Project
- #Computer Architecture
- The TD4 is a 4-bit DIY CPU kit purchased from Aliexpress, featuring 2 registers, LEDs, and 16 bytes of program ROM for educational purposes.
- Building the kit required soldering, with challenges including diode directionality and USB connector placement; the USB provides only power.
- The program ROM uses 16 DIP switches, where bits 5-8 define opcodes and bits 1-4 are immediate values for instructions like ADD, MOV, and JMP.
- An address decoder selects ROM banks, and a command decoder translates opcodes into control signals for registers and the data selector.
- The data selector chooses inputs for the adder from registers, input, or ground, and the adder processes immediate values for operations.
- Registers A, B, Out, and PC store data, with PC enabling jumps, and a carry flip-flop supports conditional jumps like JNC.
- Simple programs demonstrated outputting values, flashing LEDs, and counting up/down, with assembly requiring manual bit manipulation.
- A Python simulator and assembler were created to help program and test instructions, though it may need improvements.
- The TD4's limited state (16 bits) makes it akin to a finite state machine, suggesting possibilities for model checking or synthesis.
- Related projects like Nand2Tetris and Ben Eater's computer are recommended for further learning in computer architecture.