Question

In: Computer Science

Assume that the program counter (PC) is set to 0x00000000. Describe how each of the instructions...

Assume that the program counter (PC) is set to 0x00000000. Describe how each of the instructions below could be used to set the next value of PC to 0x0FFFFFF4

j, jr, bne, jal, beq

Solutions

Expert Solution

solution:

given data:

Assume that the program counter (PC) :

j and jal instructions:

  • The main J-type directions are the hop guidelines j and jal. These guidelines require a 26-piece coded address field to determine the objective of the hop.
  • At the point when a J-type guidance is executed, an entire 32-digit hop target address is shaped by connecting the high request four pieces of the PC (the location of the guidance following the hop), the 26 pieces of the objective field, and two 0 pieces

Format Opcodes

op

31-26

target

25-0

Instruction Opcode Target
j label 000010 coded address of label
jal label 000011 coded address of label

JR instruction:

  • The jr guidance returns control to the guest. It duplicates the substance of $ra into the PC: jr $ra # PC <― $ra # A branch delay # opening adheres to this guidance. Normally you think about this as "hopping to the location in $ra ."
  • The Jump Register guidance makes the PC hop to the substance of the first source register.
  • The sample JR instruction demonstrated in the datapath above is JR $13.

    The instruction's equivalent in binary is:

(opcode) (rs) (rt) (rd) (shamt) (funct)

000000 01101 00000 00000 00000 001000

BNE instrction:

  • BNE (another way to say "Branch if Not Equal") is the mental helper for a machine language guidance which branches, or "hops", to the location indicated if, and just if the zero banner is clear.
  • In the event that the Z banner of the CCR is clear, the destination operand will be added to the PC, and the 68k will keep perusing at the new balanced held in PC. If the Z banner is set, the guidance is disregarded.

beq instruction:

  • BEQ (another way to say "Branch if EQual") is the mental aide for a machine language guidance which branches, or "bounces", to the location indicated if, and just if the zero banner is set.
  • The BEQ guidance branches the PC if the primary source register's substance and the subsequent source register's substance are equivalent.

It's linguistic structure is:

BEQ $first source register's location, $second source register's location, branch esteem.

The example BEQ guidance showed in the datapath above is BEQ $9, $11, .

The guidance's identical in binary is:

(opcode) $rs $rt (offset)

000100 01011 01011

please give me thumb up


Related Solutions

Suppose the program counter (PC) is set to 0x30002000. Is it possible to use the jump...
Suppose the program counter (PC) is set to 0x30002000. Is it possible to use the jump (j) MIPS assembly instruction to jump directly to the instruction at 0x50003000? If yes, write the corresponding assembly instruction(s). If not, explain why and give other MIPS instruction(s) that can jump to this target address. (For this problem, assume that the instruction memory starts from 0x00000000 and goes to 0xFFFFFFFF.)
Suppose the program counter (PC) is set to 0x2000FFFC. Is it possible to use the jump...
Suppose the program counter (PC) is set to 0x2000FFFC. Is it possible to use the jump (j) MIPS assembly instruction to jump directly to the instruction at 0x10003000? If yes, write the corresponding assembly instruction(s). If not, explain why and give other MIPS instruction(s) that can jump to this target address. (For this problem, assume that the instruction memory starts from 0x00000000 and goes to 0xFFFFFFFF.)
Assume a program requires the execution of 50 × 106 FP instructions, 110 × 106 INT...
Assume a program requires the execution of 50 × 106 FP instructions, 110 × 106 INT instructions, 80 × 106 L/S instructions, and 16 × 106 branch instructions. The CPI for each type of instruction is 1, 1, 4, and 2, respectively. Assume that the processor has a 2 GHz clock rate. a. Find the execution time? b. By how much must we improve the CPI of FP instructions if we want the program to run two times faster? c....
1). Assume that, for a program Pro, compiler A and B both generate 1.0E9 instructions (instruction...
1). Assume that, for a program Pro, compiler A and B both generate 1.0E9 instructions (instruction count=1.0E9). CPI_A= 1 and CPI_B=2 The processor A has a clock cycle time of 1 ns. And the processor B has a clock cycle time 2 ns. A).To execute the same program Pro, which processor is faster and by how much? B). To improve the slower processor in problem 1a, what can you do? (list all possible solutions)
2. PC Calculators sell calculators that it purchases for $15 each. It costs PC $60 each...
2. PC Calculators sell calculators that it purchases for $15 each. It costs PC $60 each time calculators are ordered, and carrying costs are 20% of the calculator's purchase price. Annual demand is 100,000 calculators. (a) Compute the EOQ. (b) Compute the inventory costs if PC orders are at (i) the EOQ amount, (ii) 1000 calculators, (iii) 2500 calculators.
Instructions: Write a program to calculate students’ average test scores and their grades. You may assume...
Instructions: Write a program to calculate students’ average test scores and their grades. You may assume the following input data: Johnson 85 83 77 91 76 Aniston 80 90 95 93 48 Cooper 78 81 11 90 73 Gupta 92 83 30 69 87 Blair 23 45 96 38 59 Clark 60 85 45 39 67 Kennedy 77 31 52 74 83 Bronson 93 94 89 77 97 Sunny 79 85 28 93 82 Smith 85 72 49 75 63...
Instructions: For each solid described, set up, BUT DO NOT EVALUATE, a single definite integral that...
Instructions: For each solid described, set up, BUT DO NOT EVALUATE, a single definite integral that represents the exact volume of the solid. You must give explicit functions as your integrands, and specify limits in each case. You do not need to evaluate the resulting integral. 1. The solid generated by rotating the region enclosed by the curves y = x^2 and y = x about the line x-axis.
Please! I want the instructions of how to solve it, not the answer. Write a program...
Please! I want the instructions of how to solve it, not the answer. Write a program that does the following in order: 1. Asks the user to enter a name 2. Asks the user to enter a number “x” 3. Asks the user to enter a number “y” 4. Calculates the sum of “x” and “y” 5. Prints out the number for “x”, “y” and “sum” An example of the program input and output is shown below: Enter your name:...
Using the following case, describe how you would set up a program for young boy Jonathon...
Using the following case, describe how you would set up a program for young boy Jonathon who is watching too much T.V. and not getting his homework done, by using principles from operant conditioning (behavior modification). Be sure to include all of he tasks you would use before getting started. Determine the target behavior you would seek to change. include techniques that both increase and decrease the target behavior and those behaviors closely associated with the target behavior. Jonathon is...
Instructions: 1. Write a MapReduce program to find the frequency of each letter, case insensitive, in...
Instructions: 1. Write a MapReduce program to find the frequency of each letter, case insensitive, in some given input. For example, "The quick brown fox jumps over the lazy dog" as input should generate the following (letter,count) pairs: (T, 2), (H, 1), (E, 3), etc. 2. Test your program against the 3 attached input files: HadoopFile0.txt, HadoopFile1.txt, and HadoopFile2.txt. 3. The input and output must be read/written from/into HDFS. 4. Please submit only the Java source file(s) on . 5....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT