

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


(You have your choice of doing either Booth’s algorithm OR the bit string set-of-letters assignment)
Booth’s Algorithm Option:
The goal of this assignment is to provide you with experience in using the "Logical and Shift Instructions". For this assignment, you are to implement Booth's multiplication algorithm on two 32-bit signed integers and get a 64-bit integer result.
I want you to write a function called "Multiply" that is passed two signed integers (in a1 and a2) and returns their 64-bit product across registers a1 and a2. Register a1 should return the most-significant 32-bits of the product and a2 should contain the least-significant 32-bits of the product. Be sure that you DO NOT use any form of the multiply (i.e., MUL) assembly language instruction, and be sure to follow the ARM register convensions when implementing "Multiply."
Your "main" program should:
The data AREA of your program should look something like:
AREA BOOTHS_PROGRAM, DATA, READWRITE ALIGN MULTIPLICAND DCD - MULTIPLIER DCD 983 PRODUCT DCD 0,
STACK_END SPACE 0x000000FF ALIGN STACK_START DCD 0 END
Bit string set-of-letters Option:
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.
'Z' 'Y' 'X'... 'E' 'D' 'C' 'B' 'A'
bit position: (^25 24 23 4 3 2 1 )
{ 'A', 'B', 'D', 'Y' } is 0 0 0 0 0 0 0 1 0 0 1 0 1 1
unused
The set of letters ADT should have the following operations (subprograms):
Writes the bitString to memory in the form of a null terminated ASCII character string. The string should be written in the conventional format, i.e., "{ E, G, T, Y }"
passed a set bitString and a pointer to a character buffer ( bytes)
writeString
Returns 1 (true) if the `ASCII character is in the bitString set; otherwise return 0 (false).
passed an ASCII character and a set bitString returns a Boolean (0 for false or 1 for true)
contains
The resulting set should contain the elements that are in the first set, but not also in the second set.
passed two set bitStrings returns the set difference of the first set - second set
difference
The resulting set should contain the elements that are in both of the input sets.
passed two set bitStrings returns the set intersection of the two sets
intersection
The resulting set should contain the elements that are in one or both of the input sets.
passed two set bitStrings returns the set union of the two sets
union
Returns a bit string corresponding to the set of letters in the null terminated string. Non-letter characters are ignored, and both upper and lower-case letters should be represented as the upper-case letter.
pass in a pointer to a null terminated ASCII string returns a 32-bit word containing the set of letters as a bitString
bitString
Subprogram Parameters Description Name
Additionally, you should have a main program that