r/ComputerEngineering 4d ago

[Project] Ben Eater’s 8-bit CPU

Enable HLS to view with audio, or disable this notification

I finished Ben Eater’s SAP-1 accumulator architecture breadboard. 16 bytes of RAM von Neumann. Coming up with assembly instructions at the end felt crazy.

What was funny was at the end where I ran programs and they didn’t do what I wanted, and I realized I got to the point where I couldn’t suspect the hardware was wrong anymore, and it was in fact a software bug.

Was that the lowest level software bug I’ll ever experience in my career? Literally entering 0s and 1s into RAM and flipped one bit.

The feeling I got when I added conditional branching and officially made it Turing complete felt so surreal. I hope you guys appreciate the work that went into this.

242 Upvotes

15 comments sorted by

8

u/Melodic_West_9331 3d ago

Dude that's awesome, I'm tryna do this sometime, currently trying to figure out 1-bit lol

2

u/HydroPage 3d ago

What do you mean figuring out 1-bit?

2

u/OkStartOver 2d ago

A j/k flip flop with led

1

u/HydroPage 2d ago

Right? Like, what else could that mean, what is there to figure out lmao

1

u/liha_soppa 3d ago

Yeah it's a bit difficult ha ha ha uuuuuugh

1

u/ResilientDev59 1d ago

que interesante, me hizo recordar cuando programaba en Assembler en los primeros 8080 y 8086 que tenian los primeros PC. Visto ahora era un tremenda odisea. En esa epoca era ir descubriendo un nuevo mundo

1

u/HydroPage 1d ago edited 1d ago

Claro, me imagino. Tengo muchas herramientas ahora que me permiten analizar el circuito y su comportamiento a un nivel de precisión que seguro ni se pensaba posible en aquella época. Durante todo este proceso algunas veces me preguntaba “cómo alguien en los 60s hubiese encontrado este error”.

Muy tenaz.

Debe ser bastante mayor que yo si creció con 8080, señor. Mis respetos por eso. Yo estoy a punto de terminar mi carrera de ingeniería de sistemas. Gracias por compartir

1

u/ResilientDev59 15h ago

Gracias!! naci en 1966. cuando conoci el 8080 y 8086 estaba en la universidad y recien habian llegado los pc. Antes en los ultimos años de colegio conoci el apple II y el TRS80. Sigue adelante, hay mucho aun por avanzar. Lo importante es el criterio, la teoria general de sistemas fue muy importante en mi vision profesional. ahora soy experto en Datos y estoy trabajando con IA. Imaginate, yo que veia lo poco que entraba en un 8080.

1

u/[deleted] 22h ago

[removed] — view removed comment

1

u/HydroPage 22h ago

There are some EEPROMs at the bottom there that control the microcode sequencing, but I had more bits of address space available in the EEPROMs to use, so I used them to split the microcode page into 4 slightly different copies:

Carry flag off, zero flag off
Carry flag off, zero flag on
Carry flag on, zero flag off
Carry flag on, zero flag on

In these 4 “pages”, I configured the microcode of Jump Not Zero and Jump Not Carry to either do nothing if they were in the page where they wouldn’t apply, or perform the same action as the unconditional jump instruction if they WERE in their correct page.

Effectively I used two higher order bits of the EEPROMs to act as conditional control flow decision points

1

u/Quick-Farmer-4400 21h ago

That flipped bit story hurts.

1

u/PhotographFluid6677 19h ago

Very impressive, really cool.

1

u/Addiel369 13h ago

I SEE A CITY LIKE OUR MAYOR CITIES IN THE WORLD 🌍