Difference between revisions of "CSC103 2011 Homework 3"
(→Problem #2) |
|||
Line 13: | Line 13: | ||
* Use the Processor/Memory simulator and write a program that starts with 4 numbers stored in memory Locations 14, 15, 16, 17, and that stores the sum of all 4 in memory Location 18. | * Use the Processor/Memory simulator and write a program that starts with 4 numbers stored in memory Locations 14, 15, 16, 17, and that stores the sum of all 4 in memory Location 18. | ||
− | * When you program works correctly, | + | * When you program works correctly, copy it to a text file of your choice. Save the file for right now. |
=Problem #2= | =Problem #2= | ||
Line 24: | Line 24: | ||
<br /> | <br /> | ||
− | * As with Problem 1, copy your solution | + | * As with Problem 1, copy your solution program at the end of the file you created for Problem 1. |
=Problem #3= | =Problem #3= | ||
Line 30: | Line 30: | ||
* Same as Problem #2, but without storing the ten numbers in memory. The program should generate all the numbers required in the accumulator, and use only 1 memory location to store data. | * Same as Problem #2, but without storing the ten numbers in memory. The program should generate all the numbers required in the accumulator, and use only 1 memory location to store data. | ||
− | * As with Problem #2, copy your solution to a file | + | * As with Problem #2, copy your solution to a file to the end of the same file as Problem 1 and Problem 2. |
+ | |||
+ | =Submission= | ||
+ | |||
+ | * Email the file containing the solution to all 3 problems as an email message (no attachment, please!), and address it o '''103b@cs.smith.edu'''. Make sure your name is at the top of the text of your message. | ||
+ | |||
+ | |||
<br /> | <br /> |
Revision as of 21:11, 14 February 2011
This homework is due on Monday, Feb. 21st, at 9:00 a.m. You should make sure that you have gone through all the steps of Lab #3 as preparation for this homework.
Contents
Problem #1
- Use the Processor/Memory simulator and write a program that starts with 4 numbers stored in memory Locations 14, 15, 16, 17, and that stores the sum of all 4 in memory Location 18.
- When you program works correctly, copy it to a text file of your choice. Save the file for right now.
Problem #2
- Write another program that computes the sum of the integers 1, 2, 3, 4, 5, 6, 7, 8, 9 and 10, and stores the sum in Memory Location 20 (or other convenient location). Your program should stop when it has finished adding the number 10 to Memory Location 20.
- Make your program store the ten numbers 1, 2, 3, ... 10 in 10 memory locations, and add them up to compute the sum
- Your program should stop automatically when it is done.
- As with Problem 1, copy your solution program at the end of the file you created for Problem 1.
Problem #3
- Same as Problem #2, but without storing the ten numbers in memory. The program should generate all the numbers required in the accumulator, and use only 1 memory location to store data.
- As with Problem #2, copy your solution to a file to the end of the same file as Problem 1 and Problem 2.
Submission
- Email the file containing the solution to all 3 problems as an email message (no attachment, please!), and address it o 103b@cs.smith.edu. Make sure your name is at the top of the text of your message.