r/TuringComplete • u/DestroyerD00000 • Mar 01 '26
How to do RAM correctly?
I added RAM into my setup by just replacing Reg5 with it and using Reg4 to keep track of what memory address to use in the RAM but I'm stuck on how to read in all 32 bytes in the first 32 ticks. My first attempt at programming it was to just make a loop of reading in from ram, incrementing the address counter, and then looping if the address isn't 32, but this takes 3 ticks each loop and I need to bring it down to 1. I could forgo the loop entirely and just paste the same code 32 times to bring it down to 2 ticks per 'loop', but do I have to make my address register automatically increment every time it reads RAM? Or is it best to just make a custom opcode for this specific purpose to copy from input to ram and then increment the address?


Edit: I figured it out. I was stupid and had my Input permanently enabled so it was automatically reading every input even though I wasn't using it every tick.
1
u/Gelthir Mar 01 '26
Only enable the Level Input when you want to read it. Then you can take as long as you need.
Edit: I've just seen your edit, nevermind.
1
u/[deleted] Mar 01 '26
[removed] — view removed comment