Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Digital Logic Sim

​A minimalistic digital logic simulator · By Sebastian Lague

Gigabytes of RAM are now possible

A topic by JustAdy created Apr 18, 2025 Views: 2,380 Replies: 15
Viewing posts 1 to 7
(+1)

So i got an idea for RAM that uses RGB displays. Because you can read and write a 8b value (using two colors for the two nibbles) to 256 diferent addresses. So it basicaly already works as RAM.

Now you can scale it up to how much memory you need. 64KB works fine. You can get 16MB working maybe with a litle lag but it's fine. With 4GB, the simulation crashed as it grabbed like 10GB of my 16GB. But a gigabyte should be kinda usable, at least on a solid PC. So i would not be suprised if someone will build a 32b computer that  used like 28b addresing.

I must say that Sebastian made leaps of progress to optimize the sim. In the previous version a 1KB of RAM gave 1FPS and now you can have MB with great FPS. I also don't know if using the RGB display is the most optimized way but it is most memory per built-in chip. So i think that something like a single SR latch is going to cause more lag than one of these displays.

(+2)

Right now I'm using 8x black and white displays for RAM, giving me 256 bytes. I'll have to try out the color version!

9 bytes: 24 RGB displays

address: 1 byte -> 256 possible addresses

9*256=2304=2.304KB

1GB = 1,000,000KB

1,000,000 / 2.304=434027.777...

meaning you need 434028 2.304KB-memory cells

(you need 10,416,672 RGB displays for 1GB)

I built a 16MT RAM (it lagged a ton). I used red and green for storing 1 byte and the display has 256 addresses.

So I want 1GiB, thats 2^30 bytes

2^30 / 256 = 4,194,304 RGB displays for 1GiB

There could also be an optimization where you use the blue channel across 2 addresses. So then in 2 physical addresses could be stored 3B.

So thats 384B in a single RGB display.
2^30 / 384 = 2,796,202 RGB displays for 1GiB

(1 edit)

I'm trying to build a large RAM capacity but the simulation gets slower every time I enhance it. 
I'm stocked in 64KB because I need to pause the simulation for viewing or opening it.
N.B: I use logic gates. the binary cell has 3 inputs {select, data, read/write} 

Here is the file link: https://drive.google.com/file/d/1-1ifys702uznO3xJjQy0-F_d9KnuA7W_/view?usp=drive... 

Because you use to many gates in your RAM for example you use 16 OR this is 15 * 3 gates = 45 gates , if you will use 3 state buffer you don`t need use OR

Deleted 1 year ago

Output can only have one connection , and you use OR gates , but if you use 3 state buffer you can make 3 type of signals [1 0 no connection] no connection allow you connect multiple signals to output BUT only one can be on !!!
if you have 8 cell memory you only need 8 3 state buffer (one per cell) address pin connect to enable data to IN and finally you will get a some extra steps in simulation =D
if You want I can send you my realisation of RAM

I understand. I should have put an enable pin for the output data in each binary cell. Now, I use RGB display instead. The simulation is still smooth with 64KB RAM

I didn't use logic gates and used rgb screen instead and I got to 1mb of storage, but it brings me down to ~1500 steps per second

I wish I though out this for my snake game, my 256 bytes of ram brings me to just 100 tps

you can just use the red and green channels combined into a byte of memory, the screen has 256 addresses so in total you will get 256 bytes of RAM

Deleted 1 year ago
(1 edit)

Here's the new version of my 64KB RAM (8 data lines I/O width.
I'm all ears for any suggestion. The link file also includes a 256B & 4KB RAM.
https://drive.google.com/file/d/1Q2a-aOKt2muEutrpK58V-gP_3YwMc2Mr/view?usp=shari...
I used RGB display.   ...

I tried upgrade your RAM 256x8 , because You don`t use a blue channel I was thing if I combine to two RGB I can use this to make another space to save information , so I made it but when I was test it I found a small mistake XD if I try to save data on blue channels I clear previous data on R nad G data slots , now I must add flip flop before RGB to save information on n Address add new information and save them , meybe I can use 1 less RGB screen but I must add 96 gates
This picture show You what I tried to do XP

Could you share the file, please?


I think it's because the clock and refresh are wired together. In write mode, if the clock and refresh are wired together (same signal), the RGB display only records the data it receives in real time and erases all received data.

Sure I can share this
https://drive.google.com/file/d/1QtTwb4MKZq1GkpieItUUFtb6YnBtxjxy/view?usp=shari...


you can make it a bit better by using the blue channel to make it so you only need 11 RGB displays for a full 128x8 RAM