Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed

Q5 solutions:

image text in transcribed

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: 14

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Have roles been defined and assigned?

Answered: 1 week ago