Skip to content
0:00 / 0:00

#logicgates#binary#alu

Exploring How Computers Work

Sebastian Lague

1.4M subscribers • 11 videos on Hallway

YouTube
  • Recommended by 2 people: 2 in engineering communities.
  • Presented by Sebastian Lague, game developer and educator
  • Linked in the descriptionSebLague/Digital-Logic-Sim

Beginner. No background in the topic needed.

4M views5 years ago2 recommendations

HardwareComputer scienceCPUs and computer architectureElectronicsMath for programmers

Sebastian Lague builds a digital logic simulator to explain how logic gates, binary addition, and ALUs work from first principles.

A little exploration of some of the fundamentals of how computers work. Logic gates, binary, two's complement; all that good stuff! Support my work (and get early access to new videos and source code) on Patreon or Nebula * Patreon: patreon.com/SebastianLague * Nebula: go.nebula.tv/sebastianlague Source code and Simulator download: * Simulation tool (work in progress): sebastian.itch.io/digital-logic-sim * GitHub: github.com/SebLague/Digital-Logic-Sim Resources and Inspiration: * youtube.com/c/BenEater * coursera.org/learn/build-a-computer * en.wikipedia.org/wiki/Two%27s_complement Chapters: Intro Logic Gates The Simulation Binary Numeral System Binary Addition Theory Building an Adder Negative Numbers Theory Building the ALU Outro Music: "A Quiet Place" by Jordan White "A New Perspective" by Ryan Smart "Beyond the Horizon" by Sounds Like Sander "Crystal Bursts" by Cody Martin "Air" by Assaf Ayalon "Elastic Vibe" by Ziv Moran "Gotcha!" by Avocado Junkie Images: en.wikipedia.org/wiki/Vacuum_tube#/media/File:8863-Project-W…

Why it's here

2 people recommend this

What people say. Widely recommended as an essential starting point for understanding computer hardware, logic gates, and how computers work from first principles.

u/itskandoin r/C_Programming • Recommends

What is the best way to learn C today — by way of From Nand To Tetris without programming knowledge? Reddit's oft asked What is the best way to learn C today comes with the consistent answer from @wsppan , which includes: 1. ~~Read~~ ~~Code: The Hidden Language of Computer Hardware and Software~~ 2. ~~Watch~~ ~~Exploring How Computers Work~~ 3. ~~Watch all 41 videos of~~ ~~A Crash Course in Computer Science~~ 4. Take the Build a Modern Computer from First Principles: From Nand to Tetris (Project-Centered Course) 5. \...\ Step 4: *From Nand to Tetris* is the first hands-on portion of the process. Projects 1-5 required no prior knowledge; however, projects 6 and 7 (and assumably later…

u/Mysterious_Nobody_61in r/compsci • Recommends

Watch computation emerge from first principles — building circuits in real time with Godot 4 I’ve been working on **SimuLogic** — a real‑time, gate‑level digital logic simulator built inside **Godot Engine 4**. Inspired by one of Sebastian Lague’s videos on circuit simulation, I wanted to create a platform where **computation emerges from first principles** — starting with basic gates and building up to complex systems in an interactive, visual way. **GitHub**: https://github.com/SinaMajdieh/SimuLogic **Core highlights:** - **True gate‑level simulation** with millisecond‑precision, event‑driven updates. - All advanced modules built entirely in‑sim — adders, memory units, multi‑digit…

u/Mysterious_Nobody_61in r/compsci • Recommends

Real‑time logic simulator built in Godot 4 — from primitive gates to complex circuits I’ve been working on **SimuLogic** — a real‑time, gate‑level digital logic simulator built inside **Godot Engine 4**. Inspired by one of Sebastian Lague’s videos on circuit simulation, I wanted to create a platform where **computation emerges from first principles** — starting with basic gates and building up to complex systems in an interactive, visual way. **GitHub**: https://github.com/SinaMajdieh/SimuLogic **Core highlights:** - **True gate‑level simulation** with millisecond‑precision, event‑driven updates. - All advanced modules built entirely in‑sim — adders, memory units, multi‑digit displa…

