Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Recall the simulation of RAMs by multi-tape DTMs described in class and consider the RAM program to compute n! described on this page. Show the
Recall the simulation of RAMs by multi-tape DTMs described in class and consider the RAM program to compute n! described on this page. Show the contents of tape 1 (simulating the RAM memory) and tape 2 (simulating the accumulator r0) after the execution of each instruction in this RAM program up to the first execution of "Mult 3". Use a format similar to Question 5 on this page, and abbreviate integers in unary notation to decimal notation.
Q5 solutions:
5. This question concerns the simulation of RAMs by the 5-tape DTM's described in class. Consider the simulation process of the following RAM instruction stream Load -2, Store 3, Load-3, Store 2, Load -4, Store 1, Load 2, Mult 1, Add 3, Storc 4 Show the contents of tape 1 (simulating the RAM memory) and tape 2 (simulating the accumulator ro) after the execution of each instruction. For brevity, integers in unary notation on the tape are abbreviated by decimal notation. Load-2 tape 1: empty tape 2: 2 Store 3 tape I: ##342## tape 2: 2 Load -3 tape 1: ##342## tape 2: 3 Store 2 tape 1: ##342##243## tape 2: 3 Load-4 tape 1: ##3#2##2#3## tape 2: 4 Store 1 tape 1: ##3#2##2#3##1 #4## tape 2: 4 Load 2 tape 1: ##342##2#3##1#4## tape 2: 3 Mult 1 tape 1 : ##3#2##2#3##1 #48# tapc 2: 12 Add 3 tape 1: ##342##2#3##144## tape 2: 14 Store tape 1: ##3#2##2#3##144##4#14## tape 2: 14 5. This question concerns the simulation of RAMs by the 5-tape DTM's described in class. Consider the simulation process of the following RAM instruction stream Load -2, Store 3, Load-3, Store 2, Load -4, Store 1, Load 2, Mult 1, Add 3, Storc 4 Show the contents of tape 1 (simulating the RAM memory) and tape 2 (simulating the accumulator ro) after the execution of each instruction. For brevity, integers in unary notation on the tape are abbreviated by decimal notation. Load-2 tape 1: empty tape 2: 2 Store 3 tape I: ##342## tape 2: 2 Load -3 tape 1: ##342## tape 2: 3 Store 2 tape 1: ##342##243## tape 2: 3 Load-4 tape 1: ##3#2##2#3## tape 2: 4 Store 1 tape 1: ##3#2##2#3##1 #4## tape 2: 4 Load 2 tape 1: ##342##2#3##1#4## tape 2: 3 Mult 1 tape 1 : ##3#2##2#3##1 #48# tapc 2: 12 Add 3 tape 1: ##342##2#3##144## tape 2: 14 Store tape 1: ##3#2##2#3##144##4#14## tape 2: 14Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started