Question

In: Computer Science

Suppose the opcode of an MIPS instruction is 12 in decimal, and the rest of the...

Suppose the opcode of an MIPS instruction is 12 in decimal, and the rest of the machine code is 23483DB in hexadecimal (from high-order bit to low-order bit). What is the instruction? When showing the registers, use names (e.g. $t0, $s2) instead of indices (e.g $8, $17). For branch instructions, show offset in place of label, e.g. beq $t1, $t2, 92.

Solutions

Expert Solution

Hexadecimal     Binary
    0           0000
    1           0001
    2           0010
    3           0011
    4           0100
    5           0101
    6           0110
    7           0111
    8           1000
    9           1001
    A           1010
    B           1011
    C           1100
    D           1101
    E           1110
    F           1111
Use this table to convert from hexadecimal to binary
Converting 23483DB to binary
2 => 0010
3 => 0011
4 => 0100
8 => 1000
3 => 0011
D => 1101
B => 1011
So, in binary 23483DB is 10001101001000001111011011

opcode = 12
so, first 6 bits are 001100

instruction in binary is 001100 10001101001000001111011011

=>  00110010001101001000001111011011
=>  001100 10001  10100  1000001111011011
=>  opcode rs rt immediate
=>  ANDI   $s1    $s4    immediate

Converting 1000001111011011 to hexadecimal
1000 => 8
0011 => 3
1101 => D
1011 => B
So, in hexadecimal 1000001111011011 is 0x83DB

so, instruction is andi $s4, $s1, 0x83DB

Answer:
--------
andi $s4, $s1, 0x83DB

Related Solutions

Encode the following instruction opcode: 100011 (1) identify the instruction format that will be used (2)...
Encode the following instruction opcode: 100011 (1) identify the instruction format that will be used (2) indicate the values of each of the fields for that format in decimal (3) convert each of these decimal values to binary (4) represent the entire instruction as one hexadecimal value. subu $t3,$v1,$s2
i)In a computer, an instruction is composed of two fields: the opcode and an operand address....
i)In a computer, an instruction is composed of two fields: the opcode and an operand address. what is the minimum size of your instruction in bits if an instruction set of 327 opcodes and an address space of 128 Mbytes is required? NB. Use 1 Mbyte = 2^20 bytes ii) Instead of hard-writing the units, the software is used to interpret and execute instructions in a general-purpose system. Is the statement true or false
What is the Opcode? What is the Operand? What is the value in Register 5 after the instruction is executed?
What is the Opcode? What is the Operand? What is the value in Register 5 after the instruction is executed?
A new instruction is to be included in our core MIPS instruction subset. This new true-op...
A new instruction is to be included in our core MIPS instruction subset. This new true-op instruction is addm rt,disp(rs) which computes the sum of the contents of a memory word plus the contents of the rt register and places the sum back into the rt register. a) Show the MIPS machine code format required for this new true-op instruction. b) Are any changes to the multi-cycle datapath required to support this new true-op instruction? If so, describe the required...
In a computer instruction format, the instruction length is 12 bits and the size of an...
In a computer instruction format, the instruction length is 12 bits and the size of an address field is 5 bits. The system architect has already designed three 2-address instructions and thirty one 1-address instructions. How many 0-address instructions can still be possibly accommodated?
Consider the following C code: (10 marks) // write a MIPS instruction to initialize s0 to...
Consider the following C code: // write a MIPS instruction to initialize s0 to 6 t0 = ((s03 - 93)2 + s0 ) << 2 t1 = t0 / 4 Q2.1: Write a MIPS program that performs the operation of the above C program. Q2.2: What is the value of $t0 and $t1 after running your MIPS program (write your answer in a comment at the end of the code). Submit your answer to Q2 in a file named A2_Q2.asm
3.21 [10] <§3.5> If the bit pattern 0×0C000000 is placed into the Instruction Register, what MIPS...
3.21 [10] <§3.5> If the bit pattern 0×0C000000 is placed into the Instruction Register, what MIPS instruction will be executed? 3.22 [10] <§3.5> What decimal number does the bit pattern 0×0C000000 represent if it is a floating point number? Use the IEEE 754 standard. Given the following 32-bit binary sequences representing single precision IEEE 754 floating point numbers: a = 0100 0000 1101 1000 0000 0000 0000 0000 b = 1011 1110 1110 0000 0000 0000 0000 0000 Perform the...
Topics 1. Introduction 2. MIPS instruction set architecture (ISA) Exercise 1 Answer the following questions. (a)...
Topics 1. Introduction 2. MIPS instruction set architecture (ISA) Exercise 1 Answer the following questions. (a) List the five classic components of a computer. (b) Describe the steps that transform a program written in a high-level language such as Java into a representation that is directly executed by a computer processor.
CREATE TABLE DRIVER( ENUM         DECIMAL(12) NOT NULL, LNUM         DECIMAL(8)    NOT NULL,...
CREATE TABLE DRIVER( ENUM         DECIMAL(12) NOT NULL, LNUM         DECIMAL(8)    NOT NULL, STATUS         VARCHAR(10) NOT NULL, CONSTRAINT DRIVER_PKEY PRIMARY KEY(ENUM), CONSTRAINT DRIVER_UNIQUE UNIQUE(LNUM), CONSTRAINT DRIVER_FKEY FOREIGN KEY(ENUM) REFERENCES EMPLOYEE(ENUM), CONSTRAINT DRIVER_STATUS CHECK ( STATUS IN ('AVAILABLE', 'BUSY', 'ON LEAVE')) ); (1)   Modify a consistency constraint of the sample database such that after a modification         it is possible to record in the database information about the drivers who are sick.   */ CREATE TABLE TRUCK(...
Write a MIPS Assembly Language program which runs interactively to convert between decimal, binary, and hexadecimal....
Write a MIPS Assembly Language program which runs interactively to convert between decimal, binary, and hexadecimal. 1. Request input data type. 2. Request input data. 3. Request output data type. 4. Output the data. Use any algorithm
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT