Question
Assume that memory cells 101 and 102 and ALU register R currently have values 10, 478, and -15, respectively. Using the instruction set in Figure
Assume that memory cells 101 and 102 and ALU register R currently have values 10, 478, and -15, respectively. Using the instruction set in Figure 6.5, give the contents of memory cells 101 and 102 and ALU register R after completion of each of the following operations. We assume that these operations are executed sequentially starting with (a) and that each subsequent operation starts with the memory-state left at the end of the execution of its immediately preceding operation.
(a) LOAD 102
(b) LOAD 101
(c) STORE 101
(d) INCREMENT 102
(e) SUBTRACT 101
FIGURE 6.5 Binary Op CodeOperation Meaning CON(X) R R-CON(X) 0-CON(X) 0001 0010 0011 0100 0101 0110 0111 LOADX STORE X CLEARX ADD X INCREMENT X SUBTRACTX DECREMENT X COMPAREX CON(X) + 1 CON(X) R-CON(X) R if CONX)>R then GT-1 ese0 ifCOn(X) = R then EQ 1 else 0 1000 1001 1010 1011 1100 1101 JUMP X JUMPGT X JUMPEQX JUMPLT X JUMPNEQX Get the next instruction from memory ocationX Get the next instruction from memory location X if G-1 Get the next instruction from memory location X if EQ 1 Get the next instruction from memory location X if LT 1 Get the next instruction from memory location X if EQ 0 Input an integervalue from the standard input device and store into memory cell X Output, in decimal notation, the value stored in memory cell X Stop program execution. INX 1110 OUT X FIGURE 6.5 Binary Op CodeOperation Meaning CON(X) R R-CON(X) 0-CON(X) 0001 0010 0011 0100 0101 0110 0111 LOADX STORE X CLEARX ADD X INCREMENT X SUBTRACTX DECREMENT X COMPAREX CON(X) + 1 CON(X) R-CON(X) R if CONX)>R then GT-1 ese0 ifCOn(X) = R then EQ 1 else 0 1000 1001 1010 1011 1100 1101 JUMP X JUMPGT X JUMPEQX JUMPLT X JUMPNEQX Get the next instruction from memory ocationX Get the next instruction from memory location X if G-1 Get the next instruction from memory location X if EQ 1 Get the next instruction from memory location X if LT 1 Get the next instruction from memory location X if EQ 0 Input an integervalue from the standard input device and store into memory cell X Output, in decimal notation, the value stored in memory cell X Stop program execution. INX 1110 OUT X
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started