Midterm Exam KE26604 Computer Architecture & Microprocessors
Time : 2 hours
Semester 2/ Session 2014-15 2014-15 SECTION A: ANSWER ANSWER ALL QUESTIONS (40 Marks – Each 2 marks)
1.
Lists four (4) fields of an assembly language statements in .386 microprocessor
2.
What is the important important of Moore's Law ?
3.
An address field in an instruction instruction contains contains decimal value 14. 14. Where is the corresponding corresponding operand located if indirect addressing mode is used?
4.
How many number of index register in the .386 microprocessor?
5.
Name the pairs of registers used to hold the base and offset address of stack operation in .386?
6.
Lists all the data register in .386 microprocessor
7.
In real-mode, how many bits can be used in Flags register for any instructions?
8.
What is the signal signal name generated generated by processor as a respond of an interrupt interrupt request signal signal sending by I/O module?
9.
What is the physical physical address for the the logical address 1CBC:FFBD? 1CBC:FFBD?
10.
What is the output output of the instruction instruction Mov DS, CS CS ?
11.
Give one example of instruction that used Immediate addressing mode
12.
What is the output output of the instruction instruction MOV AX, BL? BL?
13.
What is the output output of the instruction instruction Mov AX,[BX]?
14.
What is the output output of the instruction instruction Mov AX, list[BX+DI]? list[BX+DI]?
15.
Differentiate between the function of address, data and control bus
16.
If the address bus is 8 bit and data bus is 16 bit what are the maximum addressable memory and size of data that can be used?
17.
What are the pairs pairs of registers in 80386 80386 microprocessors microprocessors used to to hold the address address of instructions instructions in memory?
18.
What is the result of instruction: BSF BSF AX, BX if given BX = 4000H? 4000H?
19.
Give one (1) advantage of Indirect addressing mode compare with Direct addressing mode?
20.
If the address bus is 16 bits and data bus is 32 bits what are the maximum addressable memory and size of data that can be used?
1
SECTION B - ANSWER ALL QUESTIONS (60 MARKS) Question 1 (30 marks)
The main components of computer comprise of Central processing unit (CPU), Main memory (MM) and Input/ Output module which are connected through data, address and control bus for fetching and executing an instructions. With this regards, answer the following questions: a) Explain the stored program concept (2 marks) b) Sketch the top level view of computer main components connection and explain the function of each components for instruction fetch and execute (6 marks) c) Illustrate and explain the following instruction cycle of stored program concept based on the sketch top level view of computer main components: i. MBR mem[940] (4 marks) ii. MBR mem[941] + MBR (4 marks) iii. mem[941] MBR (4 marks) d) Compute X = (A + B x C) / (D - E x F) using 0 , 1 , 2 , and 3-address. The instructions available for use for each four machines are as in Table 1. Table 1 0 Address PUSH M POP M ADD SUB MUL DIV
1 Address LOAD M STORE M ADD M SUB M MUL M DIV M
2 Address MOVE (X Y) ADD (X X + Y) SUB ( X X - Y) MUL (X X x Y) DIV (X X/Y)
3 Address MOVE (X Y) ADD (X Y + Z) SUB (X Y-Z) MUL (X Y x Z) DIV (X Y/Z)
(10 marks) Question 2 (30 marks)
a) Given that DS = F000H, BX = C300H, DI = 00A3H and LIST = 0100H, determine the physical memory address accessed by each of the following instructions assuming real-mode operations and briefly describe the operation that each instructions will performed. i. iii.
MOV AX, LIST[BX + DI] MOV AX, [BX + 100]
ii. ADD CX, LIST[DI] iv. SUB AX, [BX + DI] (8 marks)
b) Figure 1 shows the assembly language vote.asm program for identifying the voters eligibility based on age user input data with 28 lines of instruction. By evaluating the program, answer the following questions: i. What is the size of the reserved stack memory used in the program? (2 marks) ii. Identify four (4) errors in the program and justify your answer by rewriting the right coding (4 marks) iii. Construct and explain the flowchart of the program (4 marks) iv. Modify and construct flowchart of the program that enable the user to enter their name and age and display both at the end with the result of their eligibility to vote (12 marks)
2
Li ne# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
. model medi um . st ack 100h . dat a Pr ompt db 13, 10, “Pl ease ent er your age ( 0 t o 99) ” Age db 3, 4 dup ( ) Yes1 db 13, 10, “Congr at ul at i on, you ar e el i gi bl e t o vot e” No1 db “Sor r y, you ar e under age” . code START: mov ax, seg Pr ompt mov ds, ax mov ah, 9 mov dx, of f set Pr ompt i nt 21h mov ah, 0ah mov dx, of f set age i nt 21h mov ax, of f set age mov bh, [ ax+2] mov bl , [ ax+3] cmp ax, 21 j ae yes mov dx, of f set No1 j mp di spmess age yes: mov dx, of f set Yes1 di spmess age: mov ah, 9 i nt 21h mov ah, 4c00h end st art
Figure 1 vote.asm program
3