HackerTube
HomeLongsLikedHistoryWatch laterCategoriesPlaylistsSettings

8-bit CPU control logic: Part 1

Ben Eater3 HN recommenders · recommended in 3 months, 2017-2023
YouTube
1.5M views · 9 years ago · tutorial · evergreen

Ben Eater writes a program in a made-up machine language and walks through the control logic an 8-bit breadboard CPU needs to execute it. It is part of his build-an-8-bit-computer series.

Recommended as the key video for understanding control logic and microcode.

Computer architecture & CPUsElectronics & circuit design#beneater#microcode#8-bitcomputer#breadboard#machinelanguage

4 comments from Hacker News

@pests2023 · in “Undocumented 8086 instructions, explained by the microcode”

Ben Eater on YouTube has recreated an 8-bit computer on breadboards. ▶ this video That is the start of the videos where the control logic gets microcoded. Its pretty basic but over the next few videos he comes up with about 10 different OPCODES and programs their microcode (a series of control logic activations). Its pretty amazing to see it all come together and work in the end.

RecommendsView on HN
@dkersten2023 · in “AMD ymm registers are rolling back”

I found these Ben Eater YouTube videos very useful to understanding what microcode is and how it works: 8-bit CPU control logic ▶ this video 8-bit CPU reprogramming microcode link In short, the microcode instructions are a bunch of flags that enable different parts of the processor during that clock cycle (eg is data being loaded off the bus into a register? Is the adder active? Etc), so to implement an instruction that says add value from memory a to value from memory b and store in memory c, the microcode might be: copy memory a onto bus, store bus to register, copy memory b to bus, store b to register, add both register and put result online bus, store value on bus to memory c. (In a hypothetical simple cpu like the one Ben built, a real one is obviously much more sophisticated). So in Ben’s toy CPU, the instructions are just indices nto an EEPROM that stored the control logic but pattern “microcode” for each instruction, and IIRC each instruction takes however many cycles the longest instruction requires (in real life that would be optimised of course). This is also how some processors like the 6502 have “undocumented” instructions: they’re just bit patterns enabling parts of the processor that weren’t planned or intended. So you can see that it may be possible to fix a bug in instructions by changing the control logic in this way, even though the actual units being controlled are hard wired. I guess it very much depends on what the bug is. Of course I only know how Ben’s mi

RecommendsView on HN
@dkersten2021 · in “6502 “Illegal” Opcodes Demystified”

Yeah, it was my understanding that the opcodes directly encoded what we would nowadays call microcode, that is, bits which selected which CPU component acted on which data[1], so these illegal instructions are just unused bit patterns that select various operations just by having those bits set, not something that was ever intended to be actually used. So it would make sense that they're not documented, since they're entirely incidental. [1] ▶ this video

CitesView on HN
@bogomipz2017 · in “Build an 8-Bit Computer from Scratch”

This is really amazing. In addition to the interesting project this individual has a great gift for articulating everything in a concise manner and with a very pleasant cadence. What a great teacher. Thanks for sharing. I'm looking forward to seeing the rest of this series. If you only have a limited amount of time I would highly recommend the control logic video: ▶ this video

Strongly recommendsView on HN
8-bit computer update6:53

8-bit computer update

Ben Eater
2.8M views • 10 years ago
Why build an entire computer on breadboards?28:43

Why build an entire computer on breadboards?

Ben Eater
3.4M views • 6 years ago
“Hello, world” from scratch on a 6502 — Part 127:25

“Hello, world” from scratch on a 6502 — Part 1

Ben Eater
5.9M views • 7 years ago
Making logic gates from transistors13:02

Making logic gates from transistors

Ben Eater
3.1M views • 11 years ago
Chuck Moore's Fireside Chat 20111:00:34

Chuck Moore's Fireside Chat 2011

GreenArraysInc
6K views • 14 years ago
So how does a PS/2 keyboard interface work?33:07

So how does a PS/2 keyboard interface work?

Ben Eater
570K views • 5 years ago
"Programming a 144-computer chip to minimize power" - Chuck Moore (2013)40:13

"Programming a 144-computer chip to minimize power" - Chuck Moore (2013)

Strange Loop Conference
19K views • 5 years ago
[7] Jim Keller, Silicon Wizard 🧙‍♂️1:37:12

[7] Jim Keller, Silicon Wizard 🧙‍♂️

TechTechPotato
67K views • 5 years ago
The world's worst video card?32:47

The world's worst video card?

Ben Eater
7.1M views • 7 years ago
How does a USB keyboard work?34:15

How does a USB keyboard work?

Ben Eater
3.8M views • 5 years ago
John Hennessy and David Patterson 2017 ACM A.M. Turing Award Lecture1:19:38

John Hennessy and David Patterson 2017 ACM A.M. Turing Award Lecture

Association for Computing Machinery (ACM)
150K views • 8 years ago
KiCad 6 STM32 PCB Design Full Tutorial - Phil's Lab #651:40:06

KiCad 6 STM32 PCB Design Full Tutorial - Phil's Lab #65

Phil’s Lab
987K views • 4 years ago
Sophie Wilson - The Future of Microprocessors46:36

Sophie Wilson - The Future of Microprocessors

Erlang Solutions
57K views • 9 years ago
World's worst video card? The exciting conclusion24:23

World's worst video card? The exciting conclusion

Ben Eater
3.2M views • 7 years ago
Jim Keller: Moore's Law, Microprocessors, and First Principles | Lex Fridman Podcast #701:34:44

Jim Keller: Moore's Law, Microprocessors, and First Principles | Lex Fridman Podcast #70

Lex Fridman
742K views • 6 years ago
My old BBC Micro system27:49

My old BBC Micro system

mikeselectricstuff
70K views • 9 years ago
The Mill CPU Architecture - the Belt (2 of 13)1:26:50

The Mill CPU Architecture - the Belt (2 of 13)

Mill Computing, Inc.
38K views • 13 years ago
Megaprocessor Tour 1 - (fixed audio)5:15

Megaprocessor Tour 1 - (fixed audio)

Megaprocessor
479K views • 10 years ago
Building a 6800 CPU on an FPGA with nMigen (part 1)24:46

Building a 6800 CPU on an FPGA with nMigen (part 1)

Robert Baruch
27K views • 6 years ago
Jim Keller: Moore’s Law is Not Dead1:04:53

Jim Keller: Moore’s Law is Not Dead

UC Berkeley EECS
77K views • 7 years ago