u/wsppanin r/C_Programming • Mentions

On “What is the best way to learn C today?”

I've posted this here before and it's what has worked for me an a few others who told me it worked for them as well. Ymmv. People sometimes struggle with C when they start from scratch or come from a higher to lower level of abstraction. I struggled with this for a long time till I did these things: I would not try and understand how the higher level abstractions translate to the lower C level. I would instead learn from first principles on how a computer works and build the abstractions up from there. You will learn how a CPU works. How the data bus and registers are used. How memory is laid out and accessed. The call stack and how that works, etc.. This will go a long way in understandin…

u/wsppanin r/C_Programming • Mentions

On “How to learn C in 2025”

I've posted this here before and it's what has worked for me an a few others who told me it worked for them as well. Ymmv. People sometimes struggle with C when they start from scratch or come from a higher to lower level of abstraction. I struggled with this for a long time till I did these things: I would not try and understand how the higher level abstractions translate to the lower C level. I would instead learn from first principles on how a computer works and build the abstractions up from there. You will learn how a CPU works. How the data bus and registers are used. How memory is laid out and accessed. The call stack and how that works, etc.. This will go a long way in understandin…

u/wsppanin r/C_Programming • Mentions

On “How do I start programming in C?”

Definitely start with the CS50 course. The knking book is an awesome textbook for learning C. I would also recommend following this Tutorial On Pointers And Arrays In C If you want to learn CS from first principles then: 1. Read Code: The Hidden Language of Computer Hardware and Software 2. Watch Exploring How Computers Work 3. Watch all 41 videos of A Crash Course in Computer Science 4. Take the Build a Modern Computer from First Principles: From Nand to Tetris (Project-Centered Course) You can also check out Teach Yourself Computer Science Here is a decent list of 8 Books on Algorithms and Data Structures For All Levels I would also recommend The Art of Computer Programming (TAOC…

u/wsppanin r/C_Programming • Mentions

On “Any bored older C devs?”

Start from first principles. Check out these resources: 1. Read Code: The Hidden Language of Computer Hardware and Software 2. Watch Exploring How Computers Work 3. Watch all 41 videos of A Crash Course in Computer Science 4. Take the Build a Modern Computer from First Principles: From Nand to Tetris (Project-Centered Course) 5. Take the CS50: Introduction to Computer Science course. 6. Grab a copy of C programming: A Modern Approach and use it as your main course on C. 7. Follow this Tutorial On Pointers And Arrays In C The first four really help by approaching C from a lower level of abstraction (actually the absolute lowest level and gradually adding layers of abstraction until yo…

u/wsppanin r/C_Programming • Mentions

On “Tips for a beginner.”

I would not try and understand how the higher level abstractions translate to the lower C level. I would instead learn from first principles on how a computer works and build the abstractions up from there. You will learn how a CPU works. How the data bus and registers are used. How memory is laid out and accessed. The call stack and how that works, etc.. This will go a long way in understanding how C sits on top of this and how it's data structures like arrays and structs map to this and understanding how pointers work the way they do and why. Check out these resources: 1. Read Code: The Hidden Language of Computer Hardware and Software 2. Exploring How Computers Work 3. Watch all 41 vid…

u/jskaufin r/compsci • Mentions

On “Digital logic simulator I made in Unity”

Hoping to fully simulate Ben Eater's 8 Bit Computer project soon. Inspired by Sebastian Lague's computer hardware series on Youtube ([video

u/wsppanin r/C_Programming • Mentions

On “Boomers of C, where can i learn most efficient C?”

1. Read Code: The Hidden Language of Computer Hardware and Software 2. Watch Exploring How Computers Work 3. Watch all 41 videos of A Crash Course in Computer Science 4. Take the Build a Modern Computer from First Principles: From Nand to Tetris (Project-Centered Course) 5. Take the CS50: Introduction to Computer Science course. 6. Grab a copy of C programming: A Modern Approach and use it as your main course on C. 7. Follow this Tutorial On Pointers And Arrays In C

u/wsppanin r/C_Programming • Mentions

On “I want to start learning C but don't know where to begin.”

I've posted this here before and it's what has worked for me an a few others who told me it worked for them as well. Ymmv. People sometimes struggle with C when they start from scratch or come from a higher to lower level of abstraction. I struggled with this for a long time till I did these things: I would not try and understand how the higher level abstractions translate to the lower C level. I would instead learn from first principles on how a computer works and build the abstractions up from there. You will learn how a CPU works. How the data bus and registers are used. How memory is laid out and accessed. The call stack and how that works, etc.. This will go a long way in understandin…

u/wsppanin r/C_Programming • Mentions

On “How to learn C for a noob ?”

I've posted this here before and it's what has worked for me an a few others who told me it worked for them as well. Ymmv. People sometimes struggle with C when they start from scratch or come from a higher to lower level of abstraction. I struggled with this for a long time till I did these things: I would not try and understand how the higher level abstractions translate to the lower C level. I would instead learn from first principles on how a computer works and build the abstractions up from there. You will learn how a CPU works. How the data bus and registers are used. How memory is laid out and accessed. The call stack and how that works, etc.. This will go a long way in understandin…

u/wsppanin r/C_Programming • Mentions

On “How long to be comfortable with C language and what it's need to accomplish that as fast as possible ?”

1. Read Code: The Hidden Language of Computer Hardware and Software 2. Watch Exploring How Computers Work 3. Watch all 41 videos of A Crash Course in Computer Science 4. Take the Build a Modern Computer from First Principles: From Nand to Tetris (Project-Centered Course) 5. Take the CS50: Introduction to Computer Science course. 6. Grab a copy of C programming: A Modern Approach and use it as your main course on C. 7. Follow this Tutorial On Pointers And Arrays In C The first four really help by approaching C from a lower level of abstraction (actually the absolute lowest level and gradually adding layers of abstraction until you are at the C level which, by then is incredibly high!)…

u/wsppanin r/C_Programming • Mentions

On “New developer beginning with C?”

I've posted this here before and it's what has worked for me an a few others who told me it worked for them as well. Ymmv. People sometimes struggle with C when they start from scratch or come from a higher to lower level of abstraction. I struggled with this for a long time till I did these things: I would not try and understand how the higher level abstractions translate to the lower C level. I would instead learn from first principles on how a computer works and build the abstractions up from there. You will learn how a CPU works. How the data bus and registers are used. How memory is laid out and accessed. The call stack and how that works, etc.. This will go a long way in understandin…

u/wsppanin r/C_Programming • Mentions

On “I want to learn C whitout any experience in programmation”

I've posted this here before and it's what has worked for me an a few others who told me it worked for them as well. Ymmv. People sometimes struggle with C when they start from scratch or come from a higher to lower level of abstraction. I struggled with this for a long time till I did these things: I would not try and understand how the higher level abstractions translate to the lower C level. I would instead learn from first principles on how a computer works and build the abstractions up from there. You will learn how a CPU works. How the data bus and registers are used. How memory is laid out and accessed. The call stack and how that works, etc.. This will go a long way in understandin…

u/wsppanin r/C_Programming • Mentions

On “Need advice..”

learn from first principles on how a computer works and build the abstractions up from there. You will learn how a CPU works. How the data bus and registers are used. How memory is laid out and accessed. The call stack and how that works, etc.. This will go a long way in understanding how C sits on top of this and how it's data structures like arrays and structs map to this and understanding how pointers work the way they do and why. Check out these resources: 1. Read Code: The Hidden Language of Computer Hardware and Software 2. Watch Exploring How Computers Work 3. Watch all 41 videos of A Crash Course in Computer Science 4. Take the Build a Modern Computer from First Principles: Fro…