MIPs Memory Addressing & Numeracy Flashcards

1
Q

What are the three types of MIPS instruction formats?

A
  • R-Type (Register)
  • I-Type (Immediate)
  • J-Type (Jump)

These formats determine how instructions are structured in MIPS architecture.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the purpose of the MIPS assembler?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a linker?

A

A program that combines object files into a single executable file

The linker resolves references to external symbols and assigns final memory addresses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the loader do?

A

Loads the executable file into memory and performs relocation

The loader prepares the program for execution by mapping logical addresses to physical memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the four main steps in translating a C program into a running executable?

A
  • 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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the significance of the first bit in signed format numbers?

A

It represents the sign of the number

1 = -
0 = +

In signed numbers, the leftmost bit indicates whether the number is positive or negative.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is different in two’s complement?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

True or False: In unsigned numbers, all bits are used to represent positive values.

A

True

Unsigned representation does not account for negative values, using the entire bit range for positive integers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does the term ‘dynamic linking’ refer to?

A

Loading shared libraries at runtime as needed

This allows for updates to libraries without recompiling dependent programs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are MIPS addressing modes?

A
  • Register Addressing
  • Base Addressing
  • Immediate Addressing
  • PC-relative Addressing
  • Pseudo-direct Addressing

These modes define how operands are accessed in MIPS architecture.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the characteristics of MIPS instructions?

A
  • All instructions are 32 bits wide
  • Fixed-size instructions
  • Limited instruction set

These features contribute to the simplicity and efficiency of MIPS architecture.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the difference between signed and unsigned numbers?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Fill in the blank: The _______ is a program that takes object files and combines them into an executable file.

A

Linker

The linker resolves references and assigns memory addresses for the executable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How many bits are used in the MIPS instruction formats?

A

32 bits

Each MIPS instruction is fixed at 32 bits, promoting uniformity in instruction encoding.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a symbol table in the context of an assembler?

A

A table that contains pairs of symbols (labels) and addresses

It is used to track the locations of various instructions and data in memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the role of the dynamic loader?

A

Loads shared libraries at runtime and resolves symbols

This allows programs to use libraries without needing to link them at compile time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

True or False: The MIPS architecture allows for unlimited registers in the register file.

A

False

MIPS has a limited number of registers, which is part of its design for efficiency.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What are the limitations of using signed and magnitude representation?

A
  • 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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What does the MSB represent in signed format?

A

The sign of the number

MSB stands for Most Significant Bit.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is the two’s complement representation of +1?

A

0000 0000 0000 0000 0000 0000 0000 0001

This represents +1 in decimal.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is the two’s complement representation of -1?

A

1111 1111 1111 1111 1111 1111 1111 1111

This represents -1 in decimal.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is the two’s complement representation of +2,147,483,647?

A

0111 1111 1111 1111 1111 1111 1111 1111

This is the maximum positive value in 32-bit two’s complement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What is the two’s complement representation of -2,147,483,648?

A

1000 0000 0000 0000 0000 0000 0000 0000

This is the minimum negative value in 32-bit two’s complement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is the process to negate a two’s complement number?

A

Invert all bits and add 1

Negating and inverting are distinct operations.

25
What is sign extension?
Copying the most significant bit into the other bits ## Footnote This is used when converting n-bit numbers to more than n bits.
26
What is the two's complement representation of -6?
1111 1111 1111 1111 1111 1111 1111 1010 ## Footnote This can be derived from the positive representation of +6.
27
What are the components of the IEEE 754 floating point representation?
Sign bit, Exponent, Fraction ## Footnote The standard specifies 1 bit for sign, 8 bits for exponent, and 23 bits for fraction.
28
How does the exponent in IEEE 754 representation allow for negative values?
By using a bias ## Footnote The bias is typically 127 for an 8-bit exponent.
29
What is the bias used in IEEE 754 for 8-bit exponents?
127 ## Footnote This allows representation of both positive and negative exponents.
30
How is the fraction in IEEE 754 representation referred to?
Significand ## Footnote This term is used instead of fraction or mantissa to avoid confusion.
31
What happens to the leading bit in the significand of floating point representation?
It is implied and not coded ## Footnote This is because it is always 1 in normalized form.
32
What is the full range for an 8 bit number?
0 – 255 ## Footnote The range consists of 256 variations (2^8 = 256)
33
What are the positive and negative ranges in a biased representation?
Positive range: +127, Negative range: -126
34
What numbers are reserved for special purposes in 8 bit representation?
0 and 255
35
How is the exponent calculated in floating point representation?
Exponent = E + Bias ## Footnote E = Distance decimal point moved
36
What is the formula used to convert a floating point number back?
(-1)^sign x (1 + F) x 2^(E-bias)
37
What does the notation X^0 equal?
1
38
What does the notation X^1 equal?
X
39
What is the general representation for a single precision number?
1 bit for sign 8 bits for exponent 23 bits for fraction
40
What is the bias for single precision floating point numbers?
127
41
What is the bias for double precision floating point numbers?
1023
42
How many bits are used for the fraction in double precision?
52 bits
43
What is the command for single precision addition in MIPS?
add.s
44
What is the command for double precision addition in MIPS?
add.d
45
What is the command for single precision multiplication in MIPS?
mult.s
46
What is the command for double precision multiplication in MIPS?
mult.d
47
What are the two types of floating point instructions in MIPS?
Single precision and Double precision
48
What is the command for single precision division in MIPS?
div.s
49
What is the command for double precision division in MIPS?
div.d
50
What is the command for storing a word in single precision?
swcl
51
What is the command for loading a word in single precision?
lwcl
52
What is the purpose of the compiler?
To transform C programs into assembly language
53
What does: 1001 mean in Two's Complement?
-7 ## Footnote 1001 > -8 + 0 + 0 + 1 > -7
54
What does: 1001 mean in signed format?
-1 ## Footnote 1001 > - (0 + 0 + 1) > -1
55
What does the U in: addu subu sltu stand for?
U = Unsigned
56
What does the I in: addI subI sltI stand for?
I = Immediate
57
What is the main advantage to using 2's complement number?
You can subract numbers by negating and then adding
58
What is the scientific notation for floating point?
n = fx10^e ## Footnote n = number f = fractional number e = amount of space the decimal moved
59
Why can we store: 101.011 in memory?
A decimal point can't be stored