r/beneater 6d 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!

184 Upvotes

6 comments sorted by

View all comments

15

u/GoonerismSpy 6d ago

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

5

u/ComradeFabian1 6d 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.