Please do in MIPS and show all work
Two useful macros: not $ Rd, $Rs is implemented as nor $Rd, $Rs, $0, a macro (or pseudoinstruction). nop (no-operation, which has no operands) is a macro of either or $0, $0, $0 or even more simply, sll $0, $0, 0 which is actually 0x00000000 in MIPS machine code. And this is, in fact, a very useful instruction! The immediate bitwise logical instructions left-zero-fill the 16-bit immediate field to 32 bits. 1. For the following hexadecimal bit patterns, determine the result of executing or, and, xor and nor on the patterns. After trying by hand, write a little MIPS program to check your results Ox1234 and OxFFFF OxFEDC and Ox5678 For these, you may load the 16-bit values using ori with $zero to get them into registers to test. 2. Verify, using a truth table, that the result of NORing a value with 0 is the same as NOTing (bitwise complementing) the value. Then extend the program you wrote in part 1 to test this with a few values. 3. Given the following bit patterns, try to predict the results of executing sll, srl and sra on them to move the patterns left or right 2, 3, 4 and 5 places. You can use the li (load immediate) macro for 16- or 32-bit values (li is a macro that expand into one or two instructions, depending on the size of the macro's immediate field). If you set Accept Pseudo Instructions ON in QtSpim, this will work. Check your predictions by extending the program again. Oxffffffff 0x96969696 Ox 87654321 Two useful macros: not $ Rd, $Rs is implemented as nor $Rd, $Rs, $0, a macro (or pseudoinstruction). nop (no-operation, which has no operands) is a macro of either or $0, $0, $0 or even more simply, sll $0, $0, 0 which is actually 0x00000000 in MIPS machine code. And this is, in fact, a very useful instruction! The immediate bitwise logical instructions left-zero-fill the 16-bit immediate field to 32 bits. 1. For the following hexadecimal bit patterns, determine the result of executing or, and, xor and nor on the patterns. After trying by hand, write a little MIPS program to check your results Ox1234 and OxFFFF OxFEDC and Ox5678 For these, you may load the 16-bit values using ori with $zero to get them into registers to test. 2. Verify, using a truth table, that the result of NORing a value with 0 is the same as NOTing (bitwise complementing) the value. Then extend the program you wrote in part 1 to test this with a few values. 3. Given the following bit patterns, try to predict the results of executing sll, srl and sra on them to move the patterns left or right 2, 3, 4 and 5 places. You can use the li (load immediate) macro for 16- or 32-bit values (li is a macro that expand into one or two instructions, depending on the size of the macro's immediate field). If you set Accept Pseudo Instructions ON in QtSpim, this will work. Check your predictions by extending the program again. Oxffffffff 0x96969696 Ox 87654321