explaingit

seblague/digital-logic-sim

4,563C#Audience · generalComplexity · 1/5Setup · easy

TLDR

A visual simulator for digital logic circuits where you place basic gates like AND, OR, and NOT and watch signals flow through them, created by Sebastian Lague as a companion to his YouTube series on how computers work from first principles.

Mindmap

mindmap
  root((digital-logic-sim))
    What it does
      Visual circuit simulation
      Gate-level design
      Signal flow display
    Tech Stack
      C#
    Use Cases
      Learn logic gates
      YouTube companion
      Circuit exploration
    Audience
      Students
      Beginners
      Curious learners
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Build and simulate a logic circuit from basic gates to see how components like adders or latches work before studying them in a textbook.

USE CASE 2

Use the simulator alongside the 'Exploring How Computers Work' YouTube series to visualise each concept as it is introduced.

USE CASE 3

Study the C# source code to learn how a visual logic circuit simulator handles signal propagation and custom chip composition.

Tech stack

C#

Getting it running

Difficulty · easy Time to first run · 5min

Pre-built downloads are available on the author's itch.io page, no compilation needed to try the app.

In plain English

Digital-Logic-Sim is a simple visual tool for simulating how digital logic circuits work. You build circuits by placing components and connecting them, and the simulator shows how signals flow through them. The project was created by Sebastian Lague as a companion to his YouTube video series called "Exploring How Computers Work," which explains how computers are built up from basic logic gates. The tool is intentionally minimal. It is not a professional circuit design application with a large library of built-in components. Instead, it focuses on the fundamentals: showing how basic building blocks like AND, OR, and NOT gates can be combined to create more complex behavior. This makes it useful for learning and demonstration rather than for production circuit design. Pre-built versions of the application for download are available on the author's itch.io page, so you do not need to compile the code yourself to try it. The source code is provided for those who want to understand how it works or contribute improvements. The author welcomes pull requests but has a clear preference for what gets merged: performance improvements, user experience fixes, and bug fixes are likely to be accepted, while new built-in chips or major feature additions are less likely to be merged. The README notes that some form of modding support is a future goal but has no concrete timeline. The README is short and does not go into technical details about how the simulation works internally.

Copy-paste prompts

Prompt 1
I'm using digital-logic-sim and want to build a half-adder from AND, XOR, and NOT gates. Walk me step by step through connecting the gates and verifying the truth table.
Prompt 2
I want to contribute a performance improvement to the seblague/digital-logic-sim project. How is signal propagation implemented in the C# codebase and where would I start?
Prompt 3
Using digital-logic-sim, how do I create a reusable custom chip from a combination of basic gates and save it so I can use it in larger circuits?
Open on GitHub → Explain another repo

← seblague on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.