Difference between revisions of "CSC103 Homework Assignment 3"

From dftwiki3
Jump to: navigation, search
(Problem #1)
(Problem #1)
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
This assignment is due Wednesday, Oct 8th.
 
This assignment is due Wednesday, Oct 8th.
 +
The answer for Problem #1, the Wiki page must be finished before midnight Wednesday evening.
 +
The answers for Problem #2 must be handed in class on Oct. 8th.
  
 
=Problem #1=
 
=Problem #1=
Ehance your Wiki page by adding a section that describes what all the different parts of the computer do.  For each of the part that you photographed in the "Open it up!" Lab, add a '''paragraph''' describing what that particular part does.
+
Enhance your Wiki page by adding a section that describes what all the different parts of the computer do.  For each of the part that you photographed in the "Open it up!" Lab, add a '''paragraph''' describing what that particular part does.
  
 
Organize your Wiki page so that it has two main sections, the first one will be a description corresponding to this homework assignment, the second one will be the step-by-step description of your lab.  This way when we print your Wiki for grading, we'll print only the first part corresponding to this homework assignment.
 
Organize your Wiki page so that it has two main sections, the first one will be a description corresponding to this homework assignment, the second one will be the step-by-step description of your lab.  This way when we print your Wiki for grading, we'll print only the first part corresponding to this homework assignment.
Line 17: Line 19:
 
* the cd-rom
 
* the cd-rom
 
* the power-supply
 
* the power-supply
 +
* the battery
 +
* the crystal (for those of you who have pictures of it!)
 
* the cables
 
* the cables
  
Line 37: Line 41:
 
===Additional information===
 
===Additional information===
  
In the paragraphs describing the different parts, I would like to section for the processor, I would like to see you include the follo
+
In the paragraphs describing the different parts, I would like to see you include the following words (with relevant explanations around) in each section:
 +
* '''Processor''': use the words Pentium, Intel, transistors, Megahertz (MHz)
 +
* '''Memory''': bits, bytes, program, operating system, Megabytes, Gigabytes.
 +
* '''CDROM/DVDROM''': optical, laser, pits, bits.
 +
* '''Hard drive''': magnetic, tracks, bits, read-write head.
 +
* '''Power supply''':  110 Volts, 5 Volts, 12 Volts.
 +
* '''Cables''': bits
 +
* '''Motherboard''': wires, bus.
 +
* '''Battery''': time
 +
* '''Crystal''': Megahertz.
  
 
=Problem #2=
 
=Problem #2=
  
Problem #2 will be given out after the lecture on Monday Sept. 29th.
+
==Program #1==
  
[[Image:PageUnderConstruction.gif]]
+
* For this part, I would like you to type up your answers, as copying programs by hand is a good way to report mistakes and miss important details.  I am providing you with information below on how to easily save your programs to Notepad.
 +
 
 +
* You are encouraged to work in pair on this problem.  Programming is an activity that is less prone to errors if two programmers work together.  So work in pairs, and provide only one answer sheet with both names on it.
 +
 
 +
 
 +
<!-- [[Image:PageUnderConstruction.gif]]-->
 +
* Write an assembly language program that starts with the numbers below in memory and that computes the sum of the first two, minus the third one, and stores the result at Memory Address 13:
 +
 
 +
 
 +
10 6
 +
11 5
 +
12 9
 +
13 0
 +
 
 +
 
 +
* When your program works the way you want, click on '''Disassemble''' and the applet will automatically take the numbers in memory and create what it thinks is the closest representation of it in an editor window.
 +
 
 +
<br />
 +
: You can edit it if you wish and put the result back in memory by clicking on the '''Translate''' button.
 +
 
 +
<br />
 +
 
 +
* For the purpose of this assignment, just copy the program to the clipboard, and paste it into a text file which will contain the different programs you have to write for this assignment.
 +
 
 +
* All the instructions supported by this simulator are available [http://tango.csc.smith.edu/dftwiki/index.php/CSC103_Basic_Instructions here]
 +
 
 +
==Program #2==
 +
 
 +
* Assume that we have the following number stored in memory at Address 20:
 +
 
 +
20 5
 +
 
 +
* Write a program that contains a loop and that stores the sum of all the numbers  5 + 4 + 3 + 2 + 1 = 15 at Address 21. 
 +
* Make sure that if you change the number stored at 20, the program computes a different sum.  For example, if Address 10 contains 3, then the program stores 3+2+1 = 6 at Address 21.
 +
 
 +
* Collect your two programs and print them on paper, and make sure your name or names are included.
 +
 
 +
<!--
 +
solution:
 +
; xComputer Memory Dump
 +
; Wed Oct 01 15:18:58 EDT 2008
 +
 
 +
LOD-C 0
 +
STO 21
 +
LOD-C 5
 +
STO 20
 +
LOD 20
 +
ADD 21
 +
STO 21
 +
LOD 20
 +
DEC
 +
STO 20
 +
JMZ 12
 +
JMP 4
 +
HLT
 +
 
 +
-->

Latest revision as of 21:35, 14 October 2008

This assignment is due Wednesday, Oct 8th. The answer for Problem #1, the Wiki page must be finished before midnight Wednesday evening. The answers for Problem #2 must be handed in class on Oct. 8th.

Problem #1

Enhance your Wiki page by adding a section that describes what all the different parts of the computer do. For each of the part that you photographed in the "Open it up!" Lab, add a paragraph describing what that particular part does.

Organize your Wiki page so that it has two main sections, the first one will be a description corresponding to this homework assignment, the second one will be the step-by-step description of your lab. This way when we print your Wiki for grading, we'll print only the first part corresponding to this homework assignment.

=103a-xx Open-it Up! Lab=

==The main parts inside a computer, and how they work==

You will add the new information here
* the processor
* the memory
* the disk drive
* the cd-rom
* the power-supply
* the battery
* the crystal (for those of you who have pictures of it!)
* the cables

===References===


==Lab report==

(This part will be the old lab)

Add references to documents and Web resources you get your information from. Use this document for examples. If your reference is on the Web, make sure you also add a link to this location on your Wiki.

You may find some good information in the following places:

and elsewhere!

Additional information

In the paragraphs describing the different parts, I would like to see you include the following words (with relevant explanations around) in each section:

  • Processor: use the words Pentium, Intel, transistors, Megahertz (MHz)
  • Memory: bits, bytes, program, operating system, Megabytes, Gigabytes.
  • CDROM/DVDROM: optical, laser, pits, bits.
  • Hard drive: magnetic, tracks, bits, read-write head.
  • Power supply: 110 Volts, 5 Volts, 12 Volts.
  • Cables: bits
  • Motherboard: wires, bus.
  • Battery: time
  • Crystal: Megahertz.

Problem #2

Program #1

  • For this part, I would like you to type up your answers, as copying programs by hand is a good way to report mistakes and miss important details. I am providing you with information below on how to easily save your programs to Notepad.
  • You are encouraged to work in pair on this problem. Programming is an activity that is less prone to errors if two programmers work together. So work in pairs, and provide only one answer sheet with both names on it.


  • Write an assembly language program that starts with the numbers below in memory and that computes the sum of the first two, minus the third one, and stores the result at Memory Address 13:


10 6
11 5
12 9
13 0


  • When your program works the way you want, click on Disassemble and the applet will automatically take the numbers in memory and create what it thinks is the closest representation of it in an editor window.


You can edit it if you wish and put the result back in memory by clicking on the Translate button.


  • For the purpose of this assignment, just copy the program to the clipboard, and paste it into a text file which will contain the different programs you have to write for this assignment.
  • All the instructions supported by this simulator are available here

Program #2

  • Assume that we have the following number stored in memory at Address 20:
20 5
  • Write a program that contains a loop and that stores the sum of all the numbers 5 + 4 + 3 + 2 + 1 = 15 at Address 21.
  • Make sure that if you change the number stored at 20, the program computes a different sum. For example, if Address 10 contains 3, then the program stores 3+2+1 = 6 at Address 21.
  • Collect your two programs and print them on paper, and make sure your name or names are included.