a)List the hexadecimal code for each instruction. b)Draw the symbol table. c) Fi
ID: 3702793 • Letter: A
Question
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.
PLEASE EXPLAIN IN DETAIL HOW TO DO PART C. I ALREADY KNOW HOW TO DO PART A AND PART B. I HAVE NO IDEA HOW TO DO PART C. I HAVE THE ANSWER TO PART C, I JUST NEED SOMEONE TO EXPLAIN VERY THOROUGLY EACH STEP AND HOW TO COMPLETE THIS PROBLEM.
Here is the answer to part c, but please explain with much detail every step how to do this problem
Instruction LOAD X SUBT Y SKIPCOND 400 JUMP Else LOAD X ADD X STOREXX JUMP Endif LOAD X SUBT X STORE Y Halt Dec 12 Dec 20 Hex Address Label If 100 101 102 103 104 105 106 107 108 109 10A 10B 10C 10D Then, Else, Endif X, Y.Explanation / Answer
PC:
The Program Counter is one of the most important registers in the CPU. A program is a series of instructions stored in the memory. These instructions tell the CPU exactly how to get the desired result. It is important that these instructions must be executed in a proper order to get the correct result. This sequence of instruction execution is monitored by the program counter. It keeps track of which instruction is being executed and what the next instruction will be.
AC:
AC is one of the general purpose registers but it is specifically used to 'accumulate' the result of the currently running instructions.
M[x]
read from memory value of x
M[y]
read from memory value of y
Now,
at first PC value is at instruction 0x100 i.e.,
the next instruction to be fetched is LOAD X and its value is stored at 0X000C
now PC value is at instruction 0x101 i.e.,
the next instruction to be fetched is SUBT Y and the value x-y is stores at 0XFFF8
now PC value is at instruction 0x102 i.e.,
the next instruction to be fetched is SKIPCOND 400 i.e, :
check if AC = 0
LOAD X is failed
then it skips next instruction to be fetched
i.e., it skips instruction 103
so the next instruction to be fetched is 108
i.e., jump to else.
now the next instruction to be fetched is 109
0X000C = load x
similarly,
instruction 109 executes and
0X0000 = x-x = 0
then 10A executes
y = 0X0000 (STORE)
then 10B
0X0000 => Halt i.e., no further instruction to execute. HALT freezes the program counter PC.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.