Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Translate the following Python program into the machine language described in Ap

ID: 3856276 • Letter: T

Question

Translate the following Python program into the machine language described in Appendix C. You may assume that the program begins at address 00, and the x is stored at memory cell whose address is XY.
x= 0

while (x < 3):

      x=x+ 1

part b

Translate the high-level statement
if (X == 0): Z=Y+ W
else: Z=Y+ X
into the machine language of Appendix C, assuming that W, X, Y, and Z are all values represented in two’s complement notation, each using one byte of memory.

Op-code Operand Description RXY LOAD the register R with the bit pattern found in the memory cell whose address is XY. Example: 14A3 would cause the contents of the memory cell located at address A3 to be placed in register 4 LOAD the register R with the bit pattern XY. Example: 20A3 would cause the value A3 to be placed in register 0. 2 RXY

Explanation / Answer

The following are instructions written in the machine language described in Appendix C. Translate them into English. a. 7123: OR the bit pattern in reg2 &3, and place the result in reg1. b. 40E1: MOVE the bit pattern in regE to reg1. c. A304: ROTATE the bit pattern in reg3 one bit to the right 4 times, and place the lower-order end bit at the higher-order end. d. B100: JUMP to instruction located in memory cell 00 if bit pattern in reg1 equal to bit pattern in reg0. If not, nothing will be done and program execution would continue. e. 2BCD: LOAD regB with the value CD. 9. Translate the following instructions from English into the machine language described in Appendix C. a. LOAD register 6 with the hexadecimal value 77. 2677 b. LOAD register 7 with the contents of memory cell 77. 1777 c. JUMP to the instruction at memory location 24 if the contents of register 0 equals the value in register A. BA24 d. ROTATE register 4 three bits to the right. A403 e. AND the contents of registers E and 2 leaving the result in register 1. 81E2 or 812E

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote