MIPs Instruction Set Flashcards
How can XOR be used in machine code?
To clear a register
XORing a number with itself results in zero.
What happens when you XOR a number with itself?
The result is zero
This is a property of the XOR operation.
What is the effect of XORing a number twice?
You get the original number back again
This property can be useful in encryption schemes.
What is the result of zero-extending a 16-bit immediate value?
The upper 16 bits contain all zeroes
This is relevant when working with immediate values in logical operations.
What is the syntax for the AND immediate operation in MIPS?
andi $rt, $rs, immed
This operation performs a bitwise AND with an immediate value.
What is the syntax for the OR immediate operation in MIPS?
ori $rt, $rs, immed
This operation performs a bitwise OR with an immediate value.
What is the syntax for the XOR immediate operation in MIPS?
xori $rt, $rs, immed
This operation performs a bitwise XOR with an immediate value.
What ae the 3 types of MIPs instructions?
R-Type
I-Type
J-Type
What does a R-Type instruction refer to?
Register type
How many bits are in each & what does each mean?
op - 6 bits - Specifies the operation
rs - 5 bits - Address of the first operand
rt - 5 bits - Address of the second operand
rd - 5 bits - Address of the results destination
shamt - 5 bits - Shift amount
funct - 6 bits - Function code
R-Type instruction
How many operations can the opcode carry out in R-Type, I-Type, J-Type?
64 operations
6 bits = 2^6 = 64 operations
How many bits are in each & what does each mean?
op - 6 bits - opcode that specifies the operation
rs - 5 bits - register file address of the base address register
rt - 5 bits - register file address to receive result of the load
offset - 16 bits - Constant or address offset
I-Type instruction
How many bits are in eacg & what does each mean?
op - 6 bits - opcode that specifies the jump operation
address - 26 bits - target address
SSconcatenated with upper four bits of PC
and 00 appended to end
What does sll & srl mean?
Shift left & Shift right
Why do we use sll & srl?
Used in multiplication & division
It’s much faster
What is the output to a OR gate?
Must be atleast 1
What is the output to a NOR gate?
Must be no 1s (Opposite of OR)
What type of gate is this?
AND Gate
What bitwise operation is this?
______ $t0,$t1,$t2
OR
What bitwise operation is this?
______ $t0,$t1,$t2
NOR
What bitwise operation is this?
______ $t0,$t1,$t2
XOR
What type of gate is this?
OR Gate
What type of gate is this?
NOR Gate
What type of gate is this?
XOR Gate