You are on page 1of 4

SYSC 2001 Foundations of Computer Systems

Fall 2011 Midterm


Name: __________________________

Student Number _____________

Mark ____/(35)

Question 1 [14 marks] Chapter 1


a) [3 marks] What is the distinction between computer organization and computer architecture?
Computer architecture refers to those attributes of a system visible to a programmer or, put another
way, those attributes that have a direct impact on the logical execution of a program.
Computer organization refers to the operational units and their interconnections that realize the
architectural specifications.
Examples of architectural attributes include the instruction set, the number of bits used to represent
various data types (e.g., numbers, characters), I/O mechanisms, and techniques for addressing memory.
Organizational attributes include those hardware details transparent to the programmer, such as
control signals; interfaces between the computer and peripherals; and the memory technology used.
b) [2 marks] What is the distinction between computer structure and computer function?
Computer structure refers to the way in which the components of a computer are
Interrelated, built, connected to each other.. Computer function refers to the operation or behavior of
each individual component as part of the structure.
c) [2 marks] List the four main functions of the computer?
Data processing; data storage; data movement; and control.

d) [4 marks] List and briefly define the main structural components of a computer.
Central processing unit (CPU): Controls the operation of the computer and performs its data processing
functions; often simply referred to as processor.
Main memory: Stores data.
I/O: Moves data between the computer and its external environment.
System interconnection: Some mechanism that provides for communication among CPU, main memory,
and I/O. A common example of system interconnection is by means of a system bus, consisting of a
number of conducting
e) [3 marks] List and briefly define the main structural components of a processor.
Control unit: Controls the operation of the CPU and hence the computer
Arithmetic and logic unit (ALU): Performs the computers data processing functions
Registers: Provides storage internal to the CPU
[Optional]CPU interconnection (Internal Bus): Some mechanism that provides for communication among the
control unit, ALU, and registers wires to which all the other components attach.

Question 2 [9 marks] Chapter 2


a) [2 marks] Explain Moores law.
From Stallings slide: (1 mark) Number of transistors on a chip will double every year (now is at 18
months) while the cost of a chip remains almost unchanged. (2nd mark)
b) [2 marks] Explain Amdahls law. (The formula is not needed; instead explain what the formula
describes, what are its uses and implications)

The relative speedup from running a program on a single machine to a number n of parallel
machines depends on the fraction of the code that is parallelizable. If the amount of parallel code is
small, using parallel processors has little effect there are diminishing returns for using more
processors.
(Not necessary, but of interest)Amdahls law can also be generalized to other computer computers
(e.g. memory) adding more of some component only has a fractional relative improvement, with
the fraction dependent on the dominance of that component in the computer.
c) [3 marks] While browsing at Billy Bobs computer store, you overhear a customer asking Billy Bob
what is the fastest computer in the store that he can buy. Billy Bob replies, Youre looking at our
Macintoshes. The fastest MAC we have runs at a clock speed of 1.2 gigahertz. If you really want the
fastest machine, you should buy our 2.4 gigahertz Intel Pentium IV instead. Is Billy Bob correct?
What would you say to help this customer?
(1 mark)Performance is a balance between performance speed, memory speed and I/O speed, so
you must also look at those components.
Performance is also dependent on the type of operations youll be doing on the computer what is
the dominant operation. Need to look at the (1 mark)appropriate benchmark test.(Amdahls law)
(1 mark): For Clarity of argument and completeness example: explain benchmark further.
Even though the Intel machine may have a faster clock speed (2.4 GHz vs. 1.2 GHz), that does not
necessarily mean the system will perform faster. Different systems are not comparable on clock speed.
Other factors such as the system components (memory, buses, architecture) and the instruction sets
must also be taken into account. A more accurate measure is to run both systems on a benchmark.
Benchmark programs exist for certain tasks, such as running office applications, performing floatingpoint operations, graphics operations, and so on. The systems can be compared to each other on how
long they take to complete these tasks. According to Apple Computer, the G4 is comparable or better
than a higher-clock speed Pentium on many benchmarks.

d) [2 marks] For top students (i.e. attempt last): A benchmark program is run on a 40 MHz processor.
The executed program consists of 100,000 instruction executions, with the instruction mix and clock
cycle count shown in the table below.
Determine the effective CPI, MIPS rate and the execution time for this program.
Instruction Type
Integer arithmetic
Data transfer
Floating point
Control transfer

Instruction Count
45000
32000
15000
8000

Cycles per instruction


1
2
2
2

CPI is the average Clocks per instructions =


45000 + (2*32000) + (2*15000) + (8000*2) / (100 000) = 155 / 100 = 1.55
MIPS =40 M clocks / sec * (1/1.55 clocks per instruction) = 40 / 1.55 / 1000000 = 25.8 MIPs
Execution time = (100 000 instructions) * 1.55 CPI = 155 000 cyles * 1/40M sec = 0.003875 = 3.87 ms
Stallings: CPI = 1.55; MIPS rate = 25.8; Execution time = 3.87 ns.

Question 2 [5 marks] Chapter 3


a) [1 mark] Consider a hypothetical microprocessor generating a 16-bit address (for example, assume
that the program counter and the address registers are 16 bits wide) and having a 16-bit data bus.
What is memory address range that the processor can access directly? Give your answer in
hexadecimal.
0000h to FFFFh
b) [4 marks] The instruction execution cycle is often abbreviated as the fetch-execute cycle, yet
fetching and executing actually each involve a number of stages. In the full instruction cycle state
diagram, there are actually 8 stages. List all possible states that define an instruction execution.
Instruction address calculation (iac): Determine the address of the next instruction to be executed.
Instruction fetch (if): Read instruction from its memory location into the processor.
Instruction operation decoding (iod): Analyze instruction to determine type of operation to be
performed and operand(s) to be used.
Operand address calculation (oac): If the operation involves reference to an operand in memory or
available via I/O, then determine the address of the operand.
Operand fetch (of): Fetch the operand from memory or read it in from I/O.
Data operation (do): Perform the operation indicated in the instruction.
Operand store (os): Write the result into memory or out to I/O.

Question 3 [7 marks] The Virgo Lab


a) [1 marks] Given a C function prototype: void printValue( int value)
We can see that a single integer parameter must be passed to the subroutine.
Write an assembly code fragment demonstrating how to call this function, passing in the decimal
number 55.
MOV AX, 55
CALL printValue
b) [6 marks] Write an assembly code fragment that writes the string stored in the variable called
message to the console. You may write your solution with or without a loop, but the code must
retrieve the characters from the variable message, one by one.
The I/O address of the console is 04E9h
message db lol$ MOV BX, message
MOV DX, 04E9h
MOV AL, [BX]
OUT [DX], AL
INC BX
Repeat 3 times (not 4), or use a loop

You might also like