Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
Page 1 of 5 
Western Sydney University 
Computer Organisation 300096 Laboratories 
 
INTRODUCTION: 
Computer Organisation lab consists of 11 workshops (or laboratories, or practicals). The labs start in week 
2. See the detailed delivery schedule on the unit Web site.  
There is a lab sheet for each workshop, which contains the description of the preparation required for the 
workshop, a list of tasks to be performed, and a number of questions related to workshop topics.  
In the lab students will write simple programs using MIPS assembly language. The CLASSIC software tool 
used is PCSpim/QtSpim, which is a simulator of the MIPS RISC processor. Using a simulator, instead of 
using the assembler directly has many advantages in the learning environment. With the simulator it is easy 
to debug programs, to observe and manipulate the contents of registers and memory etc. The simulator offers 
much more control over the execution of the programs than bare hardware. Naturally there are also some 
limitations, especially when it comes to simulating the interactions between the program and its 
environment, and also a considerably longer execution time. 
LAB WORK: 
The amount of time needed to complete all the practical tasks may exceed the time allocated to the 
supervised labs. There are no assignments in this subject, and the total workload is similar to the workload in 
other subjects at this level. Students are expected to work in their own time, writing, debugging, and testing 
their programs. PCSpim/QtSpim, the main software tool used in the labs, is free. If you have a PC at home, 
it is a good idea to get a copy of PCSpim/QtSpim (http://pages.cs.wisc.edu/~larus/spim.html, or 
https://sourceforge.net/projects/spimsimulator/files/, where versions available for Windows, Mac, and Linux 
boxes), so you can prepare for the labs, and complete the work started at the Uni. You are also allowed to use 
your own laptops in the lab, if you wish to do so.  
 
In addition to PCSpim/QtSpim, there are other SPIM programming environments: MARS, MIPSter, and 
EduMIPS64 etc. You can explore MARS, MIPSter, or EduMIPS64 in your own time if you wish to use them 
for your lab exercises. Each simulator has its advantages; you have free choices. Note that the classic 
PCSpim is not outdated; rather its operation style helps reveal many technical details. The PCSpim interface 
will be normally referenced to as samples in practicals or tests. 
It is expected that you read lab instructions, and prepare yourself well before coming to the lab. You can 
do as many lab tasks as you like at home, before coming to your lab. However please DO NOT come to a 
lab completely unprepared, you will be wasting your time and risking getting very low mark.  
DUE TIME: 
The unit learning guide says practicals are due by “weekly tutorial time for the corresponding laboratory 
tasks” and the lab sheet gives the due week. They together indicate the accurate due time for an individual 
student registered in a specific tutorial session. That is, the practical work is due by the beginning of the 
weekly tutorial time (not after the tutorial session) that the student is registered in. Sorry, it’s not feasible to 
give due on Tuesday at 11:59pm or Wednesday at 09:59 in the weekly lab sheet as there are different tutorial 
sessions each week. 
Lab 1 starts in week 2 and is supposed to be submitted before your corresponding session starts in week 3; 
Lab 2 starts in week 3 and is supposed to be submitted before your corresponding session starts in week 4; 
Lab 3 starts in week 4 and is supposed to be submitted before your corresponding session starts in week 5; 
… … 
Lab 6 starts in week 7 and is supposed to be submitted before your corresponding session starts in week 8; 
Lab 7 starts in week 8 and is supposed to be submitted before your corresponding session starts in week 10 
(week 9 is intra-session break); 
Lab 8 starts in week 10 and is supposed to be submitted before your corresponding session starts in week 11; 
… … 
 
Page 2 of 5 
Western Sydney University 
/* A formal expression for your information */ 
With Lab[i], i = {1..11} 
 Lab[i].start = Week[i+1] (i <= 7) 
 Lab[i].start = Week[i+2] (i > 7) 
 Lab[i].due = before your corresponding session in Week[i+2] (i < 7) 
 Lab[i].due = before your corresponding session in Week[i+3] (i >= 7) 
