Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

TM assembly: Design a TM to execute programs written in a simplified assembly-like language. There are just four instructions: L, Mx, My, and A operating

image text in transcribedimage text in transcribed

TM assembly: Design a TM to execute programs written in a simplified assembly-like language. There are just four instructions: L, Mx, My, and A operating on three registers x, y, and z each holding a nonnegative integer. L instructions load a certain constant number, represented in binary, into register z. For example, the instruction L00000101 loads the integer 5 (represented by the bits 00000101) into z. Other bit strings can be specified. The number of bits may be arbitrary, but you may assume it is the same for all load instructions in the program. For instance, if the first instruction is L0011001100110011, then all remaining L instructions will be followed by exactly 16 bits. Mx and My instructions move the value from z into x or y, respectively. (Actually, it's more like "copy" since the value in z is not erased.) A instructions add the values in registers x and y and store the result in register z. If the result overflows, the new most significant 1 is simply omitted; i.e., the result is taken mod 2*, where k is the number of bits specified in the first load instruction. For example, adding 11111111 (255) to 00000001 (1) results in 00000000 (0), and adding 11111010 (250) to 00001001 (9) results in 00000011 (3). TM assembly: Design a TM to execute programs written in a simplified assembly-like language. There are just four instructions: L, Mx, My, and A operating on three registers x, y, and z each holding a nonnegative integer. L instructions load a certain constant number, represented in binary, into register z. For example, the instruction L00000101 loads the integer 5 (represented by the bits 00000101) into z. Other bit strings can be specified. The number of bits may be arbitrary, but you may assume it is the same for all load instructions in the program. For instance, if the first instruction is L0011001100110011, then all remaining L instructions will be followed by exactly 16 bits. Mx and My instructions move the value from z into x or y, respectively. (Actually, it's more like "copy" since the value in z is not erased.) A instructions add the values in registers x and y and store the result in register z. If the result overflows, the new most significant 1 is simply omitted; i.e., the result is taken mod 2*, where k is the number of bits specified in the first load instruction. For example, adding 11111111 (255) to 00000001 (1) results in 00000000 (0), and adding 11111010 (250) to 00001001 (9) results in 00000011 (3)

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

Recommended Textbook for

DB2 9 For Linux UNIX And Windows Advanced Database Administration Certification Certification Study Guide

Authors: Roger E. Sanders, Dwaine R Snow

1st Edition

1583470808, 978-1583470800

More Books

Students also viewed these Databases questions