Skip to content

Andy4495/Homemade-CPU

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Homemade CPU

Check Links Check Wiki Links

Designing my own CPU.

Check out my blog to see my progress.

See the Wiki for design details and documentation.

An emulator is available to run the CPU instructions and compare with the actual hardware.

Latest Updates

2025-Oct-24: Starting on the Hardware

Now that I have a pretty good idea on the design of the CPU, it's time to get started on the hardware. First step is the clock generator circuit. (full blog entry...)

Design Goals

  • 8-bit data, 16-bit address bus
  • Implement with readily-available, off-the-shelf logic chips
    • 74HCxx-series
  • Based on RISC principles
    • Each instruction should execute in one clock cycle (not including fetch)
    • Fixed-length 8-bit instructions
    • Limited instruction set
      • Simple enough to implement and execute in one clock, but powerful enough that more complex operations can easily be implemented by the assembler/compiler
    • No microcode
    • Although RISC CPUs typically have a high number of internal registers, this implementation will have relatively few registers
  • Little Endian (least significant byte at lowest address)
  • von Neumann architecture
  • PC and SP are implemented with a counter chip (e.g., 74HC161 or 74HC163) for ease of incrementing without having to use the ALU
  • Additional ideas that may be implemented
    • Pipeline fetch, decode, execute
    • Support for hard-coded constants (0, 1, 255)
    • Interrupt support
  • Create and update an assembler as the hardware is implemented
    • The assembler will probably implement higher-level operations beyond what is supported by the CPU
      • For example, 16-bit add
  • Create and update an emulator as the hardware is implemented
  • Create and update a hardware model (VHDL or Verilog) as the hardware is implemented
    • This may lag a little, as my VHDL is a little rusty at this point
  • Track development
    • Document each step in the process: why a design decision was made, why something was later changed
    • Use a tracker table to show progress of my various design goals (implemnted, not implemted yet, will not implement)

Next Steps

Create an emulator/disassembler: add support for the Homemade CPU to my existing emulator-8-bit application.

  • [10-Oct-2025] The emulator and disassembler have been implemented, and some manual tests have been run. Still need to run more complete tests and create some automated test actions.

Initial circut:

  • Program counter to access memory and load into AC
  • LEDs to show value of AC and PC
  • Clock circuit with debounced toggle switch

History

Date Action
Sep-2025 Document project design goals. Set up repo.
Oct-2025 Initial CPU design: registers, addressing modes, opcode size and format, instruction set.
Create wiki.
Implement emulator: disassembler, emulator, automated tests.
Update design to version 2 to use 8-bit instructions instead of 16-bit.
- Updated emulator to support design version 2.

About

Designing my own CPU.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published