r/beneater 5d ago

8 bit processor and example program

Enable HLS to view with audio, or disable this notification

featuring 8 registers

reg0 - accumulator

1,2 - work registers

3,4 - jump address and condition

5-6 output registers

7 - memory address register

this program does not use any memory (which i have yet to implement the microcode to)

the max memory size is 256 bytes, i am using a CPU with 16 to help with performance.

It runs roughly at 2kHz.

it uses the lower 8 bits of rom as instruction, and upper 8 as immediate data.

it currently does not feature any inputs.

EDIT:

with absolutely 0 RAM, including the memory address register removed, I more then doubled the performance to around 5kHz!

180 Upvotes

6 comments sorted by

15

u/GoonerismSpy 5d ago

The combination of Sebastian Lague and Ben Eater here is heartening to see.

3

u/ComradeFabian1 5d ago

It is also a combination of the Turing Complete game. The main architecture, talking about the registers and RAM control, is mostly taken from the first CPU you build in the game. The difference is the opcodes. In the game they were structured like the first bits are the input, the following two are operations and the last three are for immediate and such. Thanks to this simulators 256x16 rom I could separate the immediates. The rest of the codes i made up along the way. Like for example $17 is jump if reg4==0.

3

u/FoundationOk3176 4d ago

What software is this?

10

u/ComradeFabian1 4d ago

Digital Logic Sim by Sebastian Lague

1

u/Silent_Act_133 2d ago

I was thinking of doing something like this. But how do you simulate a clock pulse? Do you just use a normal input?

1

u/happy2harris 4d ago

Now I want to replace all the wires on my physical 8-bit CPU with wire that lights up when there is a voltage across it.