# running RAM on a given input

I understand how RAM commands work but I am unable to understand how we use a given input string and find the output. For instance,

there's a Random Access Machine which has an input {0,1}*. The program logic is as follows:

2: store 1

8: if a=2 go to 11

9: print 0

10: goto 12

11: print 1

12: end

Now, on the input tape we have i=11101011. How can I find the content of the output tape? What's the approach?

When we see read, do we only read the first character? If yes, then what exactly do we add 1 to? Is the output also supposed to be in binary?

• – D.W. Aug 11 '20 at 8:56

Check your definitions. Often the convention is "input is the contents of memory positions 0 to $$n$$", result might be e.g. accept if register 0 is non-zero when the RAM halts.