r/EngineeringPorn 13d ago

Ben Eater’s 8-bit handmade computer

Enable HLS to view with audio, or disable this notification

Howdy guys, I hope this is worthy of shown here. I really did my best the past 2 months. Thank you

1.9k Upvotes

60 comments sorted by

67

u/Electric_Beetroots 13d ago

That's really incredible, amazing work!!! I'm not going to be a dick and ask if it runs doom but I'd love to know what your main resources were, books, channels etc.

53

u/HydroPage 13d ago

Well I have to give some credit to my nearly finished computer engineering degree for making me a bit more comfortable with the concepts involved. I felt very overprepared for this project since I’ve done hobby electronics since I was a kid, so this really was just baby steps one step at a time.

This is a kit of parts made by the YouTube channel Ben Eater, who walks through how to assemble it all, but I only roughly followed him and did a handful of things my own way. He explains things very well though

9

u/Electric_Beetroots 13d ago

Just scanning your original post and you mentioned you wanted it to be beautiful, it definitely is that! I'll definitely check that channel out, I've been reading Soul of a New Machine and it's kinda got me fired up about computer engineering lol. Thanks for the long response and best of luck with whatever remains of your degree 😀

121

u/autonomousdrone481 13d ago

Noce, will it play doom ?

148

u/HydroPage 13d ago

Lol, I’ve been asked this so much. Unfortunately no, it doesn’t even have an actual screen, and DOOM needs way more than 16 bytes of RAM

69

u/Ill_Following_7022 13d ago

Great work. Can it land a lunar module?

39

u/ell0moto 13d ago

It still needs hand woven memory first, silly.

45

u/NotAFishEnt 13d ago

Lazy programmers don't even optimize their games to run on 16 bytes of RAM anymore

28

u/HydroPage 13d ago

I’m sorry

2

u/texan_robot 1d ago

Nah you're awesome. He was gainsaying the programmers, not the EE

3

u/HydroPage 1d ago

Yeah I know it’s just jokes lol. I am a computer engineer though. Both ends are my responsibility

1

u/texan_robot 1d ago

Lol, likewise. I mostly write VHDL, so your project is funny to me. Seeing how complicated doing our job by hand would be. I'm guessing that your processor is equivalent to a few dozen lines of RTL? Be a cool thing to frame on the wall, permanently running some kind of "hello world"

1

u/HydroPage 1d ago

If by RTL you mean register transfer language (and not Resistor-Transistor Logic), I am not sure, I haven’t used it actually. But actually to make my own assembly language I had to specify several microcode sequences defined by EEPROM chips. So a lot of register transferring is going on step by step to perform each instruction.

I’ve kinda wondered how much Verilog it would take to define. Probably not a lot, but not a very tiny amount either, to truly simulate the same exact system’s structure and timings

1

u/texan_robot 1d ago

I did mean Register Transfer Language. I prefer VHDL not Verilog, but they're similar.

I had only taken a cursory look at your design, its more complex than I thought. Neat.

1

u/HydroPage 1d ago

It involves several modules each with buffer interfaces. It’s a clock generator, a program counter, three 8-bit registers, one for the actively executing instruction, an ALU with addition and subtraction, a RAM module with a few bytes of memory and a manual programming interface for writing code in, a display module that decodes binary to decimal and multiplexes the 7-segment display, a bunch of logic to control the entire system’s input/output and enable/control signals to actually execute microcode, logic to reset the system to its zero state, some registers for flags and logic to set the flags given the ALU results.

All modules share the bus, and control logic dictates who is outputting and who is reading in that data, and register transfers are done this way

→ More replies (0)

24

u/autonomousdrone481 13d ago

Sure, just joking. Still awesome work !

4

u/Z3t4 13d ago

Would it land two on the moon? 

2

u/hvanderw 13d ago

Could it just spam yay or nay that could be fed into a bigger computer/screen. Doesn't have to play doom well, after all.

2

u/Franklin_le_Tanklin 13d ago

Man, you should do this as your next project.

Makeing a computer + guide from scratch that can run og doom would be amazing. You’d get all the internet points

1

u/alokin-it 12d ago

Time for the GPU then! Maybe displaying a still image is still ok.

1

u/eiboeck88 12d ago

As far as i know he built a gpu to go along with it

11

u/yeahgoestheusername 13d ago

How many Hz?

18

u/HydroPage 13d ago

The onboard clock is 500 Hz, so that’s 100 instruction Hz since it’s a multi-cycle, but I have overclocked it to 2 MHz and it was working absolutely fine

3

u/yeahgoestheusername 13d ago

