
Build an 8-bit computer from scratch - kmooney
https://eater.net/8bit
======
ObsoleteNerd
Ben Eater is without a doubt in my top 10 youtubers. His videos are so in-
depth and explained in such a great way that I come away learning huge amounts
every time he posts.

I’m sure a lot of this stuff is basic to people here, but to a software guy,
I’ve found his channel invaluable for understanding how computers work at an
electronics level and also just wildly fascinating.

~~~
fishingisfun
share some others like him. i would like to explore other youtubers

~~~
vikramkr
3blue1brown is an amazing intro to mathematics and does an amazing job
explaining hairy math concepts with great visuals etc

~~~
aswanson
Cosign. He's a fantastic explainer.

------
barefoot
Another great resource is NAND to Tetris (currently auditable on Coursera for
free):

[https://www.coursera.org/learn/nand2tetris2](https://www.coursera.org/learn/nand2tetris2)

~~~
opnitro
NAND 2 Tetris is great, I don't want to knock it at all, just want to
emphasize a difference between it and Ben Eater's content. NAND 2 Tetris
explicitly considers most electrical concepts out of scope, and abstracts them
away. Eater on the other hand, dives right into them. This isn't a complaint,
and it allows NAND 2 Tetris to focus on higher level concerns (such as writing
a compiler), but I thought it should be brought up.

~~~
dinofacedude
I did Nand2Tetris for my computer architecture class. Learned a lot!
Definitely recommended. It actually got me into assembly programming as a
hobby

------
retrac
For the last couple years I've been toying with a relay computer design. Only
a few prototype circuits have been built, but I do have (several) completed
designs. I'm cautiously optimistic... it should be the fastest relay computer
ever built, if I actually do build it. I have a whole bunch of reed relays on
hand but the boards (and construction time!) are still expensive for a project
of that size.

What fascinates me is that, even with a full design under my belt which works
in simulation, computation remains somewhat magical to me.

~~~
fernly
For historical background, read up on Konrad Zuse[1], who built possibly the
first programmable digital computer, using relays, the Z3[2], in 1941.
(Neither ENIAC nor Colossus were operational for another couple of years.)

There is a much later Zuse design, from discrete transistors, the Z23, in the
collection of the Computer History Museum[3].

[1]
[https://en.wikipedia.org/wiki/Konrad_Zuse](https://en.wikipedia.org/wiki/Konrad_Zuse)

[2]
[https://en.wikipedia.org/wiki/Z3_(computer)](https://en.wikipedia.org/wiki/Z3_\(computer\))

[3]
[https://www.computerhistory.org/collections/catalog/10266994...](https://www.computerhistory.org/collections/catalog/102669947)

------
mrspeaker
This series is truly excellent. Ben Eater is a brilliant teacher, and I wish I
have has this series growing up - I think I'd be in hardware/electronics
now... at the very least, I would have wasted a lot of time tinkering with
making my own stuff!

I followed along with the clock module and when I was done I had a Matrix
style "I know kungfu" moment - it all was crystal clear. And the series
doesn't brush over important details (like dealing with flaky inputs that
would cause extra clock pulses etc) so even though I still don't know all the
math needed for electronics, I'm far more confident in making my own stuff!

~~~
ObsoleteNerd
It’s channels like Ben Eater, Great Scott, Bitluni, and Andreas Spiess that
have gotten me into tinkering more with physical electronics lately.

It’s such an accessible hobby thanks to the abundance of online
information/ideas, cheap components, and simple tools. Plus you learn so much
even with the most basic of projects, and considering how much our world now
depends on electronics and technology, I think it’s practically useful as well
as simply entertaining to learn this stuff.

~~~
sitkack
Ben Eater,
[https://www.youtube.com/user/eaterbc](https://www.youtube.com/user/eaterbc)

Great Scott,
[https://www.youtube.com/user/greatscottlab](https://www.youtube.com/user/greatscottlab)

Bitluni,
[https://www.youtube.com/user/bitlunislab](https://www.youtube.com/user/bitlunislab)

Andreas Spiess,
[https://www.youtube.com/channel/UCu7_D0o48KbfhpEohoP7YSQ](https://www.youtube.com/channel/UCu7_D0o48KbfhpEohoP7YSQ)

~~~
ObsoleteNerd
Thanks, I should’ve linked them. Will remember to in future.

~~~
sitkack
No worries, happy to help.

------
zw123456
The first time I built a computer from scratch using TTL components was in
1978 for my senior project. I have repeated the effort a couple of times on
FPGA's. If you have never tried building your own computer from scratch, you
should, it is a great learning experience and also, kind of a lot of fun, I
guess if you are a geek which a lot of us on HN are :)

~~~
lnsru
That’s a project many generations of electrical engineering students did in
the university in Dresden. It was fun and great experience and admission for
final thesis. I think, it’s a must for every electrical engineer since
electrical systems barely exist without software nowadays.

------
transitorykris
I’ve been working through Ben’s videos on the 6502 since September. It’s been
a highly enjoyable way to relax and learn for me. It’s very easy to go beyond
what he’s teaching. There’s so much material out there (6502.org for
instance). The most rewarding for me has been taking the basics he gives on
address decoding and going beyond it.

------
laxd
Just started on a fun educational project to emulate a Z80 processor in C.
Trying not to look at any existing work, only documentation. Thinking I'll
need to expand the project (emulating the rest of an actual, vintage computer)
in order to run existing software and get the full kick out of it though.
Suggestions? Looking for simplicity as I don't need another forever-project.

Edit: asking because there's so many to choose from
[https://en.wikipedia.org/wiki/Category:Z80-based_home_comput...](https://en.wikipedia.org/wiki/Category:Z80-based_home_computers)

~~~
swiley
Be careful, if you haven't done this before or done much network programming
it's easy to get weird issues with endienness. Check out the ntohs etc.
macros.

IMO you should try to find a _really_ simple computer to do first. The
advantage here is you have other people's software to run which makes for a
nice integration test. My first time I did the original apple and had it run
the monitor program (which is nice you can just keep adding opcodes going up
from the beginning of the program until it works.) For the Z80 I think maybe
the ZX80 is the one where it was pretty much just a Z80, a ROM and SDRAM chip
and some glue logic?

~~~
codetrotter
Speaking of simple computers to emulate, Advent of Code 2019 featured an
imaginary computer that you gradually implement. (But do note that not all of
the days are about said imaginary computer.)

I am still catching up with it because I didn’t put so much time into it yet
but so far I have completed up to and including day 5 of AoC 2019.

For me, this is the first time I have implemented an emulator, and what I like
about this imaginary computer is that it is so simple that I was able to build
what I have built so far without relying on any external resources.

The fun part of it is working through it yourself of course, so even though I
am tempted to link to my implementation on my GitHub I will instead only leave
a link for AoC 2019.

[https://adventofcode.com/2019](https://adventofcode.com/2019)

------
Accacin
I've been meaning to do through his videos for a long while now and finally
over christmas I've managed to binge watch nearly all this series.

As a software guy currently doing the Embedded Systems course on edX, Ben's
videos have really helped solidify what I've read in the course.

Big example was tri-state drivers, after reading about them in the course they
hadn't quite clicked, and I searched YouTube and came across Ben's video. He
explained the concept so incredibly well, it clicked immediately and I've
found it a good companion for the course.

------
333c
I watched the whole video series in the last two weeks. I quite enjoyed it.

It suffered from my classes in that Eater actually deals with the minutiae of
working with real electricity — debouncing, clock edge detection, and so forth
— because he's building his CPU in the real world on breadboards. That was
interesting for me to see.

------
jedimastert
For anyone itching for more Ben Eater, he's currently working on a series
where he takes a 6502-type processor and turns it into a usable computer.

Here's the first video:
[https://www.youtube.com/watch?v=LnzuMJLZRdU](https://www.youtube.com/watch?v=LnzuMJLZRdU)

------
sircastor
I just recently found his videos for the 6502. I really wish I'd seen these
when I was going through my computing logic class. The text for that was
terrible, but these videos explain tremendously well for computers work.

------
dang
Two from 2017:

[https://news.ycombinator.com/item?id=14450945](https://news.ycombinator.com/item?id=14450945)

[https://news.ycombinator.com/item?id=14883776](https://news.ycombinator.com/item?id=14883776)

Related from a few months ago:

[https://news.ycombinator.com/item?id=20974405](https://news.ycombinator.com/item?id=20974405)

[https://news.ycombinator.com/item?id=20614129](https://news.ycombinator.com/item?id=20614129)

------
codedokode
The description says:

> I built a programmable 8-bit computer from scratch on breadboards using only
> simple logic gates.

Sorry, but this is slightly incorrect. First, he is using ready-made adders in
ALU which are not "simple logic gates", second he seems to use ROM in control
logic which replaces tens or hundreds of logic gates one has to use of they
don't have a ROM and a programmer.

If I was building a CPU, I would make 1-bit ALU and shift data bit-by-bit to
save ICs because 1-bit ALU requires 4-5 simple ICs and 8-bit ALU would require
8 times more and that's too much.

Next, I would use 4-bit registers instead of 8-bit because 8-bit register
requires 2 ICs and 4-bit register can be implemented with one IC. Also it
allows to reduce the number of wires and amount of work to connect them. This
makes CPU slower though because it has to access memory twice as often.

Also I was surprised to read in comments that in some universities students
are designing CPUs as a practical project. Must be interesting.

~~~
kjs3
Translation: I like to crap on other peoples accomplishments. I don't realize
that adders _are_ simple logic gates for the people who were actually there
when 7400 TTL was a new thing and building ALUs out of adders is one of the
oldest ways of building them (unlike "cheating" using a 74181, for example).
Or that using PROMs to replace logic is just as old. I propose my "better" way
of doing things that unlike the OP I'll never actually do, but I get to crap
on him. I'm so disconnected from reality (or went to such a low grade school)
I don't know that people actually learn how to build CPUs in school, as
opposed to this knowledge being imparted from mystical higher beings directly
into CPU architects skulls, or some such.

But mostly, I like to crap on other peoples accomplishments.

------
userbinator

        "You need to enable JavaScript to view this site."
    

I was expecting an interactive 8-bit computer simulation webapp, but all I got
was something that could've been several pages on a static site. More
disappointingly, it apparently requires a very "modern" browser to view :-(

In my experience, to see this sort of anti-accessibility from someone who
knows the "low-level" enough to build CPUs successfully is unusual, but
unfortunately getting more prevalent. The others I'm aware of,
[http://www.homebrewcpu.com/](http://www.homebrewcpu.com/) and
[https://www.bigmessowires.com/bmow1/](https://www.bigmessowires.com/bmow1/) ,
have far more accessible sites.

Edit: looks like others here think accessibility is not a concern anymore.
That's really disappointing, especially for low-level stuff.

~~~
schwartzworld
imagine finding such amazing content and then being mad that it was built with
modern tools.

what about the site violates accessibility? JS generated sites should be
usable on screen readers. you can violate accessibility, but you can do that
without js too

~~~
madez
Not everything modern is good or positive or even acceptable. JS is not
uncontroversial, for good reasons, both technical and political via its
influence on society.

Lamenting that it is used when there is no need for it seems reasonable to me.
The grandparent even made an effort to not just offer destructive criticism
but also constructive alternative approaches.

~~~
userbinator
Indeed, for me "modern" has become an overused buzzword with a negative
connotation --- well-deserved too, I think. What's really sad is that this is
an article about low-level stuff, and not some more "typical" topic like web
applications; I'd be far less surprised, though no less annoyed, if it was the
latter.

------
chrismmay
This project looks awesome, and I may purchase Ben's kit to do with my 7 year-
old son. My love of computers and software was largely inspired by the 6502
processor. I grew up with the commodore VIC20, C64 and 128 and reading books
by Rodnay Zaks in the 1980's.
[https://en.wikipedia.org/wiki/Rodnay_Zaks](https://en.wikipedia.org/wiki/Rodnay_Zaks)

Perhaps I should look to see if any of my old books are still at my Dad's
house. This one is going for nearly $1k on Amazon. Not sure how a book from
1981 can be sold as "new" but wow.

[https://www.amazon.com/Programming-6502-Rodnay-
Zaks-1981-09-...](https://www.amazon.com/Programming-6502-Rodnay-
Zaks-1981-09-03/dp/B01FKX0O8O/ref=sr_1_2?keywords=Rodnay+Zaks&qid=1577631949&s=books&sr=1-2)

------
TheBiffer
There is an iOS version of this at:
[https://apps.apple.com/ca/app/cpu8/id1448776028](https://apps.apple.com/ca/app/cpu8/id1448776028)

------
kjs3
I built a Z80 computer for my high school senior project in the early 80s. I
got CP/M mostly running; the floppy controller had some bugs I never quite
worked out. Pretty much started me on the career path I've taken.

I'm building a 68000 system now for fun. I know I'll never really understand
my desktop, so I'd like to have at least one computer in the house that I
really fundamentally understand.

------
m0xte
I am continually impressed that that number of breadboard connections actually
works for a lot of people. I never had such luck even with 3M boards.

