COS2621 Tutorial 101
COS2621 Tutorial 101
Semesters 1 and 2
School of Computing
BARCODE
COS2621/101/3/2018
CONTENTS
Page
1 INTRODUCTION ............................................................................................................................ 4
2 PURPOSE OF AND OUTCOMES FOR THE MODULE ................................................................ 5
2.1 Purpose .......................................................................................................................................... 5
2.2 Outcomes ....................................................................................................................................... 5
3 LECTURER(S) AND CONTACT DETAILS.................................................................................... 6
3.1 Lecturer(s) ...................................................................................................................................... 6
3.2 Department ..................................................................................................................................... 6
3.3 University ........................................................................................................................................ 6
4 MODULE-RELATED RESOURCES .............................................................................................. 6
4.1 Prescribed books ............................................................................................................................ 6
4.2 Recommended books ..................................................................................................................... 7
4.3 Electronic Reserves (e-Reserves) .................................................................................................. 7
4.4 Library services and resources information .................................................................................... 7
5 STUDENT SUPPORT SERVICES FOR THE MODULE ................................................................ 8
6 MODULE-SPECIFIC STUDY PLAN .............................................................................................. 8
7 MODULE PRACTICAL WORK AND WORK-INTEGRATED LEARNING .................................... 9
8 MODULE ASSESSMENT ............................................................................................................ 11
8.1 Assessment plan .......................................................................................................................... 11
8.2 General assignment numbers ...................................................................................................... 11
8.2.1 Unique assignment numbers ........................................................................................................ 11
8.2.2 Due dates for assignments ........................................................................................................... 11
8.3 Submission of assignments .......................................................................................................... 12
8.4 Assignments ................................................................................................................................. 12
8.4.1 Assignment 01 – Semester 1 ....................................................................................................... 12
8.4.2 Self-test A – Semester 1 ............................................................................................................... 18
8.4.3 Assignment 02 – Semester 1 ....................................................................................................... 28
8.4.4 SELF-TEST B (SEMESTER 1) ..................................................................................................... 31
8.4.5 Assignment 01 – Semester 2 ....................................................................................................... 36
8.4.6 Self-test A – Semester 2 ............................................................................................................... 42
8.4.7 ASSIGNMENT 02 - SEMESTER 2 ............................................................................................... 43
2
COS2621/101/3/2018
8.4.8 Self-test B – Semester 2 ............................................................................................................... 44
9 OTHER ASSESSMENT METHODS ............................................................................................ 45
10 EXAMINATION ............................................................................................................................ 45
11 FREQUENTLY ASKED QUESTIONS.......................................................................................... 46
12 SOURCES CONSULTED ............................................................................................................ 47
13 CONCLUSION ............................................................................................................................. 47
3
COS2621/101/3/2018
Dear Student
1 INTRODUCTION
We would like to welcome you as a student of COS2621. Students usually enjoy this module -
especially those of you who like to experiment with new techniques. You will have plenty of
opportunity to try something entirely new.
Absolute answers to the design of computer architecture are seldom possible. The designs are
influenced by many factors, for example the current state of technology and our own understanding
of it, and historical factors. What we try to do in this module, is to emphasise important concepts so
that you will understand the limits of current solutions and the possible reasons for the fact that it is
not always possible to implement new trends immediately. This will enable you to understand and
appreciate inevitable changes in future technology.
There is a growing need for computer scientists to become involved in the design and
implementation of user interfaces for embedded systems such as those found in cell phones, cars
and tablets. To do this, we need to know what goes on at the lower levels of such systems. Most of
the concepts of computer organisation only make sense once you see how they have been
implemented on a specific machine and how they can be manipulated. You also need to know how
the different components of the system communicate. For this purpose, we do some practical work
in assembly language. This puts you on the assembly language level of the machine you are using.
We do some revision of first-year work. This includes the basic principles of logic design (logic
gates, combinational and sequential circuits), memory organisation, the central processing unit
(CPU) and bus structures. Then we look at data representation and the representation of integers
and floating-point numbers on a more formal basis.
We also study arithmetic operations, operating system interrupts, addressing modes, subroutine
calls in assembly language and the translation process.
Since the different members of the Intel (x86) family of computers are widely used, we study its
architecture as an example. The architectures of this family of microprocessors are very similar. For
the purpose of this course, we will assume that the instruction sets are identical and restrict our
register set to the basic architecture that is discussed in tutorial letter 102.
The theoretical part of the syllabus for COS2621 is covered mainly in the prescribed book Computer
Organization & Architecture by William Stallings.
PLEASE: Do not wait until the week (or night!) before the first assignment is due before
commencing your studies. Section 6 contains a study programme which you can use to plan your
studies for this module for the academic semester. If you stick to this programme, the handing in of
an assignment should never develop into a crisis.
Information on tutorial offerings at Unisa
Please be informed that, with effect from 2013, Unisa offers online tutorials (e-tutoring) to students
registered for modules at NQF level 5 and 6, this means qualifying first year and second year
modules.
Please communicate with your module leader to find out if any of the modules that you have
registered for falls in this category.
4
COS2621/101/3/2018
Once you have been registered for a qualifying module, you will be allocated to a group of students
with whom you will be interacting during the tuition period as well as an e-tutor who will be your
tutorial facilitator. Thereafter you will receive an sms informing you about your group, the name of
your e-tutor and instructions on how to log onto MyUnisa in order to receive further information on
the e-tutoring process.
Online tutorials are conducted by qualified E-Tutors who are appointed by Unisa and are offered
free of charge. All you need to be able to participate in e-tutoring is a computer with internet
connection. If you live close to a Unisa regional Centre or a Telecentre contracted with Unisa,
please feel free to visit any of these to access the internet. E-tutoring takes place on MyUnisa
where you are expected to connect with other students in your allocated group. It is the role of the
e-tutor to guide you through your study material during this interaction process. For your to get the
most out of online tutoring, you need to participate in the online discussions that the e-tutor will be
facilitating.
There are modules which students have been found to repeatedly fail, these modules are allocated
face- to-face tutors and tutorials for these modules take place at the Unisa regional centres. These
tutorials are also offered free of charge, however, it is important for you to register at your nearest
Unisa Regional Centre to secure attendance of these classes.
5
COS2621/101/3/2018
4 MODULE-RELATED RESOURCES
4.1 Prescribed books
The prescribed book for this module is:
William Stallings. Computer Organization and Architecture, Designing for Performance
Tenth edition. (Global Edition), Pearson, 2016.
Remember that the soft-cover version of the book is generally more affordable than the hard cover.
You can also access the available student resources for the prescribed book by visiting:
http://williamstallings.com/ComputerOrganization
6
COS2621/101/3/2018
4.2 Recommended books
The following books are good references for the practical work:
Peter Abel. IBM PC Assembly Language and Programming, Fifth Edition. New Jersey: Prentice-
Hall, 2001.
Jeff Duntemann. Assembly Language Step-by-step: Programming with DOS and Linux, Second
Edition. USA: John Wiley & Sons, 2000.
The following book is useful for revision of first-year work.
A. Clements. The Principles of Computer Hardware. Englewood Oxford: Oxford University Press,
1985. We also found the following books useful:
David A. Patterson and John L. Hennessy. Computer Organization and Design: The
hardware/software interface, Third Edition. Morgan Kaufmann, 2005.
Andrew S. Tanenbaum. Structured Computer Organization, Fourth Edition. USA: Prentice-Hall,
1999. Carl Hamacher, Zvonko Vranesic & Safwat Zaky. Computer Organization, Fifth Edition.
McGraw-Hill, 2002.
John D. Carpinelli. Computer Systems: Organization & Architecture. USA: Addison Wesley
Longman, 2001.
Stephan D. Burd. Systems Architecture, Third Edition. Canada: Course Technology, Thompson
Learning, 2001.
Vincent P. Heuring and Harry F. Jordan. Computer Systems Design and Architecture. Addison
Wesley Longman, 1997.
Gerrit A. Blaauw and Frederick P. Brooks (Jr). Computer Architecture: Concepts and Evolution.
Addison Wesley Longman, 1997.
Joe Carthy. An Introduction to Assembly Language Programming and Computer Architecture.
International Thomson Computer Press, 1996.
Kip R. Irvine. Assembly Language for the IBM-PC. New York: Macmillan Publishing Company,
1993. Michael Thorne. Computer Organization and Assembly Language Programming. For IBM
PCs and Compatibles, Second Edition. The Benjamin/Cummings Publishing Company, 1990.
Please note that the library only has some of these books in stock and only limited waiting lists will
be kept for these titles.
4.3 Electronic Reserves (e-Reserves)
Several links to Open Educational Resources (OERs) will be available on the COS2621 web site
under Additional Resources.
4.4 Library services and resources information
For brief information, go to www.unisa.ac.za/brochures/studies
7
COS2621/101/3/2018
8
COS2621/101/3/2018
Guide 102: Appendix C (work through)
Appendices A, B, D, E & F (use as
Week 5
references)
Do Self-test A 23 March / 31 August
Please ensure that you allow enough time for possible postal delays if you submit by post.
EXTENSION DATE
Please do not ask for an extension of the due date. The semester system does not allow
any extra time for extensions.
When you register for this module, you will receive the NASM assembler on a CD-ROM. Load the
file named index.html from the CD-ROM and click on the link to COS2621. You will be given clear
directions for the installation of NASM on your own computer. Guidelines regarding the use of this
assembler are given in appendix B of tutorial letter (Guide) 102. You must use NASM for the
development of your programming assignments. However, if you have experience in assembly
language programming and have access to one of the assemblers listed below, you may use that to
develop your programming tasks. However, we cannot provide support for technical problems that
you might experience with assemblers other than NASM.
NASM 64bit download link:
http://www.x64bitdownload.com/downloads/t-64-bit-nasm-download-vbepnjoq.html
9
COS2621/101/3/2018
10
COS2621/101/3/2018
8 MODULE ASSESSMENT
8.1 Assessment plan
Assignment Due date Year-mark weight
9 March 2018 (sem 1)
Assignment 01 17 August 2018 (sem 2) 30
23 March 2018 (sem 1)
Self-test A 31 August 2018 (sem 2) 0
13 April 2018 (sem 1)
Assignment 02 21 September 2018 (sem 2)
70
Semester 1
Assignment 01: 9 March 2018
Assignment 02: 13 April 2018
Semester 2:
Assignment 01: 17 August 2018
Assignment 02: 21 September 2018
11
COS2621/101/3/2018
ASSIGNMENT 01 (SEMESTER 1)
Use NASM for the development of your programs. We also expect you to learn how to use DEBUG
provided with DOS within the Windows environment. It is quite a useful tool and we strongly urge
you to master its use as soon as possible. An understanding of the internal registers of the
Pentium as discussed in the tutorial letters, and the use of DEBUG is essential if you want to
master this module.
Submit the assignment on a mark-reading sheet.
12
COS2621/101/3/2018
PLEASE BEAR THE FOLLOWING IN MIND WHEN YOU DO THE ASSIGNMENT:
Questions 2 to 5 of this assignment will not be marked. Please evaluate your
answers using the guidelines that will be sent out in Tutorial Letter 201.
Important: This assignment serves as preparation for Assignment 02. You will have
difficulty with the programming question in Assignment 02 if you do not submit
Assignment 01 and do not understand the exercises.
Some of the multiple-choice questions (Question 1) are revision of first-year study
material.
Submit your mark-reading sheet (Q1) to Unisa.
(1) A′ + B
(2) A′ + B + C′
(3) A′ + BC′
(4) A′
(5) A′ + ABC′ + B
(1) C++
(2) Assembler
(3) Compiler
(4) Interpreter
13
COS2621/101/3/2018
1.4 ------------------- controls the operation of the computer and performs its data
processing functions.
1.7 Provide the machine code instruction for mov dx,mess in question 5.
(1) CD21
(2) 8A1E1601
(3) BA1701
(4) BA0117
(5) None of the above.
14
COS2621/101/3/2018
1.8 ---------------- occurs if two or more processes are sharing a dynamic-link libraries
module but expect different versions of the module.
(1) Run-time dynamic linking
(2) Relocatable loading
(3) DLL hell
(4) Dynamic linker
(5) DLL shell.
1.9 What is the meaning of this Assembly Language code: DB “T”; MOV [K2], S?
(1) copy bits at K2 into S
(2) copy byte at K2 into S
(3) copy contents of K2 into S
(4) copy contents of S into byte at K2
(5) store address of S into byte at K2
1.10 A single two pass assembler does which of the following in the first pass
Question 3
a) Briefly describe the concept of multicore processors.
15
COS2621/101/3/2018
Question 4
Simplify the following expression using Boolean algebra. At every step, identify the Boolean identity
that is used:
ABC′ + ABCD + B′C + AB
Question 5
In this question we expect you to enter a small assembly language program using a text editor, and
to assemble the program. NASM must be used to assemble the program and DEBUG must be
used to test the program. DEBUG has facilities that allow you to step through the program,
executing one instruction at a time. After each instruction you are able to see the contents of all the
registers and the status of the flags. You can also inspect the contents of memory at any given
point.
Before you attempt this question, work through the following two appendices:
Appendix A: The DOS DEBUG utility,
Appendix B: NASM - ‘The Netwide Assembler’. Use Sections 1 to 9 as reference. Work through the
practical examples in Sections B10 and B11.
Once you feel that you understand the study material covered in Appendices A and B of Study
Guide 101, enter the following program using a text editor. Follow the directions in Sections B10
and B11 of Appendix B to enter and store the program. Store it with the name as1_q.asm in the
folder unisa\nasm or in the folder of your choice. (It is easier if your programs and the NASM
assembler are in the same folder.)
; The program must be keyed in exactly as is given here.
begin:
test_:
disp:
bits 16
org 0x100
mov al,[a]
mov bl,[b]
sub al,bl
16
COS2621/101/3/2018
jg disp ret
mov ah,09
mov dx,mess
int 21h
int 20h
a: db 20 b: db 10
mess: db 'A greater than B',10,13,'$'
Open the DOS window, make sure that you are in the unisa\nasm folder, and type
as as1_q to assemble the program. Correct syntax errors (if any) and assemble again. Answer the
following questions when your program has assembled successfully.
Note that you have to use an h to indicate that a number is in hexadecimal. For example: there is a
big difference between 100 and 100h.
SELF-TEST A (SEMESTER 1)
DATE: 23 March 2018
Do not submit
Question 1
Which one of the registers of the Intel microprocessor can be regarded as the accumulator
register?
1. AX
2. BX
3. CX
4. DX
Question 2
Which one of the registers of the Intel microprocessor is known as the count register and can be
used to control the number of times a loop is executed?
1. AX
2. BX
3. CX
4. DX
18
COS2621/101/3/2018
Question 3
Which one of the registers of the Intel microprocessor is known as the base register and can be
used as a pointer to memory?
1. AX
2. BX
3. CX
4. DX
Question 4
Consider the following DEBUG display:
AX=0012 BX=0000 CX=0000 DX=0235 SP=FFEE BP=0000 SI=0000 DI=0000
DS=1600 ES=1597 SS=1234 CS=1597 IP=0106 NV UP EI PL NZ NA PO NC
1597:0106 03062001 ADD AX,[0120] DS:0120=06E8
What is the effective 20-bit address of the next instruction that will be executed?
1. 16106h
2. 12446h
3. 016A3h
4. 15A76h
Question 5
Refer to the DEBUG display in Question 4. What is the effective 20-bit address of the top of the
stack?
1. 01222h
2. 25FEEh
3. 2232Eh
4. 25A1Eh
Question 6
Refer to the DEBUG display in Question 4. The next instruction to be executed is an ADD
instruction. One of the operands is found in the AX register. What is the effective 20-bit address of
the memory address where the other operand is stored?
1. 16120h
19
COS2621/101/3/2018
2. 01820h
3. 12460h
4. 15A90h
Question 7
Refer to the DEBUG display in Question 4. What is the status of the following flags?
Question 8
Refer to the DEBUG display in Question 4. What is the hexadecimal representation of the machine
code for the instruction that is the next to be executed?
1. 15970106h
2. 12006E8h
3. 03062001h
4. 01060306h
Question 9
What is the hexadecimal representation of the value 25.75 if it is stored in memory using the IEEE
single-precision floating-point format?
1. 41CE0000h
2. 41E70000h
3. 3DCE0000h
4. 42670000h
20
COS2621/101/3/2018
Question 10
Which one of the following notations is known as reverse Polish notation?
1. Postfix
2. Prefix
3. Infix
4. Midfix
Question 11
The value BEF00000h is the hexadecimal representation of a floating-point value that is stored in
memory using the IEEE single-precision floating-point format. What binary value is represented?
1. -0.00111
2. -1.11100
3. -0.11100
4. -0.01111
Question 12
Consider the following instruction.
mov AX,1234
What will the contents of the AX register be if the instruction was assembled (i) in DEBUG and (ii) in
NASM respectively?
Question 13
Suppose AX contains the hexadecimal value 1234h and you execute the instruction
MOV [120],AX using DEBUG. How would the value 1234h be stored in memory?
1. The value 12h will be stored in memory position 120h and the value 34h in memory position
121h.
21
COS2621/101/3/2018
2. The value 12h will be stored in memory position 121h and the value 34h in memory position
120h.
3. The value 12h will be stored in memory position 120h and the value 34h in memory position
11Fh.
4. The value 12h will be stored in memory position 11Fh and the value 34h in memory position
120h.
Question 14
Which register of the Intel microprocessor is known as the source index register?
1. AX
2. DI
3. SI
4. BP
Question 15
If you assemble a program using Nasm, what will be the result of the assembler directive DB
11,12,13,14?
1. Four words will be reserved in memory and the values 0011, 0012, 0013 and 0014
respectively stored in these 4 words .
2. Four words will be reserved in memory and the values 0011h, 0012h, 0013h and
0014h respectively stored in these 4 words.
3. Four bytes will be reserved in memory and the values 11, 12, 13 and 14
respectively stored in these 4 bytes.
4. Four bytes will be reserved in memory and the values 11h, 12h, 13h and 14h
respectively stored in these 4 bytes .
Question 16
Which one of the following binary numbers is the two’s complement representation of the integer
value -79?
1. 11001111
2. 10110000
3. 10110011
4. 10110001
22
COS2621/101/3/2018
Question 17
What is the infix version of the following postfix expression? ABCDE + ×× /
1. (A + B) × (C × D) / E
2. ((A / B) × (C × D)) + E
3. (A / B) × (C × D + E)
4. A / (B × (C × (D + E)))
Question 18
What is the postfix version of the following infix expression? (A + B) × (C + D) + E
1. ABCDE + × + +
2. ABCDE + + × +
3. AB + CD + × E +
4. AB + CDE × + +
Question 19
Aside from postfix and infix expressions, one could also have prefix expressions. This means that
the operator precedes its two operands in the expression. Using the same principles that were
applied for infix to postfix conversion, choose the prefix version of the following infix expression:
(A + B) × (C + D) + E
1. +AB+×CDE
2. +×++ABCDE
3. +×+AB+CDE
4. +×AB++CDE
Question 20
Which one of the following statements is false regarding big-endian machines?
1. A big-endian processor has to perform addition when it converts a 32-bit integer address to
a 16-bit integer address.
2. Integers and character strings are stored in the same order.
3. A big-endian machine can compare integer-aligned character strings faster than a little-
endian machine.
4. It is easier to perform high-precision arithmetic on a big-endian machine than on a little-
endian machine.
23
COS2621/101/3/2018
Question 21
Which one of the following statements regarding endianness is correct?
Question 22
Consider the subroutine given below. The subroutine adds two values. The two values are passed
to the subroutine on the stack and the result is returned on the stack. The two instructions
preceding the RET instruction are called the .
sub:
pop dx pop ax pop bx
add ax,bx
push ax push dx ret
1. start-up sequence
2. clean-up sequence
3. prolog
4. epilog
Question 23
Refer to the subroutine in Question 22. The first three instructions in the subroutine are called the
.
1. start-up sequence
2. clean-up sequence
3. prolog
4. epilog
Question 24
Refer to the subroutine in Question 22. What is the purpose of the first instruction?
24
COS2621/101/3/2018
1. It pops the first operand from the stack
2. It pops the second operand from the stack.
3. It pops the return address from the stack.
4. It pops the address of the RET instruction from the stack.
Question 25
Refer to the subroutine in Question 22. Which one of the following instructions is true regarding the
execution of the RET instruction?
1. The return address is popped from the stack and stored in the IP register.
2. The program branches back to the statement following the JMP instruction
that caused a jump to the subroutine.
3. The return address, which is stored in the BP register, is stored in the IP register.
4. Control is passed back to the main program.
Question 26
If you use the INT 21h instruction to accept one character from the keyboard, where will you find
the character that was entered by the user when the interrupt service routine gives control back to
your program?
1. AL
2. AH
3. DL
4. DH
Question 27
If you use the INT 21h instruction to display one character on the screen, where must this character
be stored before the INT 21h instruction is executed?
1. AL
2. AH
3. DL
4. DH
Question 28
We can use INT 10h to set the screen colour. Which one of the following is the hexadecimal
representation of the contents of BH for the screen colour to be set to grey on blue (blinking)?
25
COS2621/101/3/2018
1. 98h
2. 18h
3. C1h
4. 41h
Question 29
What should the value of CL be if we use the following shift-right instruction to divide the value in
the AX register by 4? shr ax,cl
1. 1
2. 2
3. 3
4. 4
Question 30
What should the value of CL be if we use the following shift-left instruction to multiply the value in
the AX register by 8?
shl ax,cl
1. 1
2. 2
3. 3
4. 4
Question 31
Suppose AX = 1234h and BX = FFFFh. What is the result of the following instruction?
and bx, ax
Question 32
Suppose AX = 1357h and BX = 2468h. What is the result of the following instruction?
or ax, bx
Question 33
Suppose AX = 1234h. What is the result of the following instruction?
xor ax, ax
1. AX = 1234h
2. AX = FFFFh
3. AX = 0000h
4. AX = 2468h
Question 34
Consider the program fragment given below to answer the following two questions:
loop1:
1. (a) 8 (b) 10
2. (a) 10 (b) 12
3. (a) 9 (b) 11
4. (a) 7 (b) 9
Question 35
Suppose AX contains the value 9876h. What will be the result of the following instruction?
sar ax,3
1. 130Eh
2. F30Eh
27
COS2621/101/3/2018
3. D30Eh
4. C30Fh
8.4.3 Assignment 02 – Semester 1
ASSIGNMENT 02 (SEMESTER 1)
DUE DATE: 13 April 2018
STUDY MATERIAL:
Guide 102:
Units 7, 8 & 9
Appendices A - F (Use as references)
Stallings:
Chapters 4, 5 & 13
Submit written answers for questions 1 to 3. All the questions will not necessarily be marked.
Question 1 [20]
(a) The following table reflects the memory contents of a part of memory in a one-
address machine with an accumulator:
Address Contents
300 320
305 310
310 310
315 325
320 305
28
COS2621/101/3/2018
325 300
(b) Give examples of x86 instructions in which the following addressing modes are used:
Immediate addressing
Direct addressing
Stack addressing
Indexed addressing
Base-addressing
Register indirect addressing
Question 2 [50]
Write a program in assembly language to read a number entered by the user. The program should
display an enlarged version of a given number on the screen. The program should do the
following:
Clear the screen and change the screen colour to yellow on blue.
Change the cursor position to row 10, column 0.
Prompt the user to key in an upper case letter (A - E). Read the letter from the keyboard.
Test whether the number is in range (A,…, E). Display an error message if the letter is out of
range and terminate the program.
Display an enlarged version of the letter on the screen.
$$$$ 11110 1E 1
$ $ 10001 11 2
$ $ 10001 11 3
$$$$ 11110 1E 4
$ $ 10001 11 5
29
COS2621/101/3/2018
$ $ 10001 11 6
$$$$ 11110 1E 7
Define a bit pattern for each letter and use this pattern to display the individual lines:
For eample: For the letter ‘B’ displayed above you should define a string of 7 hex numbers, one
hex number for each line.
To display the first line, step through the bit pattern, displaying a space if the bit is equal to zero
and displaying a ‘$’ otherwise. Write a carriage return and line feed to the screen and move to the
pattern for the next line. Display all 7 lines of the enlarged number.
The first line in your program should be a comment line in which your student number and name
are stated.
NB: You need to submit three screen shots of different test runs performed.
Clearing the screen, changing the screen colour and setting the cursor position (3)
Testing the range and displaying an error message if the letter is out of range (3)
Displaying the lines corresponding to the bit pattern of the letter entered (6)
___________________________________________________________________________
30
COS2621/101/3/2018
Do not submit
Question 1
Which one of the following is NOT a benefit of using glass substrates over aluminum material on
magnetic disks?
(1) Improvement in the uniformity of the magnetic film surface to increase reliability.
(2) A significant reduction in overall surface defects to help reduce read-write errors.
(3) Higher storage capacity.
(4) Greater ability to withstand shock and damage.
Question 2
In magnetic disk technology, data is transferred to and from the disk in -------------.
(1) sectors
(2) blocks
(3) chunks
(4) cylinders
Question 3
Which one of the following statements regarding multiple-zone recordings is TRUE?
(1) Within one zone, the number of bits per track vary from one track to another.
(2) The circuits needed for this technique are easy to design.
(3) The storage space is the same as that of CAV disks.
(4) Zones further from the center of the disk contain more bits than zones near the center.
Question 4
The number of read-write heads per track on a fixed-head disk is --------------.
(1) two
(2) three
31
COS2621/101/3/2018
(3) one
(4) four
Question 5
On a movable-head system, the time it takes to position the head at the track is known as --------
(1) the seek time
(2) the rotational delay
(3) the access time
(4) the transfer time
Question 6
The order in which sectors are read has a great effect on I/O performance. Consider a typical disk
with an advertised average seek time of 20 ms, a rotational delay of 8.3 ms and 512-byte sectors
with 32 sectors per track. Assume that a file that we wish to read consists of 256 sectors and is
stored as compactly as possible on the disk, i.e. using sequential organisation. Calculate the time it
takes to read the entire file. It is assumed that the disk rotates at a speed of 3600rpm.
(1) 440 ms = 0.44s
(2) 220 ms = 0.22s
(3) 880ms = 0.88s
(4) None of the above
Question 7
Which one of the following statements is NOT a characteristic of the RAID scheme?
Question 8
Which one of the following statements is NOT true regarding aspects of the RAID 1 organisation?
(1) A read request can be serviced by either of the two disks that contain the requested
data.
(2) A write request does not require that both corresponding strips be updated.
32
COS2621/101/3/2018
(3) When a single strip is updated, the array management software must first compute and
update the parity bits as well as updating the actual strip in question.
(4) When a drive fails, the data may still be accessed from the second drive.
Question 9
What is the main difference between audio CD and CD-ROM technology?
(1) An audio CD is aluminium-coated whereas a CD-ROM is gold-coated.
(2) CD-ROM players contain fault-correction devices whereas audio CD players do not.
(3) Audio CDs can only contain audio information whereas CD-ROMs can contain data or
audio information.
(4) An audio CD has an acrylic coating to protect it against dust and scratches while a CD-
ROM has a silkscreen coating for this purpose.
Question 10
The acronym CLV stands for----------------.
(1) Current Level of Velocity
(2) Concurrent Linear Vectors
(3) Constant Linear Velocity
(4) Curved Linear Vector
Question 11
Which one of the following statements regarding CDs and DVDs is TRUE?
(1) A CD can record on both sides while a DVD can only record on one side.
(2) Data can be recorded on one layer on a DVD but can be recorded on two layers on a
CD.
(3) Bits are packed more tightly on a DVD than on a CD.
(4) Currently DVDs can contain 10 times as much data as a CD can contain.
Question 12
There are various reasons why I/O-devices are not connected directly to the system bus. Which
one of the following is NOT one of those reasons?
(1) The transfer speed of the processor is much faster than that of I/O-devices.
(2) The transfer speed of some I/O-devices is faster than that of the processor or
memory.
(3) There are a variety of devices that can be connected: I/O modules are needed to handle
the communication.
(4) It often happens that I/O devices do not use the same data formats and word lengths as
the computer to which they are connected.
33
COS2621/101/3/2018
Question 13
One of the strengths of the -------------- is that it uses serial transmission rather than parallel.
(1) PCI
(2) USB
(3) ISA
(4) DMA
Question 14
In a ------------ there are multiple lines connecting the I/O modules, whereas in a --------only one line
is used to transmit data.
(1) parallel interface; serial interface
(2) serial interface; parallel interface
(3) system bus; parallel interface
(4) serial interface; system bus
Question 15
Which one of the following is one of the categories that external devices belong to?
(1) Teledetection
(2) Remote sensing
(3) Communication
(4) Human-computer interactive
Question 16
The --------- module transfers the entire block of data, one word at a time, directly to or from
memory.
(1) Data cache
(2) DMA
(3) ROM
(4) EPROM
Question 17
Which one of the following is one of the types of command that an I/O module may receive when
addressed by a processor?
(1) Acknowledge
(2) Test
34
COS2621/101/3/2018
(3) Escape
(4) Execute
Question 18
The I/O function includes a ------------- requirement to coordinate the flow of traffic between internal
resources and external devices.
(1) unique
(2) test
(3) specification
(4) control and timing
Question 19
The connection between an I/O module and a computer system is either point-to-point or ---
---------.
(1) multipoint
(2) multipoint-to-multipoint
(3) multipoint-to-point
(4) point-to-multipoint
Question 20
Which one of the following is one of the layers of protocol of the FireWire standard?
(1) Application layer
(2) Link layer
(3) Network layer
(4) Transport layer
___________________________________________________________________________
35
COS2621/101/3/2018
ASSIGNMENT 01 - SEMESTER 2
DUE DATE: 17 August 2018
Use NASM for the development of your programs. We also expect you to learn how to use DEBUG
provided with DOS within the Windows environment. It is quite a useful tool and we strongly urge
you to master its use as soon as possible. An understanding of the internal registers of the
Pentium as discussed in Tutorial Letter 101, and the use of DEBUG is essential if you want to
master this module.
• Questions 2 to 6 of this assignment will not be marked. Please evaluate your answers using
the guidelines that will be sent out in Tutorial Letter 201.
• Important: This assignment serves as preparation for Assignment 02. You will have difficulty
with the programming question in Assignment 02 if you do not submit Assignment 01 and do
not understand the exercises.
• Some of the multiple-choice questions (Question1) are revision of first-year study material.
• Submit your mark-reading sheet (Q1) to Unisa.
1.1 What is the maximum number of memory locations that can be addressed by a chip with 16
address pins?
(1) 16
(2) 65 535
(3) 22
(4) 65 536
(5) None of the above
1.2 ------------- refers to the tendency for a processor to access memory locations that have
been used recently.
(1) Cache
(2) Spatial locality
(3) Permanent locality
(4) Temporal locality
(5) Main memory
1.3 ---------------- is dedicated to one or a small number of specific tasks required by the host
device.
(1) A microcontroller
(2) An application processor
(3) A dedicated processor
(4) A cache
(5) A memory
1.4 A memory has 1024 storage units with a width of 64. Suppose the memory is
byte addressable. What is the address of the highest addressable memory
position?
(1) 1023
(2) 1024
(3) 8191
(4) 8192
(5) None of the above
37
COS2621/101/3/2018
1.6 What will the carry flag (CF), the overflow flag (OF), the sign flag (SF) and the
zero flag (ZF) be set to if the following arithmetic is done in an 8-bit register?
FE + FB
(1) CF=1, OF=0, SF=1, ZF=0
(2) CF=1, OF=1, SF=0, ZF=0
(3) CF=1, OF=0, SF=1, ZF=1
(4) CF=1, OF=1, SF=1, ZF=0
(5) None of the above.
1.7 A model for enabling ubiquitous, convenient, on-demand network access to a shared pool
of configurable computing resources is called -----------------------.
(1) Grid computing
(2) Network computing
(3) Storage computing
(4) Cloud computing
(5) LAN computing
1.8 The ------------provide a path for moving data among system modules.
(1) data buses
(2) data lines
(3) address lines
(4) control lines
(5) system buses.
38
COS2621/101/3/2018
(2) DB 45
(3) MOV AH, 56
(4) ADD AH, AL
(5) DB 23H
Question 2 (Self-evaluation)
(a) What shortcomings of ASCII led to the development of UNICODE? You can use your
own additional sources to answer this question.
(b) What is an interrupt? List and describe the most common classes of interrupt.
Question 3 (Self-evaluation)
Write a program fragment to multiply the value in the AX register with 10 (decimal) in the
following way: Multiply AX by 8 by using a shift left instruction, and store the result.
Multiply AX by 2 by using a shift left instruction and add this to the previous result.
Question 4 (Self-evaluation)
Simplify the following expression using Boolean algebra. At every step, identify the
Boolean identity that is used. (A'BC + (A'+B+C')')' + AB
Question 5 (Self-evaluation)
(a) Convert the following decimal number to binary: (123.54)10
(b) Convert the following binary number to decimal: (10111.011)2
(c) Convert the following decimal number to hexadecimal: (167.24)10
39
COS2621/101/3/2018
Question 6 (Self-evaluation)
In this question we expect you to enter a small assembly language program using a text editor,
and to assemble the program. NASM must be used to assemble the program and DEBUG
must be used to test the program. DEBUG has facilities that allow you to step through the
program, executing one instruction at a time. After each instruction you are able to see the
contents of all the registers and the status of the flags. You can also inspect the contents of
memory at any given point.
Before you attempt this question, work through the following two appendices in the
Once you feel that you understand the study material covered in Appendices A and B of the
Tutorial Letters, enter the following program using a text editor. Follow the directions in Sections
B10 and B11 of Appendix B to enter and store the program. Store it with the name ass1-q.asm in
the folder unisa\nasm or in the folder of your choice. It works better if your programs and the
NASM assembler are in the same folder.
xor dx,dx
mov ax,3017
mov bx,03h
40
COS2621/101/3/2018
div bx
or ax,7777h
test al,21h
mov ah,02h
mov dl,[char+6]
jnz output
mov dl,34h
int 21h
int 20h
; The end
Open the DOS window, make sure that you are in the unisa\nasm folder, and type as ass1-q
to assemble the program. Correct syntax errors (if any) and assemble again. Answer the
following questions when your program has assembled successfully.
Note that you have to use an h to indicate that a number is in hexadecimal. For example:
there is a big difference between 100 and 100h.
(a) Print a printout of the program listing generated by NASM for your own records.
(b) Load the program by entering: debug as1-q.com
'Unassemble' the object code by entering: u 100 130
(c) Why did we use jmp_ for a label name instead of just jmp without the underscore?
(d) Which ASCII character is stored in memory position 107h?
(e) What are the actual memory positions that are associated with the labels start and
output respectively?
(f) Where do the instructions that follow int 20h in the 'unassembly' come from?
(g) Which byte(s) is/are occupied by the test al,21h instruction?
(h) Which are the first and last memory positions occupied by the program?
(i) What is the length of the program?
(j) What is the hexadecimal representation of the machine code for the instruction:
mov dl,[char+6]
(k) What ASCII character will be moved into DL if the mov dl,[char+6] instruction is executed?
41
COS2621/101/3/2018
Use the T-option of DEBUG to trace the program. Remember to use the P-option to trace the INT
instructions.
HOW TO OBTAIN A PRINT-OUT OF THE TEXT ON THE SCREEN WITHIN A DOS WINDOW
There are various ways to obtain a print-out of the DEBUG output in the DOS window. You
might find the following method handy for various applications:
To get your DOS window from full-screen mode to window mode, you can do the following:
• Again move to the blue bar at the top of the screen and RIGHT-click. A drop-down menu
appears. Move to Edit, and another menu appears. Click on Copy. By doing this the selected
text is copied to the clipboard. Exit.
• Now open a document in the text processor you are using. Click on Edit and then on
Paste. The output that was copied to the clipboard will be pasted into your document and
can be printed from there.
___________________________________________________________________________
SELF-TEST A – SEMESTER 2
DATE: 31 August 2018
Do not submit
42
COS2621/101/3/2018
STUDY MATERIAL:
Guide 102:
Units 7, 8 & 9
Appendices A - F (Use as references)
Stallings:
Chapters 4, 5 & 13
Submit written answers for questions 1 and 2. All the questions will not necessarily be marked.
Question 1 [20]
(iv) Pipelining
43
COS2621/101/3/2018
Question 2 [50]
___________________________________________________________________________
8.4.8 Self-test B – Semester 2
SELF-TEST B - SEMESTER 2
44
COS2621/101/3/2018
There are two self-evaluation assignments. These must not be submitted but do them at your own
pace and evaluate your answers using the tutorial letter that will contain detailed discussions on all
the questions in the self-tests.
10 EXAMINATION
Your final semester mark is calculated based on your performance on assignments throughout the
semester as well as your examination mark. Therefore, assignments not only give you the
opportunity to evaluate your understanding of the study material covered in the module, but also
contribute 20% towards your final semester mark. The following formula will be used to calculate
your final semester mark:
Semester mark (out of 100) × 0.20 + Examination mark (out of 100) × 0.80.
The table below illustrates how the assessment system works if you have submitted all the
assignments for the module and written the final exam.
Note: Assignment 1 and 2 contribute towards your semester mark. You will not be awarded marks if
an assignment is not submitted or submitted after the due date.
Assignment 1 2
Weight 30/100 70/100
Semester Mark Contribution 100% × 0.30 100% × 0.70
Suppose you received a mark of 50% for Assignment 01 and 40% for Assignment 02. Your
semester mark will be calculated as 50 × 0.3 + 40 × 0.7 = 15 + 28 = 43
45
Suppose your exam mark is 70%. Your final mark will be:
0.2 × 43 + 70 × 0.8 = 8.6 + 56.0 = 64.6% which will be rounded to 65%.
Please note that the year mark will not be taken into account if your exam mark is below 40%. It is
also not taken into account if you are writing a supplementary examination.
How do I obtain a print-out of the text on the screen within a DOS window?
There are various ways to obtain a print-out of the DEBUG output in the DOS window. You might
find the following method handy for various applications:
46
COS2621/101/3/2018
Run the program for which you want to obtain a screen dump. Press Shift + PrtScn.
Go back to your Word document and press Ctrl + V. The relevant screen will be copied to the Word
document. You can copy and paste it from this document to your assignment.
Please note that there is also a FAQ link on the COS2621 web site.
12 SOURCES CONSULTED
Both the prescribed book and the recommended book were consulted in drafting this tutorial letter.
13 CONCLUSION
Any additional information that may become relevant during the year will be published and
announced on myUnisa.
I hope you will enjoy this module and find the content useful.
Lecturer:
Dr. Wernher Friedrich
© Unisa 2018
47