r/ComputerEngineering • • Jul 24 '26

[Project] Ben Eater’s 8-bit CPU

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.

270 Upvotes

17 comments sorted by

8

u/Melodic_West_9331 Jul 24 '26

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

2

u/HydroPage Jul 24 '26

What do you mean figuring out 1-bit?

2

u/OkStartOver Jul 26 '26

A j/k flip flop with led

1

u/HydroPage Jul 26 '26

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

→ More replies (1)

1

u/ResilientDev59 Jul 27 '26

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 Jul 27 '26 edited Jul 27 '26

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

→ More replies (1)

1

u/[deleted] Jul 27 '26

[removed] — view removed comment

1

u/HydroPage Jul 27 '26

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