<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ando</title>
    <description>The latest articles on DEV Community by Ando (@ikaroshunt).</description>
    <link>https://dev.to/ikaroshunt</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4157951%2F1292dec2-31ff-4cfd-9cdd-491022bc2553.jpg</url>
      <title>DEV Community: Ando</title>
      <link>https://dev.to/ikaroshunt</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ikaroshunt"/>
    <language>en</language>
    <item>
      <title>Pipeline panic game</title>
      <dc:creator>Ando</dc:creator>
      <pubDate>Sat, 03 Oct 2026 11:03:03 +0000</pubDate>
      <link>https://dev.to/ikaroshunt/a-5th-stage-game-1bjl</link>
      <guid>https://dev.to/ikaroshunt/a-5th-stage-game-1bjl</guid>
      <description>&lt;p&gt;I Built a 5-Stage Pipeline Game in Python — And Finally Lost to My Own Branch Predictor&lt;/p&gt;

&lt;p&gt;When I started CS101: Introduction to Programming on Codecademy, the portfolio project sounded simple: "Build a basic terminal game."&lt;br&gt;
Everyone was making Blackjack and Tic-Tac-Toe. I wanted something that actually teaches how computers really think. So I remembered my previous project - building a CPU from scratch - and thought: what if I turn the CPU's biggest enemy into a game?&lt;/p&gt;

&lt;p&gt;Introducing PIPELINE PANIC - CPU Hazard Defender. You're a Pipeline Engineer and your job is to keep a 5-stage pipeline alive while hazards try to kill it.&lt;/p&gt;

