I accomplished a goal this weekend that I've had in my sights for five years now by presenting my #Sprout24 homebrew CPU at #Penguicon 2024. It went really well, and the geeky conversations that followed were just delightful.

One thing that everyone agreed on is that you can never have too many blinkenlights.

GlobalTalk has been a nice distraction, but back to the #Sprout24 CPU project.

Last night I tested my bodge for the Carry flag issue, and it works! This was a hard one to track down because I later discovered a *different* Carry flag bug in the emulator. So I was troubleshooting against a not-quite-right target for a while. The CPU and emulator are finally both working right *and* agreeing with each other now.

The adder simulator I shared last week proved really useful for testing and making sure all cases were doing what they should.

With that resolved, I'm also seeing that the Carry bug was masking a different issue that has something to do with the memory address bus getting unexpected values in some situations. I am not sure yet what is going on there, but it seems to have something to do with the stall cycle after a load/store/push/pop.

I at least have some test programs that will reliably trigger that mismatch, so hopefully I can track that down soon.

Each little bugfix is getting us closer...

Hey all, I made something neat to share with you. It's a web-based simulator of a CPU's adder circuitry that hopefully makes it easier to understand how binary addition, subtraction, and twos'-complement math work.

I couldn't find a decent online simulator that went into enough detail, so I made my own!

This is going to be part of a larger set of documentation and computer science learning materials based on the #Sprout24 CPU. But I'm so happy with how this piece turned out that you may as well play with it now.

https://www.sprout24.net/adder

CPU ALU Adder Simulator

A change to the clock timing on the status register completely solved the corruption issue for the Zero and Sign flags.

Another bug squashed, and one more left to see if its solution works! 🪲

#Sprout24

I forgot the term "hold violation", so it went into my notes as a "propagation race". I guess that works too.

Anyway, I have one of those to fix. The sign and zero flags on the status register aren't seeing their input data for quite long enough.

The carry flag issue was something else, and required just a few extra logic gates to change how the carry flag is calculated during subtraction operations.

It feels good to be squashing cpu bugs something fierce this weekend. :)

#Sprout24

I took a little break to play with #GlobalTalk, but there's progress and good news on the CPU development front too.

I can confirm that the two revised boards I ordered for the control unit and register file are working exactly as I hoped.

That means that conditional jumps and register writebacks are all working correctly now as far as I've been able to test.

Plus, I rewrote the main loop of the emulator to simplify it, and that's making comparing the states of the emulated and hardware CPUs a lot more straightforward to follow.

The only issue I'm still seeing is that the Carry and Sign flags seem to get set wrong in some limited situations, and I've isolated some test cases to help track those down. It seems to have something with how that flag logic takes the invert bit to the ALU into account.

I've got a little more than a month to file down the remaining rough edges, write some more demo programs, and finish putting my presentation together for #Penguicon. But I'm feeling optimistic! :)

#Sprout24

Oh, cool, I just got word that my program submission for #Penguicon was accepted! So it looks like I'll be doing a bit of an Intro to CS and showing off the #Sprout24 CPU on Friday, April 26th. 🌱

If you're near southeast Michigan, come on out and say hi! Registrations for my favorite open source nerdy hackerfest weekend are open now at https://penguicon.org 🐧

How it started vs. how it's going... a tale of two leap years.

The top is the first PCB I ever ordered, on February 29, 2020 —mere days before the world went into lockdown.

The second is a rendering of one of the boards I placed an order for today, February 29, 2024.

I think this is the universe's way of telling me I need to wrap this project up. #Sprout24

@larsbrinkhoff That story is legend. I couldn't help adding this to a recent project. #sprout24

I guess I should have tested this earlier, but it looks like there's an issue with the EI (Enable Interrupts) instruction. It's setting the interrupt flag correctly, but then it un-sets on its own at the next cycle.

I have a good idea where to find this one, though, so I'm hoping for an easy fix.

#sprout24