Homework 6 - Computer Organization Due: 11/11/05 (F)

You are to build an abstract-data type (ADT) for the set of letters using a bit string. The bit string representation for the set of letters can use a 32-bit word with the least-significant bit associated with the letter 'A', etc.

The set of letters ADT should have the following operations (subprograms):

Subprogram Name Parameters Description
bitString
  • pass in a pointer to the an .ASCIIZ string
  • returns a word containing the set of letters as a bitString
Returns a bit string corresponding to the set of letters in the .ASCIIZ string. Non-letter characters are ignored, and both upper and lower-case letters should be represented as the upper-case letter.
union
  • passed two set bitStrings
  • returns the set union of the two sets
The resulting set should contain the elements that are in one or both of the input sets.
intersection
  • passed two set bitStrings
  • returns the set intersection of the two sets
The resulting set should contain the elements that are in both of the input sets.
difference
  • passed two set bitStrings
  • returns the set difference of the first set - second set
The resulting set should contain the elements that are in the first set, but not also in the second set.
contains
  • passed an .ASCII character and a set bitString
  • returns a Boolean (0 for false or 1 for true)
Returns 1 (true) if the .ASCII character is in the bitString set; otherwise return 0 (false).
print
  • passed an set bitString
Prints the bitString to the console using the print_string system call. The set should be printed in the conventional format, i.e.,

"{ E, G, T, Y }"

Additionally, you should have a main program that

  1. allows a user to interactively enter two strings,
  2. constructs two bitString sets from these strings,
  3. prints the set of letters contained in each string,
  4. determines and prints the union, intersection, and difference of two bitString sets,
  5. checks to see if the first bitString set contains the letters: 'A', 'Q', 'Y', and 'Z'. The results of each of these checks should be printed to the console.
Turn in the following:

1) The MIPS assembly language program. Use the MIPS register conventions correctly and include comments describing which registers are being used for parameters and local variables.

2) The "output" of the MIPS program. I want a picture of console window in the MIPS simulator after the program has run.