A fun summer project 2025 with the goal to build a simple 16-bit computer that can hold a simple OS, programming language and some games.
Hardware chipset for the Carl16 computer using a simple hardware descriptive language for the architecture of the logic gates.
The chipset is organized by complexity and dependencies:
- 1_basic/ - Fundamental gates (AND, OR, NOT, XOR, etc.)
- 2_adders/ - Arithmetic components (HalfAdder, FullAdder, Add16)
- 3_routing/ - Data routing (Mux, DMux and their variants)
- 4_logic/ - Complex logic units (ALU, Inc16)
- 1_storage/ - Basic memory (Bit, Register)
- 2_memory/ - Memory hierarchy (RAM8, RAM16, RAM512, RAM4K, RAM16K, Memory)
- 3_control/ - Control flow (Program Counter)
- 4_processing/ - Central components (CPU, Computer)
The Carl16 computer uses C16 assembly language, a simple assembly language with:
- 16-bit instructions
- Memory-mapped I/O
- Screen memory (addresses 0x4000-0x5FFF)
- Keyboard input (address 0x6000)
The assembler is implemented in Rust and includes:
- src/ - Assembler source code
- tests/ - C16 assembly test programs
basic.asm- Basic load/store operationsadd.asm- Addition of two numbersmultiply.asm- Multiplication via repeated additionbranching.asm- Conditional branchingiteration.asm- Loop iteration and summationvariables.asm- Variable manipulation and swappingpointers.asm- Array manipulation with pointersscreen.asm- Screen drawing operationsrectangle.asm- Interactive screen filling
cd assembler
cargo build --releaseBased on concepts from "The Elements of Computing Systems" by Nisan and Schocken.