Skip to content

Commit 535380f

Browse files
committed
Fetch logic implemented
1 parent 31e928a commit 535380f

1 file changed

Lines changed: 21 additions & 34 deletions

File tree

README.md

Lines changed: 21 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,24 @@
33
[![Check Links](https://github.com/Andy4495/Homemade-CPU/actions/workflows/check-links.yml/badge.svg)](https://github.com/Andy4495/Homemade-CPU/actions/workflows/check-links.yml)
44
[![Check Wiki Links](https://github.com/Andy4495/Homemade-CPU/actions/workflows/check-wiki-links.yml/badge.svg)](https://github.com/Andy4495/Homemade-CPU/actions/workflows/check-wiki-links.yml)
55

6-
Designing my own CPU.
6+
Designing my own CPU:
77

8-
Check out my [blog][3] to see my progress.
9-
10-
See the [Wiki][2] for design details and documentation.
11-
12-
An [emulator][1] is available to run the CPU instructions and compare with the actual hardware.
8+
- [Blog][3] documenting my progress
9+
- [Wiki][2] for design details and documentation
10+
- [Emulator][1] to run the CPU instructions and compare with the actual hardware
1311

1412
## Latest Updates
1513

16-
## 2025-Oct-28: Instruction Set Update
14+
## 2025-Nov-07: Fetch Logic - Program Counter and Instruction Register Hardware
1715

18-
As I was working on the overall block diagram and data connections between the various components, I realized that implementing the `PUSH` and `POPP` stack operations for every register makes the internal CPU connections much more complicated than I wanted. [(full blog entry...)][ref]
16+
I have implemented the `PC` and fetch logic in hardware: the clock increments the `PC` and fetches an instruction into `IR` with each clock cycle. `PC` is incremented on the rising edge of the clock, and `IR` latches the instruction from memory on the falling edge. [(full blog entry...)][ref]
1917

20-
[ref]: https://github.com/Andy4495/Homemade-CPU/wiki/Blog#2025-oct-28-instruction-set-update
18+
[ref]: https://github.com/Andy4495/Homemade-CPU/wiki/Blog#2025-nov-07-fetch-program-counter-and-instruction-register-hardware
2119

2220
## Design Goals
2321

2422
- 8-bit data, 16-bit address bus
25-
- Implement with readily-available, off-the-shelf logic chips
26-
- 74HCxx-series
23+
- Implement with readily-available, off-the-shelf 74HCxx-series logic chips
2724
- Based on RISC principles
2825
- Each instruction should execute in one clock cycle (not including fetch)
2926
- Fixed-length 8-bit instructions
@@ -33,43 +30,33 @@ As I was working on the overall block diagram and data connections between the v
3330
- Although RISC CPUs typically have a high number of internal registers, this implementation will have relatively few registers
3431
- Little Endian (least significant byte at lowest address)
3532
- von Neumann architecture
36-
- PC and SP are implemented with a counter chip (e.g., 74HC161 or 74HC163) for ease of incrementing without having to use the ALU
37-
- Additional ideas that may be implemented
33+
- `PC` and `SP` are implemented with counter chips (74HC161 for `PC`, 74HC193 or 74HC194 for `SP`) for ease of incrementing/decrementing without having to use the ALU
34+
35+
## Longer Term
36+
37+
- Create an assembler
38+
- The assembler will also implement higher-level operations beyond what is supported by the CPU
39+
- Create a hardware model (VHDL or Verilog)
40+
- This may lag a little, as my VHDL is a little rusty at this point
41+
- Additional CPU improvements not implemented in the first iteration of the design:
3842
- Pipeline fetch, decode, execute
39-
- Support for hard-coded constants (0, 1, 255)
4043
- Interrupt support
41-
- Create and update an assembler as the hardware is implemented
42-
- The assembler will probably implement higher-level operations beyond what is supported by the CPU
43-
- For example, 16-bit add
44-
- Create and update an emulator as the hardware is implemented
45-
- Create and update a hardware model (VHDL or Verilog) as the hardware is implemented
46-
- This may lag a little, as my VHDL is a little rusty at this point
47-
- Track development
48-
- Document each step in the process: why a design decision was made, why something was later changed
49-
- Use a tracker table to show progress of my various design goals (implemnted, not implemted yet, will not implement)
5044

5145
## Next Steps
5246

53-
Create an emulator/disassembler: add support for the Homemade CPU to my existing [emulator-8-bit][1] application.
54-
55-
- [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.
56-
57-
Initial circut:
58-
59-
- Program counter to access memory and load into `AC`
60-
- LEDs to show value of `AC` and `PC`
61-
- Clock circuit with debounced toggle switch
47+
Start implementing the instruction decoding logic.
6248

6349
## History
6450

65-
| Date | Action |
66-
| ---- | ------ |
51+
| Date. | Activity |
52+
| -------- | -------- |
6753
| Sep-2025 | Document project design goals. Set up repo. |
6854
| Oct-2025 | Initial CPU design: registers, addressing modes, opcode size and format, instruction set. |
6955
| | Create wiki. |
7056
| | Implement [emulator][1]: disassembler, emulator, automated tests. |
7157
| | Update design to version 2 to use 8-bit instructions instead of 16-bit. |
7258
| | - Updated [emulator][1] to support design version 2. |
59+
| Nov-2025 | `PC`, `IR`, and related hardware implemented for instruction fetch, `PC` incrementing |
7360

7461
[1]: https://github.com/Andy4495/emulator-8-bit
7562
[2]: https://github.com/Andy4495/Homemade-CPU/wiki

0 commit comments

Comments
 (0)