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 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