Concept explainers
In the chapter, we introduced a machine instruction of the form O×DROS. Suppose we extended this form to OxDRXS, meaning “Load register R with the data pointed to by the value in registers plus the value X.” Thus the pointer to the data is obtained by retrieving the value in register S and then incrementing that value by X The value in register S is not altered (If register F contained 0x04, then the instruction 0xDE2F would load register E with the contents of the memory cell at address 0x06. The value of register F would remain 0x04.) What advantages would this instruction have? What about an instruction of the form OxDRTS—meaning “Load register R with the data pointed to by the value in register S incremented by the value in register T”?
Want to see the full answer?
Check out a sample textbook solutionChapter 8 Solutions
Computer Science: An Overview (12th Edition)
Additional Engineering Textbook Solutions
Starting Out with C++ from Control Structures to Objects (8th Edition)
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
Starting Out with C++: Early Objects
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Software Engineering (10th Edition)
Starting Out with Java: Early Objects (6th Edition)
- Add control states to the following to implement a two-word load constant value instruction, lv, such that lv $rd,1000000 yields rd=1000000. The constant value being loaded, 1000000 in this case, can be an arbitrary 32-bit value, thus it is the second word of the instruction. The first word of the instruction has the lv opcode and specifies rd. All MIPS instructions are just one word long, so there is no MIPS instruction like this and you will not find an explanation of it in the text, etc. You should use the encoding suggested by the when below, so an instruction like lv $5,42 would be encoded as the two-word sequence op(2)+rd(5), 42. when (op()) (op(2)) LvStart: PCout, MARin, MEMread, Yin CONST(4), ALUadd, Zin, UNTILmfc MDRout, IRin Zout, PCin, JUMPonop HALT /* Should end here on undecoded op */Lv:arrow_forwardConsider a HW ISA program P1 with the following Instruction Memory IM: Jamie wants to translate program P1 (except for the final HALT instruction) into a sequence of statements in a version of C with a 16-bit int type. Using the IM Fill in the rest of her program with assignments to variables named R2, R3, and R4 that represent the registers with these names in P1 and a while loop. int R0 = 0; int R1 = 1; int R2 = R0 + R0; // ...arrow_forwardImplement a new unary instruction in place of N0P0 called ASL2 that does two left shifts on the accumulator. V should remain unchanged, but N and Z should correlate with the new value in the accumulator, and C should be the carry from the second shift. Write a program that tests all the features of the new instruction.arrow_forward
- Consider a multilevel computer in which levels are vertically stacked, with the lowest level being level 1. Each level has instructions that are m times as powerful as those of the level below it; that is, one level r instruction can do the work of m instructions at level r-1. However, n instructions at level r-1 are required to interpret each instruction at level r. Given this, answer the following questions: If a level 1 program requires k seconds to run, how long would the equivalent program take to run at levels 2, 3 and 4. Express your answer in terms of n, m, and r. What is the performance implication for the program if n > m? Conversely, what is the implication if m > n? Which case do you think more likely? Why?arrow_forwardConsider the following instruction:Instruction: Add Rd, Rs, RtInterperation: Reg[Rd] = Reg[Rs] + Reg[Rt] RegWrite MemRead ALUMux MemWrite ALUOp RegMux Branch a, What are the values of control signals generated by the control in Figure 4.2 for the above instruction? b, Which resources (blocks) perform a useful function for this instruction? c, Which resources (blocks) produce outputs, but their outputs are not used for this instruction? d, which resources (blocks) produce no output for this instruction?arrow_forwardAs a result, the specific mechanisms by which an instruction obtains its input data are decoupled from the specific means by which any other instruction obtains its input data. Use with a(n): A Synthesizing data sets using procedural descriptions B In contrast to the case of "multiple data, multiple instruction," in which C D stands for "data alone," there is just a single instruction. Many outcomes from a single orderarrow_forward
- 1. T/F - if (B)=006000 (PC)=003600 (X)=000090, for the machine instruction 0x032026, the target address is 003000.2. T/F – PC register stores the return address for subroutine jump.3. T/F – S register contains a variety of information such as condition code.4. T/F – INPUT WORD 1034 – This means Operating system should reserve 1034 bytes in memory5. T/F - In a two pass assembler, adding literals to literal table and address resolution of local symbol are done using first pass and second pass respectively.arrow_forwardIn this exercise we compare the performance of 1-issue and 2-issue processors, taking into account program transformations that can be made to optimize for 2-issue execution. Problems in this exercise refer to the following loop(written in C):for(i=0;i!=j;i+=2)b[i]=a[i]–a[i+1];When writing MIPS code, assume that variables are kept in registers as follows, and that all registers except those indicated as Free are used to keep various variables, so they cannot be used for anything else. i j a b c Free R5 R6 R1 R2 R3 R10,R11,R12 Translate this C code into MIPS instructions. Your translation should be direct, without rearranging instructions to achieve better performance.arrow_forwardOrthogonality is the ability of an instruction set architecture to have a "backup" instruction for any instruction that does the same task. Tell me whether that's correct or not.arrow_forward
- In generall, computers think in terms of numbers (i.e. binary data). Thus, any operation performed in the computer must be done using either mathematical or logical operations. Given this inherit limitation of computers, what is the compare instruction actually doing when we, as assembly programmers, provide two numbers for it to "compare"? Furthermore, what assembly instruction is similar to the compare instruction? How are the two instructions different?arrow_forwardIn this exercise, we examine in detail how much an instruction is executed in a single-cycle Datapath. The problem refers to a clock cycle in which the processor fetches the following instruction word: 1010 1100 0110 0010 0000 0000 0001 0100. Assume that data memory is all zeros and that the processor's registers have the following values at the beginning of the cycle in which of the instruction word is fetched: (See image attached) What is the new PC address after this instruction is executed? Highlight the path through which this value is determined?arrow_forwardAssume that the state of the 8088’s registers and memory just prior to the executionof each instruction in problem 15 is as follows: * in photos*What result is produced in the destination operand by executing instructions (a)through (k)? *only b,c,e,g* b) ADC SI, AX(c) INC BYTE PTR [0100H] (e) SBB DL, [0200H] (g) NEG BYTE PTR [DI]+0010Harrow_forward
- Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage Learning