COS2621 Computer Architecture Overview
COS2621 Computer Architecture Overview
Year modules
School of Computing
BARCODE
CONTENTS
Page
1 INTRODUCTION ............................................................................................................................ 3
2 PURPOSE AND OUTCOMES…………………………………………………………………….. 4
2.1 Purpose………………………………………………………………………………………….…… 4
2.2 Outcomes…………………………………………………………………………………………….. 4
3 CURRICULUM TRANSFORMATION…………………………………………………………….. 5
4 LECTURER(S) AND CONTACT DETAILS………………………………………………………. 5
4.1 Lecturer(s)……………………………………………………………………………………………. 5
4.2 Department…………………………………………………………………………………………… 5
4.3 University……………………………………………………………………………………………… 5
5 RESOURCES………………………………………………………………………………………… 5
5.1 Prescribed book(s)…………………………………………………………………………………… 5
5.2 Recommended book(s)……………………………………………………………………………… 6
5.3 Electronic reserves (e-reserves)…………………………………………………………………... 6
6 STUDENT SUPPORT SERVICES………………………………………………………………… 7
6.1 First-Year Experience Programme @ Unisa……………………………………………………... 7
7 STUDY PLAN………………………………………………………………………………………… 8
8 PRACTICAL WORK………………………………………………………………………………… 9
9 ASSESSMENT…………………………………………………………………………………….... 10
9.1 Assessment plan……………………………………………………………………………………. 10
9.2 Assignment due dates……………………………………………….…………………………….. 11
9.3 Submission of assignments……………………………………………………………………….. 11
9.4 The assignment…………………………………………………………………………………….. 11
9.4.1 Assignment 1….…………………………………………………………………………….. 12
2
COS2621/101/0/2022
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
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 year. If you stick to this programme, the handing in of an
assignment should never develop into a crisis.
Please communicate with your module leader to find out if any of the modules that you have
registered for falls in this category.
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.
The COS2621 module is blended, meaning that we use a combination of printed and online
material to engage with you.
This module will be useful for providing qualified professionals with an introductory level
understanding of computer organization and assembly language programming. We also look at
some operating systems concepts. This will equip you with the knowledge and skills needed to
analyse and evaluate the architecture of a specific family of computers and perform low-level
programming tasks on it.
2.2 Outcomes
Identify the different hardware components that a computer system consists of, such as the CPU,
memory, busses and I/O devices, and describe the important functions of each component.
2. Discuss how these components are interconnected and how communication takes place
within a computer system.
3. Demonstrate different ways of data representation and also the way in which binary, integer
and floating-point numbers are represented, and manipulated.
4
COS2621/101/0/2022
4. Describe principles of different memory systems, such as cache memory, internal memory
and external memory
5. Evaluate the advantages and disadvantages of using different types of input and output
devices.
6. Demonstrate processor structure and organisation, and use of a variety of arithmetic and
logic operations, as well as addressing modes through programming in assembly
language.
7. Discuss the principles of RISC computers.
3 CURRICULUM TRANSFORMATION
Unisa has implemented a transformation charter based on five pillars and eight dimensions. In response
to this charter, we have placed curriculum transformation high on the teaching and learning agenda.
Curriculum transformation includes the following pillars: student-centred scholarship, the pedagogical
renewal of teaching and assessment practices, the scholarship of teaching and learning, and the infusion
of African epistemologies and philosophies. These pillars and their principles will be integrated at both
programme and module levels as a phased-in approach. You will notice a marked change in the teaching
and learning strategy implemented by Unisa, together with how the content is conceptualised in your
modules. We encourage you to embrace these changes during your studies at Unisa in a responsive way
within the framework of transformation.
Ms P Mvelase
4.2 Department
This module is presented by the School of Computing. Contact details of the School through the
department secretary:
4.3 University
Contact details of relevant administrative departments will be provided in a separate tutorial letter
and can also be found in the brochure Study@Unisa.
5 RESOURCES
5.1 Prescribed book(s)
5
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: [Link]
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.
Recommended books can be requested online, via the Library catalogue.
Several links to Open Educational Resources (OERs) will be available on the COS2621 web site
under Additional Resources.
E-reserves can be downloaded from the Library catalogue. More information is available at:
[Link]
Recommended guides:
The website has all the tips and information you need to succeed at Unisa.
For many students, the transition from school education to tertiary education is beset with anxiety.
This is also true for first-time students to Unisa. Unisa is a dedicated open distance and e-learning
institution. Unlike face-to-face/contact institutions, Unisa is somewhat different. It is a mega
university, and all our programmes are offered through a blended learning mode or fully online
learning mode. It is for this reason that we thought it necessary to offer first-time students
additional/extended support so that you can seamlessly navigate the Unisa teaching and learning
journey with little difficulty and few barriers. In this regard we offer a specialised student support
programme to students entering Unisa for the first time. We refer to this programme as Unisa’s
First-Year Experience (FYE) Programme. The FYE is designed to provide you with prompt and
helpful information about services that the institution offers and how you can access information.
The following FYE programmes are currently offered:
7
FYE website: All the guides and resources you need to navigate through your first year at
Unisa can be accessed using the following link: [Link]/FYE
FYE e-mails: You will receive regular e-mails to help you stay focused and motivated.
FYE broadcasts: You will receive e-mails with links to broadcasts on various topics related to
your first-year studies (eg videos on how to submit assignments online).
FYE mailbox: For assistance with queries related to your first year of study, send an e-mail to
fye@[Link]
7 STUDY PLAN
Use the Study@Unisa brochure for general time management and planning skills.
Please note that we do not work through the chapters in the prescribed book in the order in which
they are presented. We focus on specific chapters for each assignment so that you will have the
required knowledge to complete the relevant assignment.
COS2621 - Study Programme
Do Self-test A
8
COS2621/101/0/2022
Do Self-test B
Examination
8 PRACTICAL WORK
When you register for this module, you will receive the NASM assembler on a CD-ROM. Load the
file named [Link] 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:
[Link]
The following assemblers are also acceptable:
- TASM (Turbo Assembler) or OPTASM (Optimized TASM)
Available from: Software dealers.
- MASM (Microsoft Macro Assembler) Available from: Software dealers.
This assembler can also be downloaded from the web.
Tutorial letter 102 contains the information needed for the practical component of the module. We
will use NASM to write and assemble small assembly language programs. We will also use
DEBUG (which is part of DOS within the Windows environment) as a debugging tool for tracing
and testing assembly language programs. The study material for COS2621 supplied in Stallings
and the tutorial letters should be sufficient to enable you to do the assembly language
programming that we expect of you for this module.
You must plan to SPEND A CONSIDERABLE AMOUNT of time at your computer experimenting
with NASM and DEBUG. One has to experiment and try things out in order to gain a thorough
grasp of the internal organisation of a computer. You cannot expect to obtain this knowledge only
from reading the textbook and the tutorial letters.
9
Note that you need to use a 32-bit version of Windows for DEBUG.
DEBUG does not function on a 64-bit platform, there are 2 options that can be followed to get the
program to execute correctly:
Option 1
Windows 7 64-bit: If you are using a 64-bit version of Windows, you can create a virtual machine
with Windows XP by clicking on Virtual Machine listed under All programs on the 64-bit version of
Windows 7. Another alternative is to download and install VirtualPC from Microsoft. You can also
download and install a free 32-bit Windows XP image from Microsoft. Use the following link:
[Link]
Instructions are also provided to install this Windows XP mode.
Windows 64-bit platforms have the ability to run programs that are 32-bit. In order to select this
option, you must right click on the program and select properties. Then look for a compatibility
tab. On the tab you will see an option to run the program in compatibility mode for a previous
Windows platform. See if a 32-bit version is available in the list. If it is, try to run the 32-bit version
of DEBUG in that environment. If this is not working, then either download the virtual machine
option 1 or try the easier option 2 by using a DosBox.
Option 2
The windows XP environment is not needed if you just use a DosBox. This creates an emulator
that runs older programs. DEBUG works by using DosBox.
[Link]
Please read the intro of DosBox, the main thing to remember is to mount your drive you need to
work with. DosBox will typically start in drive Z:/>
From there you need to mount the drive where DEBUG is installed on, e.g. C:/>
Then you need to go to the folder that contains DEBUG if you have not mounted it directly and
start debug normally.
9 ASSESSMENT
9.1 Assessment plan
All information on when and where to submit your assignments will be made available to you
via the myUnisa site for your module.
Due dates for assignments, as well as the actual assignments are available on the myUnisa
site for this module.
You need to obtain a year mark average of 10% for the assignment/s to gain admission to the
examination.
The examination will count 80% towards the final module mark.
9.2 Assignment due dates
Assignment due dates will be made available to you on the landing page of myUnisa for this
module. We envisage that the due dates will be available to you upon registration.
Please start working on your assignments as soon as you register for the module.
Log on to the myUnisa site for this module to obtain more information on the due dates for the
submission of the assignments.
Modules offered by Unisa are either blended (meaning that we use a combination of printed
and online material to engage with you) or online (all information is available via the internet).
In all cases of online engagement, we use myUnisa as our virtual campus.
From 2022, the myUnisa virtual campus will be offered via a new learning management
system. This is an online system that is used to administer, document and deliver educational
material to you and support engagement with you.
Look out for information from your lecturer as well as other Unisa platforms to determine how
to access the virtual myUnisa module site.
Information on the tools that will be available to engage with the lecturer and fellow students
to support your learning will also be communicated via various platforms.
Additional information on the use of the myUnisa site for the module, as well as features to
engage and communicate with your lecturer and other students will also be made available
via the online site for the module.
Therefore, log on to the myUnisa site for your module to gain more information on where to
complete and/or upload your assignments and how to communicate with your lecturer.
As indicated in section 9.2, you need to complete 2 number of assignments for this module.
11
9.4.1 Assignment 1
ASSIGNMENT 01
SUBMISSION PROCEDURE Mark-reading sheet / myUnisa
WEIGHT: 30
UNIQUE NUMBERS:
STUDY MATERIAL: Tutorial Letter 102: Units 1, 2 & 3
Appendices A & B Appendices D, E & F (Use as references)
Stallings: Chapters 0, 1, 2, 3, 9 and 11
Appendix B
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.
PLEASE BEAR THE FOLLOWING IN MIND WHEN YOU DO THE ASSIGNMENT:
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.
12
COS2621/101/0/2022
1.4 ------------------- controls the operation of the computer and performs its data
processing functions.
13
1.5 What is the hexadecimal representation of the binary value 01001110?
(1) 27h
(2) 2F
(3) 4C
(4) 4E
(5) None of the above.
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.
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.
14
COS2621/101/0/2022
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.
b) What does the term embedded systems mean?
15
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]
16
COS2621/101/0/2022
sub al,bl
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.
8.4.2 Self-test A
SELF-TEST A
Do not submit
STUDY MATERIAL: Guide 102: Units 4, 5 & 6
Appendix C (work through) Appendices A, B, D, E & F
(Use as references)
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?
18
COS2621/101/0/2022
1. AX
2. BX
3. CX
4. DX
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?
19
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
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?
20
COS2621/101/0/2022
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
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
21
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.
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
22
COS2621/101/0/2022
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
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
23
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.
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?
25
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)?
1. 98h
26
COS2621/101/0/2022
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?
27
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
28
COS2621/101/0/2022
Question 35
Suppose AX contains the value 9876h. What will be the result of the following instruction?
sar ax,3
1. 130Eh
2. F30Eh
3. D30Eh
4. C30Fh
9.4.2 Assignment 02
ASSIGNMENT 02
SUBMISSION PROCEDURE: Written answers and a written program
WEIGHT: 70
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:
29
Address Contents
300 320
305 310
310 310
315 325
320 305
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.
30
COS2621/101/0/2022
$$$$ 11110 1E 1
$ $ 10001 11 2
$ $ 10001 11 3
$$$$ 11110 1E 4
$ $ 10001 11 5
$ $ 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)
31
Definition of bit patterns (5)
Displaying the lines corresponding to the bit pattern of the letter entered (6)
___________________________________________________________________________
SELF-TEST B
Do not submit
STUDY MATERIAL: Guide 102: Units 10, 11 & 12
Stallings: Chapters 6, 7 & 15
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?
32
COS2621/101/0/2022
(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
(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?
33
(1) Redundant disk space is used to store parity information.
(2) The operating system sees such a scheme as one logical disk drive.
(3) Data are distributed over the disks which comprise the RAID.
(4) A hierarchical relationship exists between the different RAID-levels.
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.
(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
34
COS2621/101/0/2022
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.
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
35
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
(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
------------.
36
COS2621/101/0/2022
(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
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.
9.6 The examination
Examination information and details on the format of the examination will be made available to
you online via the myUnisa site. Look out for information that will be shared with you by your
lecturer and e-tutors (where relevant) and for communication from the University.
10 ACADEMIC DISHONESTY
10.1 Plagiarism
Plagiarism is the act of taking the words, ideas and thoughts of others and presenting them as
your own. It is a form of theft which involves several dishonest academic activities, such as the
following:
Cutting and pasting from any source without acknowledging the source.
Not including or using incorrect references.
Paraphrasing without acknowledging the original source of the information.
10.2 Cheating
Cheating includes, but is not limited to, the following:
37
Using social media (eg WhatsApp, Telegram) or other platforms to disseminate
assessment informationSubmitting corrupt or irrelevant files.
Buying completed answers from “tutors” or internet sites (contract cheating).
10.3 More information about plagiarism can be downloaded on the link below
[Link]
If you are a student with a disability and would like additional support or need additional time
for assessments, you are invited to contact Ms Promise Mvelase at mvelap@[Link] so
that you can be assisted.
38
COS2621/101/0/2022
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.
13 SOURCES CONSULTED
Both the prescribed book and the recommended book were consulted in drafting this tutorial letter.
14 IN CLOSING
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:
Ms. Promise Mvelase
Unisa 2022
39