Question

In: Computer Science

Question 3. Describe memory types used in the MIPS assembly. Explain registers used in the MIPS...

Question 3.

  1. Describe memory types used in the MIPS assembly.
  2. Explain registers used in the MIPS assembly.
  3. Differentiate between assembly source code and machine code.
  4. Write a note on MIPS instruction formats.

Solutions

Expert Solution

Describe memory types used in the MIPS assembly.

The first MIPS engineering characterizes three data-types: 32-bit word, 16-bit half word, and 8-bit bytes. The afterward variations include the 64-bit double-word and floating-point data-types. All machine informational are encoded as 32-bit words, and most numbers operations are performed on 32-bit integrability. The investigation of ordinary processor workloads shown that byte stack and store operations were utilized habitually, which driven the MIPS architects to organize the most memory as a single level cluster of bytes. Utilizing 32-bit addresses, this comes about in a most extreme fundamental memory of 4 Gigabytes. Be that as it may, based on the outside 32-bit information transport, all information exchanges between memory and processor continuously utilize a full word, or 32-bits. Additional rationale within the processor and the memory is utilized to empower and to extricate the comparing subset of the information when executing the half-word and byte stack and store instructions.

All memory gets to got to be adjusted for the comparing data-type: indeed addresses for half-word gets to, and multiples-of-four for word gets to and instruction bring. Misaligned memory gets to are recognized by the processor and the program is ended. One or maybe bizarre include of the MIPS design is the back of both the large-endgate and small-endgate memory models. That's , the requesting of bytes interior a four-byte word can be chosen by arranging the bus-interface of the processor. Whereas the TinyMips processor can be exchanged to utilize either the small-endgate or large-endgate memory show, this include has not been completely tried. As it were the small-endgate variation is utilized for the example applets, because this is often the default created by our gcc cross-compiler. Whereas the inactive mapping clarified over is or maybe basic, no virtual address remains unaltered by the mapping. This includes another layer of complexity when attempting to keep track of memory gets to amid a recreation, since the computer program works with virtual addresses, whereas the physical addresses show up on the address transport and are utilized to control the outside recollections and fringe gadgets. Subsequently, the TinyMips processor can too be utilized with the memory administration exchanged off, so that virtual and physical addresses are the same. This mode makes a difference understanding the program running on the reenacted processor, and is utilized in all of the early on applets.

Explain registers used in the MIPS assembly.

In spite of the fact that called a "record", a register record isn't related to disk records. A register file could be a little set of high-speed capacity cells interior the CPU. the MIPS has 32 basic resolution registers, so it takes 5 bits to indicate which one to utilize. In differentiate, the MIPS incorporates a 4 gibibyte memory capacity, so it takes 32 bits to indicate which memory cell to utilize. An information with 3 operands will need 15 bits in case they are all registers, and 96 bits in the event that they are all memory addresses. Frequently information comprise of a few bordering bytes. Each computer producer has its claim thought of what to call groupings bigger than a byte. The taking after is utilized for MIPS chips.

byte — eight bits. word — four bytes, 32 bits. double word — eight bytes, 64 bits A piece of bordering memory is alluded to by the address of its to begin with byte that is the byte with the most reduced address. Most MIPS enlightening include a settled number of bytes. enlist could be a portion of the processor that can hold a bit design. On the MIPS, a enroll holds 32 bits. There are numerous registers within the processor, but as it were a few of them are unmistakable in gathering dialect. The others are utilized by the processor in carrying out its operations. A stack operation duplicates a bit design from memory into a register. A store operation duplicates a bit design from a enlist into memory.

0 zero returns 0 only

1 at Booked for use by assembler

2-3 v0 v1 Points restored by subprogram

4-7 a0-a3 First 4 variables for a subprogram

8-15 t0-t7 Subprogram can work without storing

24-25 t8-t9 Subprogram can work without storing 16-23 s0-s7 Subroutine register values should be reconstruct earlier returning

26-27 k0,k1 Booked for use by disturb/trap handler; may modify down your flour

28 gp Global pointer; it’s for "static" or "extern" value

29 sp Stack pointer

30 s8/fp Frame pointer

