Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Digital Logic Sim

​A minimalistic digital logic simulator · By Sebastian Lague

Glitch???

A topic by GDMCAlex_I created 1 day ago Views: 33 Replies: 2
Viewing posts 1 to 3

I'm new to this software and I finished watching a tutorial on how to make a CPU that can carry out basic operations and store data. However I encountered a problem that I don't know how to fix. I have this 4-15 decoder that takes a 4-bit binary number and converts it to a specific output depending on the value of the number, and a clock that continuously increments the binary input. However, let's say I have this scenario: the input is currently 0111 (7). When it increments to 8, the game will silently toggle the inputs one at a time. First it toggles the 1s digit to form 0110 (6), then the 2s digit to form 0100 (4), then the 4s digit to form 0000 (0), then the 8s digit to form 1000 (8). This presents a problem, as the 6th and 4th output silently fire for a split second and messes the entire CPU up. Is there any work around, or if Sebastian Lague himself sees this, please fix it if you can.

The more components you use, the slower the simulation became. You need to find the perfect steps per clock tick for your project. More component= More steps per clock tick.
You can try to simplify by using less component. Create your chip via nand. Use ROM for decoder, 7 seg disp, etc...That's an 8-bits reg faster than the old ways.

That's a 3-bit op ALU(add/sub, bitwise operation and shift) and three flags.