Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MIPS Bit Strings In this lab all data is to be regarded as bit strings representing subsets of the set {1 2.... 32} If the

MIPS Bit Strings image text in transcribed
In this lab all data is to be regarded as bit strings representing subsets of the set {1 2.... 32} If the bit string has a 1 in position i, then element i is included in the subset Therefore, the string 1000 1001 1100 0000 0000 0010 1000 1110 corresponds to the set (2,3,4,8,10,23,24,25,28,22) Write MIPS assembly functions to do the following. Punt out a set. 1 do not care about the format. You can print from smaller to larger or from larger to smaller 1 would do a loop that went from 1 to 32 (or from 32 to 1) I would load a masking bit pattern that corresponded to the position number of the loop counter (0x00000001 for 1 or 0x80000000 for 32). Isolate the bit in the operand by using the AND operation If the result of the AND is not 0 then the loop counter is in the set and should be displayed Increment (decrement) the counter and shift the masking bit pattern to the left or the right depending on the starting pattern Determine if an element is a member of a given set In this lab all data is to be regarded as bit strings representing subsets of the set {1 2.... 32} If the bit string has a 1 in position i, then element i is included in the subset Therefore, the string 1000 1001 1100 0000 0000 0010 1000 1110 corresponds to the set (2,3,4,8,10,23,24,25,28,22) Write MIPS assembly functions to do the following. Punt out a set. 1 do not care about the format. You can print from smaller to larger or from larger to smaller 1 would do a loop that went from 1 to 32 (or from 32 to 1) I would load a masking bit pattern that corresponded to the position number of the loop counter (0x00000001 for 1 or 0x80000000 for 32). Isolate the bit in the operand by using the AND operation If the result of the AND is not 0 then the loop counter is in the set and should be displayed Increment (decrement) the counter and shift the masking bit pattern to the left or the right depending on the starting pattern Determine if an element is a member of a given set

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

Graph Databases In Action

Authors: Dave Bechberger, Josh Perryman

1st Edition

1617296376, 978-1617296376

More Books

Students also viewed these Databases questions

Question

What kind of attack can be prevented by applying software patches?

Answered: 1 week ago