Professional Documents
Culture Documents
____________________________________________________________________________________
INSTRUCTIONS TO STUDENTS:
1. This examination contains FOUR (4) questions and comprises NINE (9)
printed pages (including cover page).
6. T121 instruction set summary (Appendix 1) and a partial ASCII codes table
(Appendix 2) are attached.
If you have used more than one answer book, please tie them together with the string
provided.
Question 1
A microprocessor uses 8-bit for integer representation and 32-bit for floating point
number representation. Analyse the various number representations and answer the
following questions.
(v) Examine the values of A, B and the result of the operation in (iv).
Explain and deduce the logic operation equivalent to the logic operation
(NOT(A) AND B) OR (NOT(B) AND A).
(3 marks)
(b) This microprocessor uses the specifications shown in Figure Q1(b) for 32-bit
floating point number representation. If the representation in hexadecimal
number is C1E0 0000, determine the decimal value of the representation.
(6 marks)
Bit 31 30 23 22 0
1 8 bits 23 bits
Figure Q1(b)
Bit 0 3 4 15
Opcode Memory address or I/O device number
Figure Q2
(a) Examine Figure Q2 and determine the number of memory locations this
processor can address.
(2 marks)
There are 6 steps consisting of 3 pairs of a fetch and execute cycles. For each
step, describe what happens and list the contents of the following registers:
Assume the initial values are as given in Figure Q2(v). Tabulate your answer
using the format given in Table Q2(c).
3 ? ? ?
Fetch Description
4 ? ? ?
Execute Description
Table Q2(c)
(15 marks)
(d) Explain the TWO (2) approaches to deal with multiple interrupts.
(6 marks)
This question is based on the EASY68K simulated processor. Use the T121 Processor
Instruction Set of the EASY68K simulator to answer the following questions.
(a) Figure Q3(a) shows the contents of a memory segment and a program.
Figure Q3(a)
Assume the contents of registers A0, D0 and D1 are set to 00000000 before the
execution of the program. All numbers are in hexadecimal.
(i) What will be the contents of the memory segment shown in Figure Q3(a)
after the execution of the program?
(6 marks)
(ii) What will be the contents of registers A0, D0 and D1 after the execution
of the program?
(3 marks)
(iii) Identify the addressing mode used in each of the instructions from (I) to
(IV).
(4 marks)
ORG $1000
START <insert your codes (I) here>
. . .
STOP #$2700
SUBR MOVE.B $300, D0
AND.B $301, D0
MOVE.B D0, $400
RTS
ORG <insert your codes (II) here>
. . .
END START
Figure Q3(b)
(ii) Write the codes, (I) and (II), to develop the program to call the
subroutine and create some test values to test its functionality. The
subroutine occupies memory space just below the main program.
Initialise test data: 1, 2, 3… up to the required number deduced in part
(b)(i).
(6 marks)
Primary Secondary
storage storage
System Bus
I/O unit
CPU
Figure Q4
(a) Draw the internal architecture of the CPU and describe the THREE (3) most
important components in it.
(6 marks)
(b) Primary storage can be classified as volatile and non-volatile types of memory.
Summarise the features of each type.
(4 marks)
(d) State TWO (2) major functions of the I/O unit. Summarise how data buffering
improves the performance of the I/O unit.
(6 marks)
(e) Describe the interaction of the CPU, stack memory and the I/O unit when an
interrupt is generated by an external device.
(7 marks)
Arithmetic
ADD <EA1>, An or Dn ** XXX add binary
SUB <EA1>, An or Dn ** XXX subtract binary
Logical
AND <EA3>, Dn ** XXX logical AND
NOP <EA3>, Dn -- no operation
OR <EA3>, Dn ** XXX logical OR
NOT Dn ** XXX logical NOT
Control
BRA <Label> -- branch always
BSR <Label> -- branch subroutine
BNE <Label> -* branch not equal
BMI <Label> *- branch on negative
BPL <Label> *- branch on positive
JMP <Label> -- jump always
RTS -- return from subroutine
STOP #$2700 stop
- flag not affected , * flag affected
<EA1> = Dn, An, (An), (An)+, $<data>, #$<data>
<EA2> = same as <EA1> except #$<data>
<EA3> = Dn, #<data>