CDA 3103 Computer Organization Homework #5 1. Problems: 1. (15 points) Consider the MARIE program below. a) List the hexadecimal code for each instruction. b) Draw the symbol table. c) What is the value stored in the AC when the program terminates? Hex Address Label Instruction 200 Begin, LOAD Base 201 202 ADD Offs Loop, SUBT One 203 STORE Addr 204 SKIPCOND 800 205 JUMP Done 206 JUMPI Addr 207 CLEAR 208 Done, HALT 209 Base, HEX 200 20A Offs, Dec 9 20B One, HEX 001 20C Addr, HEX 000 2. (15 points) Execute the below program. a) List the hexadecimal code for each instruction. b) Draw the symbol table. c) Fill in the blanks with correct values for registers PC and AC, and the contents in memory locations X, and Y, after each instruction is executed starting from the first instruction. Hex Address Label Instruction 100 If, LOAD X 101 SUBT Y 102 SKIPCOND 400 103 JUMP Else 104 Then, LOAD X 105 ADD X 106 STORE X 107 JUMP ENDIF 108 ELSE, LOAD X 109 SUBT X 10A STORE Y 10B Endif, Halt 10C X, Dec 12 10D Y, Dec 20 3. (15 points) Write the following code segment in MARIE's assembly language: if X > 5 then Y = X + X + X; X = 0; endif; Y = Y - 1; 4. (15 points) Write the following code segment in MARIE assembly language: X = 1; while X < 10 do X = X + 1; endwhile; 5. (20 points) Write a MARIE subroutine to calculate the sum from 1 to n, where n is the passing argument. 6. (10 points) Determine the required control signal sequence P5-P0, A1, A0, Cr, MR, MW and Timing signal T0, T1, T3 through T7 if required for MARIE’s STORE instruction. T0 T1 T3 T4 T5 T6 T7 P5 P4 P3 P2 P1 P0 MR MW A1 A0 2. Submission Requirements The following requirements are for electronic submission via Canvas. ⚫ ⚫ ⚫ ⚫ Your solutions must be in a single file with a file name yourname-assignment5. Upload the file by following the link where you download the homework description on Canvas. If scanned from hand-written copies, then the writing must be legible, or loss of credits may occur. Only submissions via the link on Canvas where this description is downloaded are graded. Submissions to any other locations on Canvas will be ignored. Cr ...
Purchase answer to see full attachment