Documente Academic
Documente Profesional
Documente Cultură
Computer Architecture
Wednesday, 13 November 2019 1:00 pm – 3:00 pm
____________________________________________________________________________________
INSTRUCTIONS TO STUDENTS:
1. This examination contains FOUR (4) questions and comprises SEVEN (7)
printed pages (including cover page).
6. E114 processor 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
An 8-bit microprocessor has an 8-bit wide memory. Explain how the data is represented,
structured and stored in the following scenarios:
(a) If 8-bit 2’s complement representation is used to represent integers, what is the
range of decimal values it can represent?
(3 marks)
(b) An 8-bit binary code word 1101 01102 is to be interpreted as a fixed-point fraction
with four bits before and four bits after the binary point. Assume that both the
integral and fractional parts are unsigned representation. Express your answer as
a decimal number. Show your working.
(3 marks)
(c) Use the binary and decimal number systems to express TWO (2) unsigned
magnitude integers 3716 and A216 in 8-bit binary and decimal, respectively.
(4 marks)
(i) Express the decimal numbers 3310 and 6510 in 8-bit sign-magnitude
representation.
(2 marks)
(ii) Show how the microprocessor computes the arithmetic operation 3310 –
6510 in 2’s complement representation. Convert the result to decimal and
show it is equal to -32. Show your working.
(6 marks)
(e) This microprocessor uses the specifications shown in Figure Q1(e) for 32-bit
floating point number representation. If the representation in hexadecimal
number is 40E0, determine the decimal value of the representation.
Figure Q1(e)
(7 marks)
(a) Sketch a block diagram of a simple system bus architecture consisting of a data
bus, an address bus and a control bus. The diagram should include a CPU block,
a memory block and an I/O block.
(6 marks)
(d) A computer system has a 20-bit address bus and can address an 8-bit wide
memory. The memory contains:
The system ROM and user RAM form a contiguous block of memory starting at
address 0. The rest of the address range after user RAM is not used.
Draw the memory map for this computer system. Indicate the starting and ending
addresses in hexadecimal for each block of memory and any unused space. Show
how the memory addresses are obtained.
(13 marks)
This question is based on the EASY68K simulated processor. Assume the contents of all
data and address registers are equal to zero before the start of the program. All numbers
are in hexadecimal.
Demonstrate how instructions of the program are executed by using the E114 Processor
Instruction Set of the EASY68K simulator.
Figure Q3 shows an incomplete main program and a subroutine. The program is designed
to test each value in an array of positive integers. For each array element, if the value is
equal to 5, it is replaced by 8, i.e. the program overwrites the original array value.
Otherwise, the value remains unchanged.
ORG $1000
START MOVE.B #$08, D0
MOVE.L #$0300, A1
LOOP BSR TEST
SUB.B <<1>>, D0
BNE <<2>>
STOP #$2700
ORG $1100
TEST <<3>> A1, A2
MOVE.B (A1)+, D1
SUB.B <<4>>, D1
BNE <<5>>
MOVE.B <<6>>, (A2)
B1 RTS
END START
Figure Q3
(a) The main program includes a loop. Which register is being used as a loop counter?
How many elements are there in the array?
(2 marks)
(b) State the lowest and highest addresses of the array in hexadecimal.
(2 marks)
(c) Determine the missing items <<1>> to <<6>> to create the complete program.
(12 marks)
(d) Identify the addressing mode used in each of the following instructions:
Question 4
(a) Describe the differences between memory-mapped I/O and isolated I/O.
(12 marks)
(b) Software poll and hardware poll are two methods a processor uses to identify
which device issued an interrupt. Briefly describe these TWO (2) methods.
(6 marks)
(c) Describe ONE (1) disadvantage each for software poll and hardware poll.
(3 marks)
(d) Describe how software poll and hardware poll assign priorities when more than
one device is requesting for interrupt service.
(4 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>