You are on page 1of 6

ECP2046 Computer Organization and Architecture

Trimester II Session 2010 / 2011

Assignment
Instructions:

1. This assignment consists of THREE (3) questions. Answer ALL questions. Marks
allocation for each part of the questions is indicated in the questions. The total marks
of this assignment will be scaled to 15% of the total coursework mark of this subject.
2. Students are required to work in group of TWO (2), of either the same or different
lecture group/section.
3. Each student MUST submit his/her own assignment report individually. The
assignment reports MUST NOT be identical to any others even for the members of
the same group.
4. Students MUST type their solutions/reports and print them out for submission.
Untidy works and submission will be penalized at the instructor’s discretion. Start
each question on a fresh page. Include the cover page in the appendix. Staple all pages
securely.
5. In addition to the hardcopy submission, students are required to submit a softcopy
report of identical content to ecp2046.assignment@gmail.com . The softcopies will be
checked for plagiarism at http://www.turnitin.com . Any form of plagiarism identified
will render the student to be penalized to ZERO marks.
6. The deadline to submit the assignment report is 21 JANUARY 2011, 5.00 p.m..
Students may submit their works earlier than the stipulated deadline. However, late
submission will be automatically penalized to ZERO marks.
7. Student is to submit his/her assignment report according to his/her lecture
group/section:
o EC201 & EC203 to Mr. Yong Yean Sheng (Room: CR2049)
o EC202 to Ms. Lee Yee Lien (Room: BR4027)
The submission will be time-stamped with official chop and signature of the receiving
instructor.
8. All inquiries concerning the assignment MUST be communicated to
mlchan@mmu.edu.my.
Question 1
a) Calculate the following expression by treating the binary values as
unsigned integers. Verify the result by displaying the decimal equivalents.
1001 + 0101
[1 mark]

b) Repeat the calculation by treating them as twos complement integers.


Verify the result by displaying the decimal equivalents.
[1 mark]

c) Calculate the following expression by treating the binary values as


unsigned integers. Verify the result by displaying the decimal equivalents.
1001 x 0101
[1 mark]

d) Repeat the calculation by treating them as twos complement integers.


Verify the result by displaying the decimal equivalents.
[1 mark]

e) Explain why the straightforward approaches that you have employed in a)


and b) above, despite working correctly for addition operations irrespective
of whether the operands are expressed either in unsigned notation or twos
complement notation; does not work accordingly for the multiplication
operations for operands expressed in both of these formats, i.e., the
straightforward multiplication only works correctly for operands expresses
in unsigned notation but fails when the operands are expressed in twos
complement notation of negative values. Use the same operands of c) in
your explanation.
[5 marks]

f) Explain why Booth’s algorithm is able to carry out the multiplication for
twos complement integers in d). Use the same operands of d) in your
explanation.
[4 marks]

g) Thus, demonstrate how the result of d) is derived correctly with Booth’s


algorithm following a pencil-&-paper approach.
[2 marks]
Question 2
The concept of endianness is related to the ordering of bytes within a word
(byte ordering) or the ordering of bits within a byte (bit ordering). Each sub
units (bytes or bits) has its own address. Typically, there are two types of
address mapping called the Big-Endian and the Little Endian. Figure below
shows a memory layout using Big-Endian address mapping.

Byte
Address
A B C D
00 00 01 02 03 04 05 06 07
11 12 13 14 15 16 17 18
Big-Endian
08
08 09 0A 0B 0C 0D 0E 0F Address
21 22 23 M N O P Mapping
10
10 11 12 13 14 15 16 17
Q R 41 42 43 44
18
18 19 1A 1B 1C 1D 1E 1F

a) Implement a computer program to determine the endianness of a machine.


Run the program and print out the result. (Hints: use C language)
[10 marks]

b) Redraw the above Big-Endian layout using Little-Endian address


mapping.
[5 marks]
Question 3
a) A micro-instruction sequencing and execution machine has a clock cycle
time of 10 ns and a base Cycle Per Instruction (CPI) of 5. The possibility
of interrupts and (or) exceptions may happen in the middle of an
instruction that must have copies of the values of the registers at the
beginning of the instruction. These registers are usually called shadow
registers. Assume that the average instruction has two register operands
that must be restored on an interrupt. The interrupt rate is 100 interrupts
per second, and the interrupt cost is 30 cycles plus the time to restore the
shadowed registers, each of which takes 10 cycles. Analyse the
followings:

i) What is the effective CPI after accounting for interrupts?


[2 marks]

ii) What is the performance loss from interrupts?


[1 mark]

iii) Is 10 cycles to restore shadowed registers realistic?


[2 marks]

b) Explain the operation of three bus CPU architecture which is shown in


Figure Q3-b. Draw a CPU architecture using by any one logic gate,
which control instruction by left and right respectively.

Figure Q3-b

[5 marks]

c) The hardwire implementation microcode is shown in Figure Q3-c, which


includes separate cycle for testing. Determine whether any interrupts are
pending or not? Give a neat flow diagram for initial micro instruction.
Why is instruction bad? Why is there no simple fix? Is there a more
complex fix?
Loc Label Test ALU S1 S2 C Misc Cond Jump Comments
label
0 Ifetch Interrupt Intrpt Check interrupt
1 Iloop Instr Read Mem? Iloop IRM[PC]; wait for memory
2 PC ADD PC Constant 4 ABRF Decode 1
3 Intrpt IAR Pass S1 PC Interrupt
4 PC Pass s2 Constant 0 Uncond Ifetch PC0 & go fetch next instruction

Figure Q3-c

[5 marks]
Appendix: Cover Page For Assignment Report

ECP2046 Computer Organization and Architecture

Trimester II Session 2010 / 2011

Assignment Report

Student Name Student ID Lecture Section Majoring


1.
Group Member Name Group Member Name Lecture Section Majoring
2.

Acknowledge Receipt by Instructor:


Received on: _____________ Sign and stamp of instructor:

Reference number:_________ ______________________

You might also like