subject

Write the 32-bit machine code as 8 hexadecimal digits for the beq, bne, and j instructions in the following code sequence. Assume the addi instruction (label TEST) is located at 0x00C4 0AB0. In the code sequence, when a comment line says "n instructions here" (n is 7 or 18), it means there are n instructions at the place of the comment line. For example, you can imagine that "# 7 instructions here" is replaced with 7 ADD instructions like "ADD $0, $0, $0".
LOOP:
add $s2, $s2, $s3
bne $s1, $s2, ELSE
# 7 instructions here
j TEST
ELSE:
# 18 instructions here
TEST:
addi $s1, $s1, 1
beq $s1, $s0, LOOP
Problem 1. Encoding branch and jump instructions.
Enter eight hexadecimal digits for PC and instruction machine code.
When executing the BNE instruction, PC is Ox[a].
The immediate field in the BNE instruction is [b] in decimal.
The machine code of the BNE instruction is Ox[c].
When executing the J instruction, PC is Ox[d].
The 26-bit partial address field in the J instruction is ob[e] (26 bits).
The machine code of the J instruction is Ox[f].
When executing the BEQ instruction, PC is Ox[g].
The immediate field in the BEQ instruction is [h] in decimal and Ox[i] in (4-digit) hexadecimal.
The machine code of the BEQ instruction is 0x[j].

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:30
The method of presentation refers to the planning process for the presentation. the information chosen for the presentation. how the presentation topic will be introduced. how the presentation will be delivered.
Answers: 1
question
Computers and Technology, 22.06.2019 17:40
Write a modular program (no classes yet, just from what you learned last year), that allows two players to play a game of tic-tac-toe. use a two-dimensional char array with 3 rows and 3 columns as the game board. each element of the array should be initialized with an asterisk (*). the program should display the initial board configuration and then start a loop that does the following: allow player 1 to select a location on the board for an x by entering a row and column number. then redisplay the board with an x replacing the * in the chosen location. if there is no winner yet and the board is not yet full, allow player 2 to select a location on the board for an o by entering a row and column number. then redisplay the board with an o replacing the * in the chosen location. the loop should continue until a player has won or a tie has occurred, then display a message indicating who won, or reporting that a tie occurred. player 1 wins when there are three xs in a row, a column, or a diagonal on the game board. player 2 wins when there are three ox in a row, a column, or a diagonal on the game board. a tie occurs when all of the locations on the board are full, but there is no winner. input validation: only allow legal moves to be entered. the row must be 1, 2, or 3. the column must be 1, 2 3. the (row, column) position entered must currently be empty (i.e., still have an asterisk in it).
Answers: 1
question
Computers and Technology, 22.06.2019 20:50
What is the difference between windows 7 and windows 10?
Answers: 1
question
Computers and Technology, 23.06.2019 02:00
Consider the following function main: int main() { int alpha[20]; int beta[20]; int matrix[10][4]; . . } a. write the definition of the function inputarray that prompts the user to input 20 numbers and stores the numbers into alpha. b. write the definition of the function doublearray that initializes the elements of beta to two times the corresponding elements in alpha. make sure that you prevent the function from modifying the elements of alpha. c. write the definition of the function copyalphabeta that stores alpha into the first five rows of matrix and beta into the last five rows of matrix. make sure that you prevent the function from modifying the elements of alpha and beta. d. write the definition of the function printarray that prints any onedimensional array of type int. print 15 elements per line. e. write a c11 program that tests the function main and the functions discussed in parts a through d. (add additional functions, such as printing a two-dimensional array, as needed.)
Answers: 3
You know the right answer?
Write the 32-bit machine code as 8 hexadecimal digits for the beq, bne, and j instructions in the fo...
Questions
Questions on the website: 13722362