&lt;p&gt;The Result (Proof it Works)&lt;br&gt;
Here's my game running a real program with RAW hazards and branch&lt;br&gt;
mispredictions: ![&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fusmo0gj35bd0opj8mirs.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fusmo0gj35bd0opj8mirs.jpg" alt=" " width="800" height="533"&gt;&lt;/a&gt; - Pipeline Panic running Cycle 5 with forwarding and stall detection]&lt;/p&gt;

&lt;p&gt;This is actual terminal output from python main.py (Menu 2 - PLAY): It loads instructions from program.asm or from interactive input: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It runs a full IF → ID → EX → MEM → WB simulation&lt;/li&gt;
&lt;li&gt;It shows Stalls, Flushes, Forwarding in real-time&lt;/li&gt;
&lt;li&gt;It tracks Branch Predictor Accuracy live - in this run, 75.0%!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5ytrwdg04se7up6qzrsv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5ytrwdg04se7up6qzrsv.png" alt=" " width="797" height="124"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Yes, I tied with a 2-bit saturating counter. That's humbling.&lt;/p&gt;

&lt;p&gt;How My Python Code Works&lt;br&gt;
I split the game into 5 core OOP modules to meet the Codecademy requirement for clean architecture - just like real hardware:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;AssemblyParser (The File Parser)
A 3-pass parser pipeline - yes, a pipeline inside a pipeline simulator:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Pass 1: Collect all labels ( LOOP: , TARGET: )&lt;/li&gt;
&lt;li&gt;Pass 2: Tokenize with strict Regex for R-type ( ADD R1,R2,R3 ), I-type ( LW R5,R2,100 ), B-type ( BEQ ), J-type&lt;/li&gt;
&lt;li&gt;Pass 3: Resolve label → instruction index, with nice error reporting:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhknim2mxesxcr5afchdy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhknim2mxesxcr5afchdy.png" alt=" " width="800" height="64"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It supports # comments , empty lines, and both file and text input.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;HazardDetectionUnit + ForwardingUnit (The Brains)
This is the part that makes decisions by itself - the "otak" I wanted:
Two Big-O implementations for education:
detect_naive() - O(n²) - checks every pair in the 3-instruction window
detect_optimized() - O(n) - uses a last_write hashmap
Benchmark in Menu 1 shows O(n) is ~40% faster even for 7 instructions. Imagine for
1000.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fse1099vg3en506d9cl3c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fse1099vg3en506d9cl3c.png" alt=" " width="800" height="253"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The ForwardingUnit automatically decides if it can forward EX→EX or MEM→EX or must insert a bubble.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;BranchPredictor (The One That Beat Me)&lt;br&gt;
This is the "nebak cabang" brain. It implements 3 strategies:&lt;br&gt;
always_taken&lt;br&gt;
always_not_taken&lt;br&gt;
2-bit - 4-state FSM: Strong NT (00) → Weak NT (01) → Weak T (10) → Strong T (11)&lt;br&gt;
It learns from history and tracks its own accuracy. In Battle Mode, you play against it.&lt;br&gt;
Spoiler: it's good.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;CPUPipeline (The 5-Stage Pipeline)&lt;br&gt;
Classic RISC pipeline:&lt;br&gt;
1 IF (Fetch) → ID (Decode) → EX (Execute) → MEM → WB&lt;br&gt;
Each step() moves pipeline registers. It handles stalls and flushes:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F49tv4n2tkpafidk6mdit.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F49tv4n2tkpafidk6mdit.png" alt=" " width="766" height="529"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;GameEngine (The Terminal Game)
Meets Codecademy's input() requirement with 5 modes:&lt;/li&gt;
&lt;li&gt;LEARN - Big-O demo + hazard visualization&lt;/li&gt;
&lt;li&gt;PLAY - Live pipeline visualization&lt;/li&gt;
&lt;li&gt;CHALLENGE - Compiler optimization puzzle: reorder instructions to minimize
stalls (my favorite - you have ADD R1,R2,R3 / SUB R4,R1,R5 / ADD R6,R7,R8
and you must move the independent one up!)&lt;/li&gt;
&lt;li&gt;BATTLE - You vs 2-bit predictor&lt;/li&gt;
&lt;li&gt;PARSER - Load your own .asm file&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Check Out The Code&lt;br&gt;
All the code is open source and ready to run. I fixed the Git case from last time, but&lt;br&gt;
this time I fought with program.asm not being found - classic Windows PowerShell&lt;br&gt;
moment!&lt;br&gt;
GitHub: &lt;a href="https://github.com/ikaroshunt/pipeline_panic.git" rel="noopener noreferrer"&gt;https://github.com/ikaroshunt/pipeline_panic.git&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;To run it yourself:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftp3z8ms6amiw4x5q63h4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftp3z8ms6amiw4x5q63h4.png" alt=" " width="800" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Files:&lt;br&gt;
main.py - All-in-one game (OOP, Pipeline, Brains, Parser)&lt;br&gt;
program.asm - Sample program with intentional hazards&lt;/p&gt;

&lt;p&gt;Conclusion&lt;br&gt;
My first CPU simulator taught me why cache exists. This one taught me why pipelines are hard. I finally understand:&lt;br&gt;
Why a simple ADD can stall the whole CPU (RAW hazard)&lt;br&gt;
Why branch prediction is 30% of CPU performance&lt;br&gt;
Why O(n) vs O(n²) matters when you check hazards for thousands of&lt;br&gt;
instructions&lt;br&gt;
Why forwarding is cheaper than stalling&lt;/p&gt;

&lt;p&gt;It was frustrating at first - ParseError: Undefined label LOOP (yes, I forgot to&lt;br&gt;
define my own label!), fatal: pathspec did not match , and tying with my own&lt;br&gt;
AI. But each error was a lesson.&lt;br&gt;
If you're taking CS101, don't just make Blackjack. Make something that makes you&lt;br&gt;
lose to your own code. There's no better feeling than seeing === Cycle 10 ===&lt;br&gt;
Stalls=2 and knowing you built that logic.&lt;br&gt;
This project was built as part of Codecademy's Computer Science Career Path&lt;br&gt;
(CS101: Python Terminal Game Portfolio Project) - Level 2 of my CPU series.&lt;/p&gt;

&lt;p&gt;Tools: Python 3, Git, VS Code, PowerShell, OOP, Big-O Analysis, 2-bit Branch&lt;br&gt;
Prediction&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzagoiztq8e3guj06j3nu.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzagoiztq8e3guj06j3nu.jpg" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F470pnjgictsfjllhrbad.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F470pnjgictsfjllhrbad.jpg" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>gamedev</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Why I Built This</title>
      <dc:creator>Ando</dc:creator>
      <pubDate>Fri, 02 Oct 2026 16:00:15 +0000</pubDate>
      <link>https://dev.to/ikaroshunt/why-i-built-this-68p</link>
      <guid>https://dev.to/ikaroshunt/why-i-built-this-68p</guid>
      <description>&lt;p&gt;I Built a CPU From Scratch in Python — And Finally Understood How Computers Think&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/ikaroshunt/cpu_simulator.git" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When I started CS104: Computer Architecture on Codecademy, I realized I had been using computers for years without actually understanding what happens inside. We type &lt;code&gt;print("hello")&lt;/code&gt; and it works — but how?&lt;/p&gt;

&lt;p&gt;The portfolio project challenge was: &lt;em&gt;"Research, design, and build a Python program that simulates the functionalities of a CPU."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;So I decided to stop being a user and start being a builder. Instead of just reading about registers and memory buses, I built them.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Result (Proof it Works)
&lt;/h2&gt;

&lt;p&gt;Here's my CPU simulator running a real program that adds two numbers, stores them to memory, and tests branching:&lt;/p&gt;

&lt;p&gt;![My CPU simulator running in terminal - showing Fetch Decode Execute cycles]&lt;/p&gt;

&lt;p&gt;This is my actual terminal output after fixing the import errors (you can see the full journey in my GitHub commits!):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It loads instructions from &lt;code&gt;instruction_input.txt&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;It loads initial memory values from &lt;code&gt;data_input.txt&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;It runs 11 cycles of FETCH → DECODE → EXECUTE → WRITEBACK&lt;/li&gt;
&lt;li&gt;It even tracks Cache Hits/Misses — in this run, 100% hit rate!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And here's the architecture I designed:&lt;/p&gt;

&lt;p&gt;![CPU Architecture Diagram]&lt;br&gt;
&lt;em&gt;(Diagram: Instruction and Data flow from input files through CPU → Cache → MemoryBus)&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  How My Python Code Works
&lt;/h2&gt;

&lt;p&gt;I split the simulator into 3 classes to mimic real hardware, just like Codecademy suggested:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. MemoryBus (The RAM)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;256 addressable locations&lt;/li&gt;
&lt;li&gt;Methods &lt;code&gt;read(address)&lt;/code&gt; and &lt;code&gt;write(address, value)&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Can load initial values from a CSV file like &lt;code&gt;10,100&lt;/code&gt; meaning MEM[10] = 100&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Cache (The Speed Bridge)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simple direct-mapped cache with 8 blocks&lt;/li&gt;
&lt;li&gt;Write-through policy&lt;/li&gt;
&lt;li&gt;Tracks hits and misses — crucial for understanding why cache matters in real CPUs&lt;/li&gt;
&lt;li&gt;If data is not in cache (MISS), it fetches from MemoryBus&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. CPU (The Brain)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;8 registers R0-R7 (R0 is hardwired to 0, just like in MIPS)&lt;/li&gt;
&lt;li&gt;Program Counter (PC) to track next instruction&lt;/li&gt;
&lt;li&gt;Full Fetch-Decode-Execute loop:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
      &lt;span class="n"&gt;instr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;instructions&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PC&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
      &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;[FETCH] PC=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PC&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; | &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;instr&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;instr&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;ISA I implemented:

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ADD Rd,Rs,Rt&lt;/code&gt; → Rd = Rs + Rt&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;SUB, MUL, ADDI&lt;/code&gt; (with immediate)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;LW Rd,Addr&lt;/code&gt; → Load Word using cache&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;SW Rs,Addr&lt;/code&gt; → Store Word&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;BEQ Rs,Rt,Offset&lt;/code&gt; → Branch if equal&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;J Target&lt;/code&gt; → Jump&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;HALT&lt;/code&gt; → Stop&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each cycle prints its stage, so you can literally watch the CPU think. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[FETCH] PC=2 | ADD,R3,R1,R2
[DECODE] Operation: ADD, Args: ['R3', 'R1', 'R2']
[EXECUTE] R3 = R1(10) + R2(20) = 30
[WRITEBACK] Registers: {'R1':10, 'R2':20, 'R3':30}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Check Out The Code
&lt;/h2&gt;

&lt;p&gt;All the code is open source and ready to run. I struggled with Git case-sensitivity on Windows (Cpu.py vs cpu.py) and missing input files — you can see the fix in my commit history!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/ikaroshunt/cpu_simulator" rel="noopener noreferrer"&gt;https://github.com/ikaroshunt/cpu_simulator&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To run it yourself:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/ikaroshunt/cpu_simulator.git
&lt;span class="nb"&gt;cd &lt;/span&gt;cpu_simulator
python main.py
&lt;span class="c"&gt;# or if import fails: python main_single.py&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Building this CPU simulator taught me more than any textbook could. I finally understand why cache exists (CPU is fast, memory is slow), why R0 is always 0, and how a simple ADD instruction actually travels through fetch, decode, execute.&lt;/p&gt;

&lt;p&gt;It was frustrating at first — ModuleNotFoundError, FileNotFoundError, Git saying "not a git repository" — but each error taught me something about real-world development: file structure matters, case matters, and Git is strict.&lt;/p&gt;

&lt;p&gt;If you're taking CS104, don't skip this project. Don't just copy a solution. Build it, break it, fix the imports, and watch your own CPU print "SIMULATION FINISHED". There's no better feeling.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This project was built as part of Codecademy's Computer Science Career Path (CS104: Computer Architecture Portfolio Project).&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Tools: Python 3, Git, VS Code, Terminal / PowerShell&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzyi8u284ryifso1n9fv1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzyi8u284ryifso1n9fv1.jpg" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F13gsyz61ki7fq3c2mc96.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F13gsyz61ki7fq3c2mc96.jpg" alt=" " width="800" height="516"&gt;&lt;/a&gt;&lt;a href="https://dev.tourl"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>computerscience</category>
      <category>learning</category>
      <category>python</category>
    </item>
  </channel>
</rss>
