MIPS Items Part 2 Flashcards

1
Q

SLL or SRL

A

Shifting left by i bits gives the same result and multiplying by $2^i.
Shifting right is the same as integer division by 2 each bit.

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

And

A

$t2: 0000 0000 0000 0000 0000 1101 1100 0000

$t1: 0000 0000 0000 0000 0011 1100 0000 0000

and $t0, $t1, $t2

$t0: 0000 0000 0000 0000 0000 1100 0000 0000

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

Or

A

$t2: 0000 0000 0000 0000 0000 1101 1100 0000

$t1: 0000 0000 0000 0000 0011 1100 0000 0000

or $t0, $t1, $t2

$t0: 0000 0000 0000 0000 0011 1101 1100 0000

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

xor

A

1100
1010
0110

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

Standard Bit enumeration

A

Big Endianess
Big Endian is a convention where the most significant byte (MSB) of a word is stored at the lowest memory address.

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

Setting, Clearing, inverting bits in MIPS

A

OR to set, mask ex: 00001
AND to Clear, mask ex: 11110
Invert with XOR, just put the same digit in bit location

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

Setting, clearing, inverting specific bits in the value in C++

A

int value = 5; // Binary: 0000 0101
int position = 1;
value = value | (1 &laquo_space;position); // Set the bit at position 1
// Result: Binary 0000 0111 (Decimal: 7)
—- Clear
int value = 7; // Binary: 0000 0111
int position = 1;
value = value & ~(1 &laquo_space;position); // Clear the bit at position 1
// Result: Binary 0000 0101 (Decimal: 5)
—- Invert
int value = 5; // Binary: 0000 0101
int position = 0;
value = value ^ (1 &laquo_space;position); // Invert the bit at position 0
// Result: Binary 0000 0100 (Decimal: 4)

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

Mask

A

is a value that allows us to operate with specific bits

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

&& and & in C++

A

&& is logical like if ( 5>1 && 4>3)
& is BITWISE AND
int a = 5; // Binary: 0101
int b = 3; // Binary: 0011

int result = a & b; // Binary: 0001 (Decimal: 1)

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