stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Comp Org Test #2 Flashcards | StudBud
Explore
/
Comp Org Test #2
Comp Org Test #2
48 terms
·
StudBud Administration
Imported from external platform
Flashcards
48 cards
F
Practice quiz
P
Host live
L
Questions
48
Answers
1
What command does comparisons of floating point registers
c.lt.f
bne
c.lt.s
beq
2
What are the units on the offset in the beq and bne instructions?
words
bytes
nibbles
bits
3
Which converts high-level language into assembly?
The compiler
The Operating System
The kernel
The assembler
4
Which register is used as the stack pointer in MIPS?
$t0
$ra
$sp
$a0
5
What is stored in the stack during a procedure call?
Only local variables
Heap memory
Global variables
Return address and local variables
6
1 0000 0000 0000 0000 0000 0000 0000 0000
Infinity
Negative Infinity
NaN
Denormalized
7
0 0000 0000 0000 0000 0000 0000 0000 0000
Denormalized
Infinity
Negative infinty
NaN
8
What happens if a procedure fails to restore the stack pointer ($sp) properly before returning?
Nothing happens, since $sp is not essential
The program automatically fixes the issue
The program runs normally
The procedure returns to the wrong address, possibly causing a crash
9
Which registers are read only?
$pc
$zero
MIPS has no read only
$v0
10
What does little-endian mean?
idk
Method of offsetting
byte order where lsb is at the highest memory address
byte order where lsb is at the lowest memory address
11
What is the correct order of operations when implementing a non-leaf procedure?
Save $ra → Allocate stack space → Execute body → Restore stack → Return
Allocate stack space → Save $ra → Execute body → Restore stack → Return
Execute body → Save $ra → Allocate stack space → Restore stack → Return
Allocate stack space → Execute body → Save $ra → Restore stack → Return
12
0 1111 1111 0000 0000 0000 0000 0000 000
Negative infinity
NAN
Infinity
Denormalized
13
Which of these would change the last 4 bits of a value to 1s
0xff
0xf
14
Which of these MIPS registers could change after the execution of a branch instruction?
$pc
$sp
$v0
$ra
15
Which of the following is an invalid MIPS instruction
jal label
beq $t0, 5, label
jr $t0
bne $t1, $t2, 12
16
What is the largest unsigned integer value you can represent with one byte?
128
127
256
255
17
You want critical sections to be as long as possible
True
False
18
What are the round, guard, and sticky bits for?
Handle overflow of arithmetic operations
Assist with rounding for precision
Keep track of long decimals
19
How many bits to identify a register
6
5
16
10
20
How many bits are needed in the opcode?
16
5
6
10
21
What is the key difference between an unconditional jump (j label) and a jump register (jr $register) in MIPS assembly?
They perform the same function but have different syntax
j label stores the return address, while jr $register does not
jr $register is slower than j label
jr $register can jump anywhere
22
0 0000 0000 0000 0000 0000 0010 1010 0010
Denormalized
Negative infinity
NaN
Infinity
23
In a nested procedure call, what happens if a callee procedure does NOT save $ra before calling another function?
The program will continue normally
The stack pointer adjusts automatically to compensate
The return address gets overwritten, and control is lost
The outer procedure’s local variables are corrupted
24
Which of these MIPS commands is a pseudo-instruction?
ori
li
sll
lui
25
What is the function of $ra in procedure calls?
Stores temporary values
Allocates memory dynamically
Holds the return address of the caller
Holds the first argument
26
MIPS is little-endian
True
False
27
What is a non-leaf procedure?
A procedure that does not use the stack
A procedure that calls at least one other procedure
A procedure that has multiple return statements
A procedure that does not call other procedures
28
An offset can be negative
True
False
29
What value(s) must be pushed onto the stack when calling a procedure from another procedure?
the calling procedure’s return address
the calling procedure’s return value
the calling procedure’s arguments
all of these
30
Which of these is NOT an acceptable use of the system stack in MIPS
Preserving a procedure's local variables
None of these(all are acceptable)
Using save registers inside a procedure
Passing more than four arguments to a procedure
31
Which of these types of values should be treated as unsigned
Offsets from Memory Addresses
Memory Addresses
ASCII Values
32
Which is NOT a benefit of two's complement?
Most significant bit indiciates the sign value
No Problem with Overflow
Arithmetic always works
Avoids negative 0
33
Which of the following correctly describes how the stack grows in MIPS?
Grows upwards in memory
Uses registers only, no memory allocation
Does not grow, remains static
Grows downwards in memory
34
What does bc1t do?
Set the condition flag to 1
Set condition flag to 0
Branch if condition is true
Branch if condition is false
35
Why should you not print within a procedure
May not preserve $ra
Ineffecient
Can overwrite values
Just for coonvention
36
Which of the following scenarios will NOT cause stack corruption?
Forgetting to save $ra before a nested function call
Failing to restore $sp before returning
Using $s registers without saving them
Using $t registers across multiple function calls
37
Which of the following logical expressions is NOT equivalent to the others?
!A || B == !(A && !B)
(A || !B) && (!A || B) == A XOR B
!(A && B) == !A || !B
!(A || B) == !A && !B
38
Which of these MIPS instructions performs sign extension?
add
ori
lbu
All of them
39
What's wrong with this loop?
$t0 will always remain zero
The beq condition is checked too late
The loop executes one extra time
$t1 underflows and causes an infinite loop
40
Which of these help with cocurrency in operating systems
Critical Sections
Atomic Operations
Semaphores
The system Stack
41
Which mathematical or logical operation does slt rely on?
bitwise OR
division
bit shift
subtraction
42
In a high level language program, where are variable values stored?
In CPU cache
In registers
In main memory
In mass Storage
43
The kernel has access to and manages hardware
True
False
44
What does the assembler do?
Convert Code from binary to assembly
Convert code from assembly to binary
Convert high level language to binary
Idk
45
What is the smallest exponent that can be represented by IEE single-precision
-126
-255
-127
-149
46
How large can a constant be when used in MIPS immediate format instruction
32 bits
16 bits
8 bits
64 bits
47
How many return values can a procedure have?
4
None
As many as you like(using stack)
2
48
In the j instruction, how many bits are used to represent the offset?
32
26
16
8