The unit learning guide states that "Unless an extension to a further date is granted to the student by the unit 
coordinator, no late submission is accepted. An extension of time may be granted only under exceptional 
circumstances by the unit coordinator. Resubmission of the laboratory work is not permitted in this unit." So 
please be advised that there are normally no catch-ups and no late submissions. That is, practical tasks 
submitted after the starting of the due practical session, which the student is registered in, are not accepted 
normally. 
Students should follow the unit administrative rules stated in the unit learning guide. We ensure all students 
are treated fairly and equally; they are studying in a "level-playing field" that no one suffers from any 
disadvantage and no one is offered more advantages over others. 
ASSESSMENT: 
There are 11 lab tasks, maximum mark for each workshop varies as described in each lab sheet. Total max. 
mark of these 11 lab tasks is 40, which constitutes 40% of the total mark for the subject. Please see also the 
Unit Outline and Learning Guide for additional details relating to assessment process. 
The answers to the lab questions should be well documented for grading. The commonly acceptable 
documentation format is DOC, PDF, and TXT. The work submitted should include:  
 All the necessary written responses in text, schematic drawing, or other appropriate format. 
 Recorded screen shots or step-by-step description for lab demonstration activity. 
 As well as the relevant .s source files (compulsory for programming tasks). 
Only questions completed are assessable. There are no remedial labs; no extensions and late submissions are 
accepted without a genuine reason. 
Any program logical errors will detract from the full mark. A logical error is any discrepancy between the 
program specification and its actual functionality, failure to test for boundary conditions, failure to explore 
full range of input data etc. Students are encouraged to present programs which are fully debugged, and do 
not have assembly language errors, or run time errors. 
/* For on-campus in-class marking */ 
You must present your work to the class tutor for grading. The work submitted to the tutor can be printed, 
neatly hand-written, or eCopy on computer. For questions where written answers are required, only answers 
in writing are assessable. No marks for the lab can be obtained without demonstrating your work 
during laboratory.  
/* For online teaching mode */ 
You are required to submit your work into the corresponding drop-boxes on vUWS. The grading will be 
mainly based on the submissions on vUWS. The work submitted should be well-presented and have 
adequate information ready for after-class marking. You’ll likely use a Word .doc file to organise the 
required written answers to lab questions (preparation questions and lab tasks). For coding tasks, .s program 
file(s) (source code) must be submitted separately (rather than included in the word document). Faulty 
submissions (e.g. Prac 3 is submitted as Prac 4 where the latter is supposed to be submitted; the work for a 
totally different unit is submitted as what is expected for this unit) will result in a zero mark for the submitted 
practical work. 
With online teaching, the in-class demo for the practical tasks is not normally pre-scheduled. However, 
students may be randomly selected to demonstrate their lab work during tutorial time online (e.g. via Zoom 
Page 3 of 5 
Western Sydney University 
Breakout room) when possible. 
MOSS - A System for Detecting Software Plagiarism 
MOSS (for a Measure Of Software Similarity) is an automatic system for determining the similarity of programs. 
To date, the main application of Moss has been in detecting plagiarism in programming classes. Since its 
development in 1994, Moss has been very effective in this role. The algorithm behind moss is a significant 
improvement over other cheating detection algorithms. There is a great deal of information regarding MOSS at: 
http://theory.stanford.edu/~aiken/moss/ 
MOSS can currently analyse code written in the following languages: 
C, C++, Java, C#, Python, Visual Basic, Javascript, FORTRAN, ML, Haskell, Lisp, Scheme, Pascal, 
Modula2, Ada, Perl, TCL, Matlab, VHDL, Verilog, Spice, MIPS assembly, a8086 assembly, a8086 
assembly, HCL2. 
MOSS system is being used in this unit for any suspected plagiarism.  If plagiarism is detected by MOSS and 
upheld after investigation, you will to face a charge of academic misconduct. So please do not attempt to plagiarise. 
Page 4 of 5 
Western Sydney University 
Lab Sheet 1 Computer Organisation 300096  
 (Starts session week 2, due in week 3) 
Student Name and Number  
Date, Grade and Tutor signature, max mark 3  
Keep this cover sheet marked and signed by the tutor. 
1. Preparation [Total max. mark: 1] 
The main goals of today’s lab are: to understand how to write simple programs, to become familiar with PC Spim – the 
MIPS processor simulator, and to learn how to use its features to debug your programs. Note for 64-bit users: The first 
time you run PCSpim, it may complain about a missing exception handler (exceptions.s). If you see this message, open 
Simulator->Settings, look under "Load exception file", and change the path to the following (or something similar): 
C:\Program Files (x86)\PCSpim\exceptions.s 
1. Before the lab please study “PCspim.pdf” and section A.9 (Page 40) in “HP_AppA.pdf” (available on the 
website), as well as lecture notes and relevant sections from the textbook. 
 
