[HN Gopher] Build an 8-bit computer from scratch (2016)
       ___________________________________________________________________
        
       Build an 8-bit computer from scratch (2016)
        
       Author : jcartw
       Score  : 371 points
       Date   : 2025-03-31 11:29 UTC (4 days ago)
        
 (HTM) web link (eater.net)
 (TXT) w3m dump (eater.net)
        
       | JKCalhoun wrote:
       | I always upvote Ben Eater's project(s).
       | 
       | I got his 6502 kit and worked through his YouTube videos to get
       | it up and running with LCD display and all. I want to actually
       | frame it and get it running, hanging on a wall.
       | 
       | If anyone is new to Ben, find a comfortable chair or couch, make
       | some tea, take a breath, and begin your descent into his long-
       | form breadboard series of nerd-splaining how a CPU works,
       | beginning with basic logic gates.
       | 
       | His follow-on series is a little higher level. He's still at it
       | with the breadboards but he allows that this time the CPU (a
       | 6502) is already built for us. He then walks through how the
       | address bus works, how to attach RAM, etc.
       | 
       | It makes me wish I could be transported back to the 70's when
       | things could still be understood.
        
         | enneff wrote:
         | His series on building a video adaptor is a particular
         | favourite of mine.
        
         | yoyohello13 wrote:
         | +1 for the 6502 kit. It's the perfect project. I think the full
         | 8-bit computer is kind of daunting. The 6502 is just big enough
         | to be a fun medium size project. Plus there is a perfect
         | extension project with the video card if you want to add that
         | on.
        
         | wvenable wrote:
         | I also did the 6502 and added a Pi Pico for VGA output and USB
         | input.
         | 
         | I'm still working on ways to add more to the design -- it's
         | been a fun hobby. I actually enjoy cutting the wires and
         | physically putting it together.
        
           | ninalanyon wrote:
           | If anyone wants to avoid adding a full scale computer just to
           | get TV out I recommend the late Don Lancaster's The Cheap
           | Video Cookbook and Son of Cheap Video.
           | 
           | See https://archive.org/details/donlancaster_socv1/page/n3/mo
           | de/..., https://annas-archive.org/isbndb/9780672217234
        
       | apricot wrote:
       | Ben Eater's breadboard CPU is a good way to learn the basics, but
       | since the focus is pedagogical, it's very underpowered for the
       | quantity of chips it uses (and you better enjoy forming wires).
       | For a much more powerful computer built around the same number of
       | TTL chips, see the Gigatron.
        
         | brucehoult wrote:
         | And no microprocessor!
         | 
         | But as I understand it the kits are no longer available :-(
        
           | apricot wrote:
           | Sadly, Marcel van Kervinck (one of the two creators of the
           | Gigatron) passed away in 2020. You can still buy PCBs on
           | Tindie, and the parts are easy to procure, it's all standard
           | 74HCT chips. You can find a detailed bill of materials on
           | gigatron.io, and the PCB files are there as well.
           | 
           | The one unavailable part is the fancy wooden box.
        
         | asdefghyk wrote:
         | RE .... See the Gigatron. Google link
         | https://www.google.com/search?q=Gigatron+CPU&oq=Gigatron+CPU
         | gives lots of good explanatory links . (I had never heard of it
         | , it looks quite interesting .... )
        
       | atum47 wrote:
       | I can trace back the moment I saw YouTube as a tool for learning
       | when I first saw your 8-bit computer series. I was honestly
       | amazed with the quality of the videos and how clear you can
       | explain things. Top content. I'm a subscriber and a fan to this
       | day. Keep up the good work.
        
       | roland35 wrote:
       | Building up a full CPU from logic was one of my favorite things
       | in university! The class was digital logic in the electrical
       | engineering department and was a lot of fun. We even got to write
       | machine code programs for it.
        
       | userbinator wrote:
       | _You need to enable JavaScript to view this site._
       | 
       | Nope. Why does this page need to be an interactive webapp?
       | Ideally it'd be viewable on the 8-bit computer you built from
       | scratch too.
        
         | edoceo wrote:
         | Yo. It's 2025. We don't need to rage at JS, a little sprinkling
         | is OK.
         | 
         | Also, can one do a TCP stack in 8 bits?
        
           | userbinator wrote:
           | _a little sprinkling is OK._
           | 
           | This isn't progressive enhancement, the page is completley
           | unreadable without running JS. It rather irks me that someone
           | who clearly knows about the basics of computing would do such
           | a thing.
           | 
           |  _Also, can one do a TCP stack in 8 bits?_
           | 
           | Yes. Lots of low-end IoT devices have an 8-bit MCU. Also,
           | this:
           | 
           | https://www.c64-wiki.com/wiki/Contiki
        
             | mechanicalpulse wrote:
             | The site was assembled using webpack and at least one
             | element has a `data-react-helmet` attribute, so my guess is
             | it's a React or React derivative such as Next.js. You're
             | right -- it's not progressive enhancement and it's not
             | necessary to present a simple tutorial.
             | 
             | Maybe there are other reasons, though? Maybe Ben wanted to
             | learn the framework? Maybe Ben wanted to integrate a
             | storefront and a comment section -- which he has done via
             | Shopify and Disqus -- and his choice of framework made that
             | easy due to the existence of official React libraries from
             | both vendors? Maybe Ben's using cloud-native serverless
             | deployment tools alongside his React application because
             | some of the derivative frameworks like Next.js do really
             | well at minifying, compressing, caching, and serving only
             | the content that's needed?
             | 
             | I can understand the purist argument -- I really can,
             | especially from a security standpoint given what we've
             | learned in the past few years about cache-timing side-
             | channel attacks -- but is it possible that Ben is simply a
             | fan of learning and he's as excited about building a web
             | application in React as he is about building an 8-bit
             | computer from scratch?
        
       | nabaraj wrote:
       | I tried something similar when in college. Built a 8bit GPU on a
       | breadboard, i don't remember all the details now, but it was such
       | a fun project.[1]
       | 
       | [1] https://nabraj.com/blog/8-bit-gpu/
        
       | brucehoult wrote:
       | Note that even the "Update" video is nine years old.
       | 
       | Also note that yes it's a computer, but it has 16 bytes of memory
       | to hold both the program and the program's variables.
       | 
       | BYTES. Not KB, not MB, not GB. Bytes.
       | 
       | The demo Fibonacci program is pretty much the most complex thing
       | you can do with it.
       | 
       | But it is in fact a genuine von Neumann computer. And
       | understandable.
        
         | johnklos wrote:
         | It feels almost more useful than BASIC on the Atari 2600, at
         | least.
        
           | brucehoult wrote:
           | The MOS 6532 RAM-I/O-Timer chip used by the 2600 (and KIM-1
           | and others) has 128 bytes of RAM. Game cartridges could add
           | 256 bytes more, along with the program ROM.
           | 
           | For an experience today closer to these machines, you can get
           | a $0.10 CH32V003 microcontroller with 2k RAM and 16k flash.
           | 
           | Here's a 1 Euro retro-computer kit using one that has
           | included in that price support for PS/2 keyboard and VGA
           | video output, all included in the 1 Euro -- even the
           | connectors! All from one 8 pin microcontroller chip:
           | 
           | https://www.olimex.com/Products/Retro-Computers/RVPC/open-
           | so...
           | 
           | https://www.youtube.com/watch?v=dfXWs4CJuY0
        
             | ninalanyon wrote:
             | That's astonishing. They must make a loss on every one they
             | sell. I bet they don't sell many though, they want 21 EUR
             | to send it to Norway!
        
               | brucehoult wrote:
               | Oh! I expected it to be cheaper shipping within Europe. I
               | live on completely the other side of the world (antipodes
               | of Spain or Casablanca to be precise)and it was a similar
               | price. I took 18, which doubled the overall cost compared
               | to getting just 1 (shipping was 30.92 EUR).
        
       | rs186 wrote:
       | I did the whole thing, was able to get the Fibonacci numbers
       | appear and learned a lot during the process. However, I would not
       | recommend other people to try this today, because --
       | 
       | * It is not necessarily the best way to spend your time and
       | money. You'll be looking at tens of hours on building it plus
       | over $300 in parts, for a very slow and basic computer that you
       | probably will forget and throw away at some point. Cutting and
       | laying out wires are some of the most tedious and frustrating
       | process. There are other cheaper, more efficient ways to learn
       | how a computer works. It may or may not be worth the effort to
       | you.
       | 
       | * The tutorial is really old, with some very questionable design
       | choices and no updates from the author. Some of the designs are
       | just plain wrong -- e.g. floating inputs or missing resistors. It
       | is very unlikely you can reproduce it by strictly following the
       | tutorial. You'll need to spend time debugging those issues and go
       | to reddit to see other people's experience with this, potentially
       | seeking help as well. No doubt debugging is an important part of
       | designing and understanding the circuit. But only if you have the
       | foundational knowledge and patience, of which I happened to have,
       | but I can imagine that someone who does not understand digital
       | electronics well enough can easily get lost and feel defeated.
       | 
       | * To make the previous point worse, some of the parts are hard to
       | source, depending on where you are. (You'll likely fry or
       | physically break a few components when building it.) Many of the
       | parts are not very commonly used these days, and not exactly easy
       | to acquire, if you only need 1 or 2 of them. I had to go to eBay
       | to get some of them, which took about a week, during which I had
       | to stop and wait for parts to arrive.
       | 
       | With all that said, this may still be the best resource out there
       | that lets you build all these on a breadboard, as I am not aware
       | of an alternative that addresses all the issues above.
        
         | stouset wrote:
         | I'll play devil's advocate.
         | 
         | Following Ben's videos and building the 8-bit CPU is the first
         | thing that ever helped me "get" electronics and circuitry.
         | 
         | Honestly, way more than half of the fun has been in finding the
         | design flaws and designing fixes for them as well as improving
         | and expanding the design itself.
         | 
         | I have learned _so_ much by going down rabbit holes. The
         | original clock design assumes a make-before-break switch but
         | the one shipped with the kit is the opposite, and this can put
         | one of the flip flops into an invalid state. I switched to CMOS
         | chips and learned why you shouldn't drive loads like LEDs
         | directly from digital outputs, and dove into the easiest way to
         | power 8 LEDs off 8 IC outs without a mess of transistors. I
         | followed another person's expansion to a full 8-bit instruction
         | register and a more featureful ALU (with my own changes of
         | course). I worked to minimize power consumption. I've learned
         | how to use an oscilloscope. I've improved upon nearly every
         | module, and built and rebuilt them all a handful of times.
         | 
         | None of this has any real benefit for the CPU. It will never
         | run anything more than toy programs. But that wasn't ever the
         | point.
         | 
         | All the flaws in the original design have been _perfect_ as
         | launching points for learning more and more.
        
         | bionsystem wrote:
         | As a side note, reading "But How Do It Know" for a total
         | beginner like me can help to scratch the itch of understanding
         | the basics. I really loved the book and will buy my 3rd copy
         | (lost one and gave away another).
        
           | asdefghyk wrote:
           | Another popular book "An introduction to microcomputers" by
           | Osborne, Adam, 1980 also has great detail on this topic.....
           | Its on the internet archive
           | https://archive.org/details/introductiontomi00adam/mode/2up
        
         | Lanrei wrote:
         | A game such as Turing Complete will give the same sort of
         | understanding of the fundamentals of computing, although not a
         | physical learning experience.
        
         | hydrolox wrote:
         | Although I haven't followed his project at all, one fully free
         | alternative which gives similar insight (how logic gates build
         | up to a full computer) is the nand2tetris[1] course. It starts
         | with just a nand gate and then creates all necessary components
         | to make a simple programmable computer, all simulated virtually
         | so you don't need any physical components.
         | 
         | 1. https://www.nand2tetris.org/
        
         | imglorp wrote:
         | An alternative might be to write or find a gate level
         | simulator, then write a library for each IC like hex inverter,
         | quad nand, etc. Then you could pick up where Ben starts at the
         | pin level, without messing with wires and breadboards, and get
         | much of the same understanding.
        
         | vhodges wrote:
         | Yeah, I started on it and felt the same so I built
         | 
         | https://git.sr.ht/~vhodges/cputhing
         | 
         | There's                 * https://nandgame.com/       *
         | https://github.com/logisim-evolution/logisim-evolution
         | 
         | too
        
         | Cthulhu_ wrote:
         | I was going to ask, is there anything like it where you can
         | build a physical computer out of discrete parts? but you
         | answered that in the last remark.
         | 
         | I would love a physical / homebuilt computer of sorts though.
         | Ideally with clicking switches or lights and the like.
        
           | jimktrains2 wrote:
           | https://m.youtube.com/channel/UCeRXQ_B5WZD3yjPly45myvg
           | 
           | This might be close, but I don't believe he offers a kit.
        
         | kevstev wrote:
         | I would be shocked if anyone is really looking for anything
         | practical out of this, its more of a lab exercise that lets you
         | learn by actually _doing_ things. I learn best this way. It 's
         | one thing to draw a circuit, or even put it in a simulator, but
         | the act of hooking up the chips, and watching the blinking
         | lights really sticks with me, and far more deeply ingrains the
         | concepts in my head. And while the 8-bit kit is expensive, and
         | time consuming, I found it worthwhile. There is probably a lot
         | more value to be had in the 6502 series though, if for no other
         | reason that the 6502 is iconic, and it was something of a
         | thrill to me to really understand at a basic level the chip
         | that powered the NES I spent so many hours with.
        
           | dowager_dan99 wrote:
           | and you might want more than 16 instructions in your
           | programs!
        
         | myself248 wrote:
         | Speaking as a down-in-the-dirt circuit-slinger who works
         | alongside a lot of ivory-tower engineers who couldn't diagnose
         | a loose wire if their life depended on it, I think that's the
         | whole point.
         | 
         | * Tens of hours and under $1000 is an extremely cheap route to
         | this level of understanding if compared against university
         | courses. I'd give my left nut to have my coworkers go through
         | this process.
         | 
         | * Cutting and laying out wires is time-consuming and error-
         | prone. Yup, hardware is like that. Sweeping out the dojo is
         | menial but important. Developing an intuition around when a
         | weird behavior might actually be a hardware problem, is
         | priceless and absolutely essential for any embedded engineer.
         | And you will never, ever get that from a simulator. (As much as
         | I love the ideas behind nand2tetris, it's entirely done in
         | simulation and that misses half the point, IMHO.)
         | 
         | * Sad to say, the outdated components thing is only getting
         | worse as more basic stuff goes out of production in favor of
         | more highly integrated components. (Even the epic VULCAN-74
         | caved and used modern RAM.) It might be possible to rework this
         | project to use newer parts but keep the educational value. I
         | suspect there's enough people who've pursued this project and
         | done bits and pieces of that, someone just needs to unify it.
        
         | kees99 wrote:
         | > just plain wrong -- e.g. floating inputs or missing resistors
         | 
         | TTL logic gates have no problem with floating inputs. Those are
         | interpreted as logic high. [1]
         | 
         | This is fairly self-evident from looking at a typical TTL gate
         | schematics. [2]
         | 
         | Some "TTL-compatible" CMOS parts (including 65C02) have
         | internal pull-ups on inputs, to match this quirk. [3]
         | 
         | Granted, it is a bad habit to develop, given that nearly all
         | "modern" logic (i.e. of past 30+ years) is CMOS with no "TTL
         | compatibility", and floating inputs _are_ a big problem there.
         | 
         | [1]
         | https://electronics.stackexchange.com/questions/683051/outpu...
         | 
         | [2]
         | https://upload.wikimedia.org/wikipedia/commons/thumb/d/d4/TT...
         | 
         | [3] https://wilsonminesco.com/NMOS-CMOSdif/
        
         | justin66 wrote:
         | > tens of hours on building it plus over $300 in parts
         | 
         | In other words, quite inexpensive.
        
           | ziddoap wrote:
           | To you, sure. To others, maybe not. Whether something is
           | expensive (in money or time) is relative.
        
             | justin66 wrote:
             | Relative to other hands on, high tech educational
             | experiences would be a smart way to think about it, if you
             | insist on adopting the _sucks in a long hit of marijuana
             | smoke_ "everything is just relative, mannnnn" attitude.
        
         | dowager_dan99 wrote:
         | Pretty strong disagree with your take (though seems like you
         | end with "this is a bad path with no viable alternatives"?).
         | Laying out the breadboards and wiring this has frustrations but
         | that's part of the experience. Same with the design choices;
         | one of the most valuable things my most-digital of minds
         | learned was that you can never escape the analog world
         | completely. I don't think you should be looking for cheap and
         | efficient in this realm, but what I did to source everything
         | was make a big ali express order about 3 months before I
         | planned to tackle this (over a Christmas/winter break),
         | sometimes ordering the same part from multiple suppliers, and
         | then forgot about it, until the packages started to trickle in.
         | You probably already have a lot of the basics, so you can do
         | this for < $200 pretty easily. Meanwhile I completed the NAND
         | to Tetris project, which was very complimentary. I didn't find
         | any parts particularly hard to source and have more basic gates
         | than all ever use.
        
           | rs186 wrote:
           | You are free to disagree. The project took me way longer than
           | I expected, and while it (building the whole thing) was fun,
           | the experience barely helped deepen my knowledge of
           | electronics or computers -- the videos themselves were
           | already very educational. I wouldn't have done it if I had a
           | better idea of what I was getting into, but anyone can make a
           | different choice if they value their time and money
           | differently.
        
         | codedokode wrote:
         | $300 is somewhat inflated estimate - for example, the
         | breadboard's price is estimated as $4-$9 but I usually buy
         | breadboards at $1.5 each (well, there is a warning that they
         | might be worse quality but I am not used to expensive
         | breadboards so don't notice any issues and I don't care if they
         | are slightly different shade of white).
        
       | schoen wrote:
       | Wasn't there someone who did a physical discrete logic
       | implementation of the NAND to Tetris design?
       | 
       | I feel like that could be a good choice for someone doing this
       | today because there's now a kind of a large ecosystem of
       | resources for that design (not that it's inherently better
       | somehow).
        
         | hydrolox wrote:
         | yep https://youtu.be/L-azf9ecvfo
        
       | markshares wrote:
       | Check this yt channel out:
       | https://youtu.be/ENlcDdyUHC8?si=cq7zob46DX-oRRaj
        
       | markus_zhang wrote:
       | I kinda judge YouTube channel by the inverse of the speed I need
       | to scale down/up.
       | 
       | Ben Eater is always among the top 10.
        
       | ata_aman wrote:
       | Always love seeing Ben Eater's "build [X] from scratch" His
       | YouTube is one of the best channels to understand how stuff works
       | from fundamental building blocks.
        
       | revskill wrote:
       | The finbonacci on this computer should be faster than rust.
        
       | tsurba wrote:
       | If figuring out how computers work starting all the way from
       | logic gates interests you, but you don't want to start by
       | ordering parts and soldering, check out the "game" Turing
       | Complete.
       | 
       | Of course it's not the same thing as actually building the
       | electronics! But it can be a nice introduction.
        
       | charcircuit wrote:
       | It would be more efficient to implement this with an FPGA. An
       | FPGA will scale with more complex designs.
        
       | nanolith wrote:
       | The Ben Eater computer is an interesting starting point. With a
       | few modifications, such as an extended program counter / address
       | bus, a combinatorial ALU programmed in flash, and a few more
       | registers, it can be upgraded to a more powerful, if slow,
       | computer.
       | 
       | Further, these circuits can be directly simulated in an FPGA if
       | you want to teach yourself an HDL like VHDL or Verilog. You
       | really want to learn better and faster ways to organize a CPU,
       | but it's a fun way for a beginner to bridge into this kind of
       | work.
       | 
       | At the local hackerspace, we actually taught a class that
       | assembled a hybrid 8-bit / 16-bit variation of this computer with
       | 1MB of RAM, an 8-bit ALU, a 16-bit data bus / registers, and a
       | 20-bit address bus. With this additional capability, we could
       | program it over serial with a very basic bootloader, and it was
       | powerful enough to compute pi to 1000 digits. Granted, this took
       | about 18 hours, but it could have run faster with a printed
       | circuit board and a crystal oscillator. We just never really got
       | to that point.
       | 
       | As for how powerful such a computer with discrete logic can be,
       | consider that the KB-11A CPU for the PDP-11/45 was built using
       | 74-series logic ICs. It wasn't until after this system that DEC
       | moved on to VSLI. So, this is a way to play with technology found
       | in computers in 1972 / 1973.
       | 
       | As a stepping stone to digital logic and FPGA work, Ben Eater's
       | tutorial isn't bad. Just get yourself a copy of Don Lancaster's
       | TTL Cookbook or CMOS Cookbook to bring his tutorial up to best
       | practices.
        
       | giulianopz wrote:
       | It is a rite of passage, as electronics wizards say. I remember
       | at least another good example shared in the wild:
       | https://github.com/vascofazza/8bit-cpu
        
       | Simon_O_Rourke wrote:
       | I'm a big fan of all the builds and videos Ben Eater puts
       | together, I've learned more watching his demos than a couple of
       | years doing hardware design in college.
        
       | asdefghyk wrote:
       | RE "....Cutting and laying out wires are some of the most tedious
       | and frustrating process....." I would be investigating to use
       | wire wrap. I built some circuits using wire wrap, back in late
       | 70s ,early 80s. I designed and built a circuit on a wire wrap
       | prototype board to put a 68008 DIL chip on the Apple II bus. I'm
       | not sure of the cost of wire wrap parts now - may be quite
       | expensive , the special wire wrap sockets etc .....
        
       | asdefghyk wrote:
       | Another "interesting" thing to do with this project is build it
       | in a "Digital Logic Simulator"
        
       | miunau wrote:
       | James Sharman has been getting quite advanced with his homebrew
       | cpu. He's got audio and VGA working too and was demonstrating a
       | spinning 3D cube recently. https://www.youtube.com/@weirdboyjim
        
       | Pixelious wrote:
       | Love me some "Ben Eater does this and crushes it"
        
       | gsibble wrote:
       | I built this kit. It was a lot of fun but very tedious. I also
       | have a computer engineering degree so I didn't really learn much.
       | It was fun to show to people though.
       | 
       | If you don't understand what a register is for example though, OH
       | MAN. You'll love this!
        
       | DeathArrow wrote:
       | I wonder how would it compare to an old 8 bit CPU like 6502 or
       | Z80.
        
         | compiler-guy wrote:
         | It is vastly underpowered and has a huge bill of materials
         | compared to those chips. It only supports 16 bytes of memory,
         | has an impoverished instruction set, is slow as molasses, and
         | tends to be very flaky.
         | 
         | Even as a pure-ttl building exercise, it trades off efficiency
         | and usefulness in favor of understandability and fancy
         | blinking-lights so you can see what is happening.
         | 
         | It is useful only for toy programs at the most.
         | 
         | But as a learning exercise it is absolutely first rate. 10/10
         | would recommend.
        
       | Jun8 wrote:
       | Ben's videos are fantastic, learned a lot. For HW beginners like
       | myself I suggest to skip the computer but just build the clock -
       | very easy and great testing tool!
       | 
       | Here's my question: Obviously there's tremendous interest in kits
       | like this. Why doesn't Ben or someone else create small company
       | to:                 * Modernize the components        * Update
       | the videos       * Add additional modules to make the computer a
       | bit more powerful
       | 
       | People would pay money for this. I would.
        
         | dowager_dan99 wrote:
         | Isn't this essentially what Sparkfun and Adafruit do? There's
         | very little margin in the components & kits, and the market is
         | very tiny. Also if you're looking to make this computer "more
         | powerful" you should look at something else. The specs for this
         | are a toy computer, barely enough to demo the basic functions.
        
       | codedokode wrote:
       | Just wanted to add that there is "a homebrew computer ring"
       | project [1] and you will be surprised how many ideas for DIY
       | computers you can find there.
       | 
       | (I also made a two-breadboard CPU with ~5 instructions myself but
       | had yet no time to finish the software)
       | 
       | [1] https://www.homebrewcpuring.org/
        
       ___________________________________________________________________
       (page generated 2025-04-04 23:01 UTC)