Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Digital Logic Sim

​A minimalistic digital logic simulator · By Sebastian Lague

"ZHT80" 8-bit Computer

A topic by Zhatt created 52 days ago Views: 403 Replies: 6
Viewing posts 1 to 3
(1 edit) (+2)

The "ZHT80" is my project computer I've been building as I follow along Sebastian's and Ben's video series. So far it is essentially the same as Ben's 8-bit breadboard computer, but with my own solution for instruction memory and lookup.

I'm trying to keep the design as clear and understandable as possible while still keeping it compact. I'm also minimizing the number of nested layers inside chips so its easy to see what is going on internally.

As I'm not a programmer, I built a instruction compiler in Google Sheets. I can set the micro instructions then copy the export column into the micro instruction ROM. I'm still figuring out how I can add flag bits to this spreadsheet without making it overly complicated. Once I set up more instructions I'll create a program compiler in another tab.


Things I still plan to add:

  • Flag register and flag instructions (Turing complete)
  • Instruction compiler spreadsheet
  • Error message on display
  • Keypad for manual entry
  • Signed integers (the display has a toggle, but it's not connected)
  • Dot display

I'm considering reducing the micro steps from 5 to 4. That would make processing quicker and give me room for more instructions, but would require adding explicit instructions for moving data between registers. I'm not sure which would be more efficient ultimately.

Once I add flags and ram, I'll record a video for Seb's playlist. I can also share the spreadsheet and project files.

Here's a video of my computer. It's calculating the Fibonacci sequence, and once it overflows the numbers turn red and the program restarts. It is running quite efficiently. This is partly due to minimal nesting of chips, but I also trimmed the microinstructions down to 4 instead of 5. The clock-synchronized flip-flops in the counters means it rarely runs into errors.

I skipped adding RAM to the system mostly to make programming it easier, but you could easily replace the memory ROM with RAM. I also didn't add a flag registry and just fed the carry bit directly into the instruction register.

Here are the project files and operations if you want to experiment with it. (I just realized that in the video the steps are counting to 5, but I've fixed that in the files)

After making this system, I'm really starting to bump into the limitations of an 8-bit system, such as 4-bit address allowing for only 16 memory locations. I'm tempted to make a 16 bit system next.

You can just use 2 8-bit inputs for 16-bit input

Yes, I started making a 16 bit system but realized it's not necessary. It would just make things more complicated for the level of code I want to run.

(1 edit)

I have given my computer a rework and am coaxing it to play pong. Check out the video:

The major elements done, but I'd like to add some flair to it, such some sort of graphic shown when you score, and score keeping. The issue is I'm running on the edge of speed for what is playable. Adding too much more will make it too slow.

Once I've added a few more features and cleaned up the wiring, I'll give a proper video tour.

Developer

That's looking great, really cool work! If you want to upload the latest files, I'd be interested in using it as a test case for some optimizations.

Thanks! I've emailed you the project files directly. I'd like to add a few more features and clean it up before I release it publicly.