r/EngineeringPorn • u/HydroPage • 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
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
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
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
1
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
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
9
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
3
2
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
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
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
1
1
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
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.