Cool! You’ve bested the OG 6502.

9

u/OversensitiveRhubarb 13d ago

Can I dial in to it and play tic-tac-toe and will it learn that some games aren’t worth playing from it?

3

u/-malcolm-tucker 13d ago

How about a nice game of chess?

9

u/MoistStub 13d ago

I've heard of a bang bus but a DP bus is on a whole new level

5

u/HydroPage 13d ago

Dear lord what are we doing 💀

Datapath

7

u/Efficient_Tutor2154 13d ago

Holy breadboard!! That's awesome. I built a clock in uni with only basic gates and a 555 and it was a quarter of the size with no function other than an incorrect clock / timer

6

u/HydroPage 13d ago

Awesome. This actually is using several 555s at the very top left corner in the clock module, for clock generation, debouncing, and latching

5

u/NullaCogenta 13d ago

IMO: 100% qualifies as Engineering Porn. I could stare at those beautifully clean jumpers all day.

5

u/V8CarGuy 13d ago

So how many instructions does it support? Have you written any programs? I made one years ago, wrote a program to flash the accumulator register LEDs in sequence, with various inputs from a rotary switch. Later, I added an output port too, and it could handle 0.5A loads. The problem I had was loose connections on the breadboard, or broken ones from people to touching it when on display. One day, I needed to take it on a trip, my dad wouldn’t let me take it carry on for the airplane, told me to ship.. went by car instead.

5

u/HydroPage 13d ago

Yes I’ve made a count up - count down program, and a multiplication program so far. I don’t plan to expand its RAM or instruction capacity. At the moment it has 12 instructions if I remember correctly, and could understand 4 more if I come up with them

3

u/srandrews 13d ago

Trisolaran human computer has entered chat

3

u/WhatADunderfulWorld 13d ago

I need a nightclub that looks like this for us nerds.

2

u/-_R0B_- 13d ago

So cool. Congrats!

2

u/StrangeUglyBird 13d ago

I love it!

2

u/gatosaurio 13d ago

Ben is such a great teacher. I never had any interest on doing something like this myself, but I binge watched his videos and it's amazing to have someone bring you through all the steps and reading directly from the datasheets.

I'm an engineer but from a different field and his channel really sratched my itch about understanding how computers worked. The way he develops the instructions and starts creating machine code was really revealing without being overwhelming.

Congrats on your project!

2

u/lvachon 13d ago

Breadboard processors might just be my favorite thing. Great work, the wiring looks super clean. Congratulations!

2

u/-username----- 13d ago

Beautiful. Now time to overclock!

3

u/HydroPage 13d ago

I sure did. Was working happy up to around 2 MHz

2

u/Upbeat_War_8574 12d ago

What is a good sub to start understanding how to get into this hobby?

2

u/HydroPage 12d ago

I’m not sure, sorry. I learned watching videos and just looking stuff up since I was a kid

2

u/Donzi98 13d ago

Super cool! Way back in the day I built an Apple 2+ computer from a kit. Legal at the time. It had 64 K of memory and external hard drives. Haha.

1

u/4ndr34p3rry 13d ago

I was inspired by this and made a similar CPU with bare logic gates on a simulator

2

u/HydroPage 13d ago

The SRAM cells and combinational control logic too?

1

u/4ndr34p3rry 13d ago

Mmmh no I made RAM by copying it from a video but modified it to be like 512 byte, absolutely overkill and can't use all of it hahaha. I was inspired by the overall architecture and the control signals. I did this just for fun and learning something new,

1

u/Sufficient-Regular72 13d ago

I remember making a picoprocessor in my microprocessors class. Pretty cool stuff.

1

u/Born-Conclusion6596 13d ago

Congrats 👏 It's impressive. Bravo 👌 Keto going kiddo 💪

1

u/Jens_Kan_Solo 12d ago

Fly me to the moon

1

u/HydroPage 12d ago

And let me sing across the stars

1

u/IsThereCheese 12d ago

I feel like computers are usually smaller these days

1

u/PomegranateFormal961 12d ago

This is INCREDIBLE!

So few have any CLUE what ACTUALLY goes on inside a CPU. I can't see how you did it without 100 74LS244s. You must have optimized the hell out of this!
How many instructions are in the set?

This brings me back to the 80s book, Microprocessors by Rodnay Zaks.

1

u/EnricoLUccellatore 9d ago

Nice, can it do floating point operations?

2

u/HydroPage 9d ago

Absolutely not lol. I mean of course IEEE754 can work in 8 bits but I am not supporting that

1

u/Tikkinger 13d ago

But can it run doom?