31 ra Return address for subprogram

Write a note on MIPS instruction formats.

The MIPS instruction set can be partitioned into three primary bunches of enlightening, each of which has its claim particular encoding:

I-Type (immediate)

| 31 26 | 25 21 | 20 16 | 15 0 |

| opcode | rs | . | rt |. | offset |

J-Type (jump)

| 31 26 | 25 0 |

| opcode | instr_index |

R-Type (register)

| 31 26 | 25 21 | 20 16 | 15 11 | 10 6 | 5 0 |

| opcode | rs |. | rt | |rd | |sa | function |

the opcode field shows the 6-bit fundamental opcode, whereas the 5-bit areas rt, rs and rd select the target enroll and one or two origin registers for the specification:

The I-type or prompt enlightening hold a 16-bit field; depending on the instruction this can be deciphered as an unsigned numbers within the extend 0..65535 or a sign-extended numbers within the run -32768..32767.

The J-type or hop informational save a 26-bit balanced. This could be utilized as a sign-extended balanced for PC-relative branches, or the least 5 bits are utilized to choose one of the general-purpose registers.

The R-type or enroll instruction bunch incorporates all common arithmetical and consistent operations, but too the stack- and store enlightening. The work field acts as a 6-bit sub-opcode that chooses the operation, whereas the sa field encodes the shift completion time utilized for the switch performance.


Related Solutions

Why are 31 registers considered a bad compromise instead of the 32 registers used by MIPS?
Why are 31 registers considered a bad compromise instead of the 32 registers used by MIPS?
Describe three types of memory that are used in an MSP430, explain specifically what each memory...
Describe three types of memory that are used in an MSP430, explain specifically what each memory type’s purpose and why that type of memory is best suited for that use.
explain why a computer needs to use memory (registers, stacks, heaps) when executing assembly language instructions...
explain why a computer needs to use memory (registers, stacks, heaps) when executing assembly language instructions using the computer's architecture?
In the PIC18F452 Programming Model, list 2 registers that are used to access the Program Memory....
In the PIC18F452 Programming Model, list 2 registers that are used to access the Program Memory. Indicate their sizes.
Explain the bounds registers approach for partitioned memory management and also give the major disadvantage of...
Explain the bounds registers approach for partitioned memory management and also give the major disadvantage of the bounds registers approach
Question: In the following MIPS assembly code, translate all the instructions to their corresponding machine code...
Question: In the following MIPS assembly code, translate all the instructions to their corresponding machine code in hexadecimal format. This code is stored in the memory from address 0x2fff0004. Loop: lw $t0, 4($s0)             addi $t1, $t1, -15             sll $t1, $t1, 2             beq $t1, $s1, Exit             addi $s0, $s0, 4             j Loop Exit: …
Using MIPS (MARS) - Assembly Language Assignment ( PLEASE USE COMMENTS TO DESCRIBE EACH STEP )...
Using MIPS (MARS) - Assembly Language Assignment ( PLEASE USE COMMENTS TO DESCRIBE EACH STEP ) Take input of name, the input of hours worked, and input of hourly wage, and use input of hourly wage and hours worked to calculate total paycheck and print Name, and paycheck.
Example: A 3-address computer has 40 instructions, 16 Registers, and 256KB memory. Assume each instruction has...
Example: A 3-address computer has 40 instructions, 16 Registers, and 256KB memory. Assume each instruction has three operands. Two registers and the third operand is a direct address location of a memory. Find minimum size of PC, MAR, MDR, IR. Solution: OPCODE R1, R2, address OPCODE is 6 bits since 2^6>40 Register field is 4 bits since 2^4 =16 Memory field is 18 bits since 2^18=256K Instruction length =6+4+4+18=32 bits MDR=32 bits IR=32 bits MAR=18 PC=18 Please explain
Describe the types and differences in the assembly instructions of 8051 microcontroller
Describe the types and differences in the assembly instructions of 8051 microcontroller
Describe the different types of data. Explain what they are, what they are used for, and...
Describe the different types of data. Explain what they are, what they are used for, and how are they used in the Health Information Management department, as well as the healthcare industry.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT