Anda di halaman 1dari 5

National University of Computer and Emerging

Sciences, Islamabad

Name: -----------------------------------------------------------------

Roll No: -------------------------------------------

Course: Comp Org & Assembly Semester: Fall 2010


Exam: Mid Term I (Section I) Time Allowed: 15 min

Note: This answer sheet will be taken back after 15 min.

True or False: (T/F)


1 F
2 F
3 F
4 T
5 F
6 F
7 T
8 F
9 T
10 F
Multiple Choice Questions:
1 A
2 C
3 D
4 B
5 B
6 D
7 D
8 C
9 B
10 A
11 A
12 B
13 D
14 C
15 B
16 A
17 B
18 B
19 B
20 C
Section 2
Question # 3 [5]

What is the importance of assembly language programming?

‰ Two main Advantages:


¾ Accessibility to system hardware
¾ Space and time efficiency
‰ Accessibility to system hardware
¾ Assembly Language is useful for implementing system software
¾ Also useful for small embedded system applications
‰ Space and Time efficiency
¾ Understanding sources of program inefficiency
¾ Tuning program performance
¾ Writing compact code

Question # 4 [5]

Differentiate between Memory Mapped I/O and Isolated I/O techniques for addressing
I/O devices

‰ Memory mapped I/O


¾ Devices and memory share an address space
¾ I/O looks just like memory read/write
¾ No special commands for I/O
ƒ Large selection of memory access commands available
‰ Isolated I/O
¾ Separate address spaces
¾ Need I/O or memory select lines
¾ Special commands for I/O
ƒ Limited set
Question # 5 [8]

Draw a labeled block diagram of an I/O module showing all external and internal
connections

Question # 6 [8]

A computer uses RAM chips of 1024 x 1 capacity

ƒ How many chips are needed and how should their address lines
be connected to provide the memory capacity of 1024 bytes?

8 Chips and 10 bit address. All chips should be connected in


parallel.

ƒ How many chips are needed to provide the memory capacity of


16K bytes? Draw a diagram showing the arrangement of the chips
and how they are connected to the address bus.

16*8 (128) Chips


Address lines connected will be 14 (4 lines are input to the 4x 16
decoder to select the row and 10 lines are common to all the
chips)
Chips are connected in the form of a 16 x 8 matrix

Question # 7 [6]

What is the benefit of using multiple-bus architecture as compared to single-bus


architecture?

Multiple bus architecture is used to overcome the following issues:

‰ Lots of devices on one bus leads to:


¾ Propagation delays
ƒ Long data paths mean that co-ordination of bus use can adversely
affect performance
ƒ If aggregate data transfer approaches bus capacity

‰ Different devices have different transfer/operate speed.


‰ If the speed of bus is bounded by the slowest device connected to it, the
efficiency will be very low.

Question # 8 [8]

Write a complete assembly program that calculates factorial of 4?

4! = 4*3*2*1

. model small
. stack 100h

.data
num dw 4
fact dw ?
.code
main proc
mov ax, @data
mov ds,ax
mov ax,num
dec num
mov cx, num

L1:
mul cx
loop L1

mov fact, ax
mov ax, 4C00h
int 21h
main endp
End main

Anda mungkin juga menyukai