Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please do in MIPS and show all work Two useful macros: not $ Rd, $Rs is implemented as nor $Rd, $Rs, $0, a macro (or

image text in transcribed 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Privacy In Statistical Databases International Conference Psd 2022 Paris France September 21 23 2022 Proceedings Lncs 13463

Authors: Josep Domingo-Ferrer ,Maryline Laurent

1st Edition

3031139445, 978-3031139444

More Books

Students also viewed these Databases questions

Question

6. What is the value of poise over perfection?

Answered: 1 week ago