2. The following exercise is to familiarise yourself with PCSpim. Note: If you use QtSpim, your exercise here will 
be based on QtSpim. 
a) Make a hand drawing of the PCSpim user interface [0.5 marks] 
Note: Your hand drawing doesn’t need to copy all the information on the user interface; just pick up a couple 
of lines from each area (pane). 
b) Explain in writing what is the role of four main horizontal areas (panes) in the PCSpim user interface [0.5 
marks].  
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Page 5 of 5 
Western Sydney University 
 
2. Workshop Tasks [Total max. mark: 2] 
Please answer the lab Questions listed below in writing, print or neatly write your answer: 
1. Create a folder for this subject (e.g. CO_300096), and within it create a subfolder for Lab01. Copy two 
assembly language files hello.s and helloimproved.s (see Prac. 01 code on the website) to the newly created 
folder. NOTE: PCSpim assembly programs are text files, they can be edited with any text editor, for 
example NotePad, NotePad++, etc. 
2. Start PCSpim. Open file hello.s in PCSpim and run it. Meanwhile open the same file in a text editor (e.g. 
NotePad++, for easy view) and analyse the code. You must read and fully understand all comments!          
(#   comments in the code). NOTE: The PCSpim simulator is only for running assembly programs and 
doesn’t support code editing; it’s not a good code viewer either. For editing assembly programs, you 
have to use a text editor. So for the lab tasks regarding assembly programs, you’ll switch between 
PCSpim and a text editor. 
3. Open helloimproved.s in PCSpim and run it. Also open the same file in a text editor (for easy view) and 
analyse the code; compare it with the hello.s code.  
Run helloimproved.s in PCSpim again. Pick up a line of code statement from PCSpim and identify the 
following formats for the code statement: the original text of the instruction, the assembled text, and the 
machine code.  
Question (0.3): Answer the question in writing. List a couple of lines of code statements from PCSpim. 
Point out which are the original text format of the instructions, the assembled version, and the machine 
code version. Also, briefly explain main differences in between (addressing technical details). 
 
 
 
 
4. Run the helloimproved.s several times, and observe its results in the console window. Identify the data 
segment, and the registers. Then single-step through the program, observing the changes in the registers. 
After the whole program has been executed, experiment with the ‘clearing registers’ action. 
Question (0.2): What is the effect of clearing registers? Why simulator provides this operation? 
 
 
5. Still with helloimproved.s. Find comment ‘# line xx’ and insert left to the comment mark ‘#’ the 
following: sub $s0, $t0 Save and load the program. 
Questions (0.2):  Observe what’s happening when loading or running the program. What was the effect 
from this code modification? Explain ‘why’ with more technical details. 
[Restore the program to the original form by deleting ‘sub $s0, $t0’] 
 
6. Modify the helloimproved.s to print on the screen two additional lines of text defined by yourself: e.g. 
one line with your name (or the unit title), and one line with any text you like. Note: don’t change the 
existing message defined in the program; insert at least two labels defined by yourself. Save your 
program as myfirstprog.s Remember to write clear, descriptive comments for your part of the code. 
Demonstration (1): demonstrate to the tutor the program you wrote. Be prepared to explain the code, 
and answer additional questions about the code and PCSpim. 
 
 
Page 6 of 5 
Western Sydney University 
7. Questions (0.3): When running helloimproved.s, after the output text is printed to the console, why the 
cursor is placed in the next (blank) line? What is the role of instruction ‘syscall’? How syscall services 
and arguments are selected and specified in the code? 
 
 
 
 
 
3. Assessment 
When you complete all tasks, present to the tutor a printed copy of your program source code with your 
name and student number included in the comments in your code (#…), and typed or neatly written answers 
to all questions listed in the lab sheet (note that amount of questions vary per lab). 
Warning: Any source code duplicated amongst students will result in a zero mark, and possible further 
action according to the WSU policy on plagiarism (see the unit learning guide).