CS255 - Computer Architecture and Assembler Programming
Homework 1
Due date: see class webpage
-
Preparation
Note:
When you're done, you must
turnin your work
See the end of this write up for instructions on how to turn in
this assignment.
-
Question 1 (10 pts - 2 pts per question)
- Name one (1) non-programmable machine that was invented
to help humans perform
computations.
- Name one (1) non-electrical
machine that is programmable, i.e.:
the machine can change its programming (= can perform
different variants of a task)
- Give the 4 categories of components in a computer.
- Give the 2 components in a computer system.
- Give an example of a peripheral device that can
perform both input and output operations.
-
Question 2 - computer system (10 pts - 2 pts per question)
- What is the functiuon of the CPU (Central Processing Unit) ?
- What is the function of the computer memory (RAM) ?
- Where are all the instructions of a computer program
stored ?
- Where are all the variables of a computer program stored ?
- Which component in the computer system execute the instructions
of a computer program ?
-
Question 3 - interconnections (10 pts - 2 pts per question)
- How is a memory cell in the computer memory (RAM) identified,
i.e.: what do you use to distiniguish different memory cells.
- Which bus in the system bus carries (= transmits) the
memory identifying information from the CPU to the memory ?
- Which bus in the system bus is used to transfer
data between the CPU and the memory ?
- Which bus in the system bus contains the
Read/Write signal ?
- Which bus is used by the CPU
to send the value of its Program Counter to the memory ?
-
Question 4 - RAM (10 pts)
- What is a bit ?
- How many bits are in a byte in modern computers ?
- Show all the binary number patterns that 1 bit can store.
- Show all the binary number patterns that 2 bits can store.
- How many different binary number patterns can 1 byte store ?
-
Question 5 - combining memory cells (2 pts each)
- Consider the following content of the computer memory:
Questions:
- Can the bytes at memory location 4000 and 4001 be combined
to make a larger memory unit ?
- If you answer yes to the above question, then:
how many different binary number patterns can the cobined memory unit
store ?
- Can the bytes at memory location 4000 and 4002 be combined
to make a larger memory unit ?
- Can the bytes at memory location 4000, 4001 and 4002 be combined
to make a larger memory unit ?
- Can the bytes at memory location 4001 and 4002 be combined
to make a larger memory unit ?
-
Question 6 (10 pts)
- What type (kind) of numbers are stored inside a
computer memory ?
- Name the 2 operations that the CPU can perform on the
computer memory.
- If the data bus has 16 wires, how many bytes can the data bus transfer in
one read/write operation ?
- If the address bus has 16 wires,
what is the maximum memory size of this computer
(i.e., how many bytes maximum can the memory contain) ?
- If the address bus has 34 wires,
what is the maximum memory size of this computer
(i.e., how many bytes maximum can the memory contain) ?
-
Question 7 (Codes - you need to do some research for this question)
- For this question, you need to search online for
Morse code
Or you can use this
Wikipedia page
The Morse code is a signalling code
designed to transmit English text by
raido pulses (beeps).
We denote a short pulse as • (dot)
and a long pulse as - (dash)
Decode this message in Morse code:
•••• • •-•• •-•• ---
Message:
|
- For this question, you need to search online for binary ASCII code
The ASCII code is a binary code to represent the English characters
Decode this message in ASCII code:
01000110 01101001 01110011 01101000
Message:
|
- Suppose you are given the following binary number:
01000001
Corresponding decimal number:
|
What is the decimal number that corresponds to this binary number ?
- Suppose you are given the following binary number:
01000001
Character represented by ASCII code:
|
What is the character that is represented by this binary number ?
- Make a correct English sentence that
starts with:
-
Question 8 (10 pts)
- What is the purpose (in terms of usage) of
the general purpose registers ?
- What are the 2 kinds of operations that the ALU can perform ?
- What is the purpose (in terms of usage) of the
Program Counter (PC) ?
- What is the purpose (in term of usage) of the
Instruction Register (IR) ?
- What is the purpose (in term of usage) of the
Processor Status Register (PSR) ?
-
Question 9 (10 pts)
- The CPU repeated execute a series of steps to execute an instruction.
What is the term used to describe this series of steps ?
- Which device in the computer will
the CPU access to obtain a new instruction ?
- How does the CPU prepare itself to get a new (different) instruction
in each execution cycle ?
- Which component inside the CPU will provide the
operands for computer instructions - be very specific
with your answer, include the adjective if any ?
- Which component inside the CPU is used to store the results
of computer instructions - be very specific
with your answer, include the adjective if any ?
-
Question 10 (10 pts)
Suppose the Program Counter contains the value 4000 and
assume that each computer instruction is stored in 1 byte of memory.
This is a partial content of the computer memory:
- Which instruction code will the CPU fetch from
the memory next ? The answer is a binary number !
- Which register inside the CPU is used to store this
instruction code ?
- Let's call the next instruction that was fetched (= your answer to
the first part of this question):
instruction instrX.
Suppose the instruction instrX updates a
general purpose register R0 to 4000.
In this case, which is the next instruction
that will be fetched
from memory after the CPU finished executing instrX ?
The answer is a binary number !
- Suppose the instruction instrX updates the
Program Counter PC to 4000.
In this case, which is the next instruction
that will be fetched
from memory after the CPU finished executing instrX ?
The answer is a binary number !
- What is the name of the
program phenomenon exhibited by the
program behavior in the
previous question
that you have learned in CS170 or any "Intro to CS course"
(where the Program Counter is updated by 4000) ?
-
Extension request
- You can make and receive extension requests for a homework/project
as long as you have not exceeded the maximum requests allowed.
Extension requests must be made before the assignment is due !!!
"Free" extension requests are granted for illness and family
emergencies.
To make an extension request, do the following in EGTAPI:
1. Click on File Browser in EGTAPI
2. Click on Req ext (lower right corner) in the File Browser menu
The "Egtapi Extension Request" window will pop up:
3. In the "Section Number" drop down tab:
Select "1" if you are in Section 1
Select "2" if you are in Section 2
4. Enter "Project Code": hw1
5. Click the "Request extension" button
6. You will see the request result in the right most panel.
If your request is successfull, you will see:
Extension request was successful:
Turn hw1 in before ..... (new due date)
in the "Request extension" pop up window (you may need to scroll down)
|
- Alternately,
you can request an extension
by executing the following
command
inside the EGTAPI terminal:
/home/cs255001/req-ext hw1 // If you're in section 1
or
/home/cs255002/req-ext hw1 // If you're in section 2
|
You request will
be successful if
you have not exceeded the
maximum number of "free" (no-questions-asked)
requests allowed
-
How to turnin your homework
Important note:
- You must
turn in your program to complete the assignment !!!
- You must
turn in each assignment
before its due date
(unless you have requested an extension).
|
- The easiest way to turn in
your work is
using EGTAPI
Watch this video on how to
turn in a file
with EGTAPI:
click here
- Here are the written instructions explained in the video:
1. Click on File Browser in EGTAPI
2. Select the file that you want to turn in
In this case, select the file "hw1.s" inside your hw1 folder
3. After selecting the file (in this case: "hw1.s"), click Turnin in the File Browser menu
The "Egtapi Turn-in" window will pop up:
4. In the "Section Number" drop down tab:
Select "1" if you are in Section 1
Select "2" if you are in Section 2
5. Enter "Project Code": hw1
6. Click the "Turn in" button
7. You will see the turn in result in the right most panel.
Make sure that your see the message: "Program ... has been successfully turned in..."
|
Alternately, you can turn in your file using the EGTAPI Terminal:
1. Open the EGTAPI Terminal (click on "Terminal")
2. Enter these command in the lower input area of the Terminal panel:
(a) cd ~/cs255/hw1 (go to your hw1 folder)
(b) /home/cs255001/turnin hw1.s hw1 // If you're in section 1
or
(b) /home/cs255002/turnin hw1.s hw1 // If you're in section 2
|
If you want to see what you have turned in, then
1. Open the EGTAPI Terminal (click on "Terminal")
2. Enter this command in the lower input area of the Terminal panel:
/home/cs255001/turnin // If you're in section 1
or
/home/cs255002/turnin // If you're in section 2
|
Statement of Policy on Project/Homework Assignments
Students will be graded partially on the basis of their homework assignments. These homework assignments are to be treated as examinations, and are expected to be your individual work. While discussions with other students in the course may be permitted or encouraged by your instructor, you should write your program yourself. Your instructor (and any teaching assistants assigned to the course) will be glad to help you to the extent that he or she feels reasonable.
Submissions based on other students solutions in prior offerings of the course specifically violate these guidelines, as do submissions prepared with the help of an outside "tutor".
You should take precautions to protect the confidentiality of your work, do not collaborate on questions that you turn in for a grade, do not show your solution to a fellow student, not even after the due date for some students may have receive extension.
All submissions should include a comment statement near the top of the program of the form:
THIS HOMEWORK IS MY OWN WORK, IT WAS WRITTEN WITHOUT CONSULTING A TUTOR
OR WORK WRITTEN BY OTHER STUDENTS - your name
|
Cases of apparent plagiarism or collusion will be referred to the
Honor Council.