MIPs Memory Addressing & Numeracy Flashcards
What are the three types of MIPS instruction formats?
- R-Type (Register)
- I-Type (Immediate)
- J-Type (Jump)
These formats determine how instructions are structured in MIPS architecture.
What is the purpose of the MIPS assembler?
Converts assembly language into machine code
The assembler translates higher-level instructions into binary machine language, allowing the program to be executed by the hardware.
What is a linker?
A program that combines object files into a single executable file
The linker resolves references to external symbols and assigns final memory addresses.
What does the loader do?
Loads the executable file into memory and performs relocation
The loader prepares the program for execution by mapping logical addresses to physical memory.
What are the four main steps in translating a C program into a running executable?
- Translating C to assembly
- Assembling to machine code
- Linking object files
- Loading the executable
This process transforms high-level code into a format executable by the computer.
What is the significance of the first bit in signed format numbers?
It represents the sign of the number
1 = -
0 = +
In signed numbers, the leftmost bit indicates whether the number is positive or negative.
What is different in two’s complement?
The first bit decides the sign but also holds a value
Two’s complement simplifies arithmetic operations and avoids the ambiguity of having both positive and negative zero.
True or False: In unsigned numbers, all bits are used to represent positive values.
True
Unsigned representation does not account for negative values, using the entire bit range for positive integers.
What does the term ‘dynamic linking’ refer to?
Loading shared libraries at runtime as needed
This allows for updates to libraries without recompiling dependent programs.
What are MIPS addressing modes?
- Register Addressing
- Base Addressing
- Immediate Addressing
- PC-relative Addressing
- Pseudo-direct Addressing
These modes define how operands are accessed in MIPS architecture.
What are the characteristics of MIPS instructions?
- All instructions are 32 bits wide
- Fixed-size instructions
- Limited instruction set
These features contribute to the simplicity and efficiency of MIPS architecture.
What is the difference between signed and unsigned numbers?
Signed numbers can represent both positive and negative values; unsigned numbers can only represent positive values
This distinction affects how numbers are stored and manipulated in memory.
Fill in the blank: The _______ is a program that takes object files and combines them into an executable file.
Linker
The linker resolves references and assigns memory addresses for the executable.
How many bits are used in the MIPS instruction formats?
32 bits
Each MIPS instruction is fixed at 32 bits, promoting uniformity in instruction encoding.
What is a symbol table in the context of an assembler?
A table that contains pairs of symbols (labels) and addresses
It is used to track the locations of various instructions and data in memory.
What is the role of the dynamic loader?
Loads shared libraries at runtime and resolves symbols
This allows programs to use libraries without needing to link them at compile time.
True or False: The MIPS architecture allows for unlimited registers in the register file.
False
MIPS has a limited number of registers, which is part of its design for efficiency.
What are the limitations of using signed and magnitude representation?
- Dual representation of zero
- Complexity in arithmetic operations
- Need for special handling in adders
These limitations led to the adoption of two’s complement for signed number representation.
What does the MSB represent in signed format?
The sign of the number
MSB stands for Most Significant Bit.
What is the two’s complement representation of +1?
0000 0000 0000 0000 0000 0000 0000 0001
This represents +1 in decimal.
What is the two’s complement representation of -1?
1111 1111 1111 1111 1111 1111 1111 1111
This represents -1 in decimal.
What is the two’s complement representation of +2,147,483,647?
0111 1111 1111 1111 1111 1111 1111 1111
This is the maximum positive value in 32-bit two’s complement.
What is the two’s complement representation of -2,147,483,648?
1000 0000 0000 0000 0000 0000 0000 0000
This is the minimum negative value in 32-bit two’s complement.
What is the process to negate a two’s complement number?
Invert all bits and add 1
Negating and inverting are distinct operations.