CS1021 Assignment #2 Memory solved

$29.99

Original Work ?

Download Details:

  • Name: CS1021-Assignment-2.zip
  • Type: zip
  • Size: 812.41 KB

Category: You will Instantly receive a download link upon Payment||Click Original Work Button for Custom work

Description

5/5 - (3 votes)

This is an individual assignment and will contribute 10% of your final mark for CS1021.
You must submit your solutions using Blackboard no later than 23:59 on Wednesday 21st December 2016. Late submissions without a satisfactory explanation will receive zero marks. You will not be asked to demonstrate your solution, however, you should expect someone grading your programs to execute them. It will be assumed that programs that do not build without errors do not work.
Submit your .s assembly language source files and your report in PDF format as attachments to “Assignment #2” in Blackboard.
Your .s assembly language source files must be suitably commented.
Solutions will be checked for plagiarism.
1 Sets – Closure
Assume a mathematical set, A, containing 32-bit signed integers is stored in memory. The following ARM Assembler directives illustrate how the set is arranged in memory.
1 ASize DCD 8 ; Number of elements in Set A 2 AElems DCD +4,−6,−4,+3,−8,+6,+8,−3 ; Elements in Set A
Design and write an ARM Assembly Language program that will determine whether the set is closed under the negation operation. In other words, your program should determine whether, for every integer in the set, the set also contains the negation of that integer.
The set A in the example above is closed under the negation operation as it contains both +3 and -3, +4 and -4, +6 and -6 and +8 and -8.
Use the Closure µVision project to develop your solution. Your program should store 1 in R0 if the set is closed under negation and zero otherwise.
Page 1 of 2
School of Computer Science and Statistics CS1021 / Introduction to Computing I
2 Sets – Symmetric Difference
Assume two mathematical sets, A and B, containing 32-bit unsigned integers are stored in memory. The following ARM Assembler directives illustrate how the sets are arranged.
1 ASize DCD 8 ; Number of elements in Set A 2 AElems DCD 4 ,6 ,2 ,13 ,19 ,7 ,1 ,3 ; Elements in Set A
3 4 BSize DCD 6 ; Number of elements in Set B 5 BElems DCD 13 ,9 ,1 ,20 ,5 ,8 ; Elements in Set B
Design and write an ARM Assembly Language program that will create a third set, C, that is the symmetric difference of A and B.
Use the SymmDiff µVision project to develop your solution. Your program should store the size and elements of set C in memory using the memory set aside in the template project.
3 Anagrams
Two strings are anagrams of each other if one string can be formed by rearranging the characters of the other. Each letter of one string may only be used once to form the other string. For example, ”tacos” is an anagram of ”coats”. The string ”bests” is not, however, an anagram of ”beets” because although they contain the same characters, each character does not occur the same number of times.
Design and write an ARM Assembly Language program to determine if one string is an anagram of another string.
Use the Anagram µVision project to develop your solution. The template code in the project stores the start address of string A in R1 and the start address of string B in R2. Your program should store 1 in R0 if the string is an Anagram and zero otherwise.
Evaluation
The following broad marking scheme will be used for the assignment:
• Closure – 25%
• Symmetric Difference – 25%
• Anagrams – 25%
• Documentation – 25%
Note that marks will be awarded for both the content and presentation of your report document. Solutions that are merely working will not automatically attract 100% of the marks available. Marks will also be awarded for the quality of the solution.