summaryrefslogtreecommitdiff
path: root/eater_cpu
diff options
context:
space:
mode:
authoruvok2026-01-21 20:17:44 +0100
committeruvok2026-01-21 20:17:44 +0100
commita7cb46cac7575875dd38e7d3135fd54d78598523 (patch)
treede80c0570f62dc027629c731f2f5174cec86a9a4 /eater_cpu
parentbd137cec37fade1acc2a5ee2db546b8dc67f64d0 (diff)
Explain separate PC++ state
need to get correct next state, once INS is loaded.
Diffstat (limited to 'eater_cpu')
-rw-r--r--eater_cpu/eater_types.sv7
-rw-r--r--eater_cpu/readme.txt10
2 files changed, 15 insertions, 2 deletions
diff --git a/eater_cpu/eater_types.sv b/eater_cpu/eater_types.sv
index 6098744..9c8945c 100644
--- a/eater_cpu/eater_types.sv
+++ b/eater_cpu/eater_types.sv
@@ -9,6 +9,13 @@ typedef enum logic[7:0] {
INIT,
PC_to_MAR,
MEM_to_INS,
+ // Note:
+ // The Ben Eater CPU combines these steps. However.
+ // I got probably a bug in my state machine,
+ // or clock in the data differently,
+ // but if I combine the steps, I'm trying to get
+ // the instruction-dependent next state before
+ // the INS is actually loaded. whoops.
PC_inc,
// instruction dependent states
diff --git a/eater_cpu/readme.txt b/eater_cpu/readme.txt
index aa72328..44fe1b1 100644
--- a/eater_cpu/readme.txt
+++ b/eater_cpu/readme.txt
@@ -40,8 +40,14 @@ operation
Increment PC.
a) PC out -> MAR
(PC_to_bus) + (bus_to_MAR) + (clk)
- b) MEM -> INS, PC++
- (RAM_to_bus) + (bus_to_INS) + (PC_count_en) + (clk)
+ b) MEM -> INS
+ (RAM_to_bus) + (bus_to_INS) + (clk)
+ c) PC++
+ (PC_count_en) + (clk)
+
+ NOTE:
+ Yes, I know Ben Eaters computer combines b and c.
+ See eater_types for details.
2. Decode and execute instruction.