0% found this document useful (0 votes)
13 views39 pages

COS2621 Computer Architecture Overview

The tutorial letter COS2621/101/0/2022 provides essential information for students enrolled in the Computer Organisation and Architecture module, including the purpose, outcomes, curriculum details, and resources available. It emphasizes the importance of understanding computer architecture and assembly language programming while offering guidance on study plans and assessment methods. Additionally, it outlines student support services and the blended learning approach adopted by Unisa for this module.

Uploaded by

Vuyisa Mini
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views39 pages

COS2621 Computer Architecture Overview

The tutorial letter COS2621/101/0/2022 provides essential information for students enrolled in the Computer Organisation and Architecture module, including the purpose, outcomes, curriculum details, and resources available. It emphasizes the importance of understanding computer architecture and assembly language programming while offering guidance on study plans and assessment methods. Additionally, it outlines student support services and the blended learning approach adopted by Unisa for this module.

Uploaded by

Vuyisa Mini
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

COS2621/101/0//2022

Tutorial Letter 101/0/2022

Computer Organisation and Architecture


COS2621

Year modules
School of Computing

This tutorial letter contains important information about your module.

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

9.4.2 Assignment 2………………………………………………………………………………………. 29

9.5 Other assessment methods……………………………………………………………………… 337


9.6 The examination……………………………………………………………..……………………. 337
10 ACADEMIC DISHONESTY……………………………………………………………………… 337
10.1 Plagiarism…………………………………………………………………………………………. 337
10.2 Cheating…………………………………………………………………………………………… 337
10.3 More information about plagiarism can be downloaded on the link below………………… 38
11 STUDENT WITH DISABILITY…………………………………………………………………. 38
12 FREQUENTLY ASKED QUESTIONS………………………………………………………… 338
13 SOURCES CONSULTED………………………………………………………………………. 39
14 IN CLOSING……………………………………………………………………………………. 39

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

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 year. If you stick to this programme, the handing in of an
assignment should never develop into a crisis.

Information on tutorial offerings at Unisa


3
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.

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.

2 PURPOSE AND OUTCOMES


2.1 Purpose

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.

4 LECTURER(S) AND CONTACT DETAILS


4.1 Lecturer(s)

Ms P Mvelase

011 471 2511

4.2 Department

This module is presented by the School of Computing. Contact details of the School through the
department secretary:

Mrs Helen Frank

011 670 9188

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)

The prescribed book for this module is:


William Stallings. Computer Organization and Architecture, Designing for Performance
Tenth edition. (Global Edition), Pearson, 2016.

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]

5.2 Recommended book(s)

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.

5.3 Electronic reserves (e-reserves)

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]

5.4 Library services and resources information

The Unisa Library offers a range of information services and resources:


6
COS2621/101/0/2022

 For brief information, go to [Link]


 For more detailed Library information, go to
[Link]
 For research support and services (eg Personal Librarians and literature search
services), go to [Link]
services/Research-support

The Library has created numerous Library guides: [Link]

Recommended guides:

 Request and find library material/download recommended material:


[Link]
 Postgraduate information services: [Link]
 Finding and using library resources and tools:
[Link]
 Frequently asked questions about the library:
[Link]
 Services to students living with disabilities:
[Link]

Important contact information:


 Ask a Librarian: [Link]
 Technical problems accessing library online services: Lib-help@[Link]
 General library related queries: Library-enquiries@[Link]
 For queries related to library fines and payments: Library-fines@[Link]

6 STUDENT SUPPORT SERVICES


The Study @ Unisa website is available on myUnisa: [Link]/brochures/studies

The website has all the tips and information you need to succeed at Unisa.

6.1 First-Year Experience Programme @ 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

Period Study Material

Guide 102: Unit 1


Week 1-4 Stallings: Chapters 0, 1, 9 and 11

Guide 102: Unit 2


Week 4-8 Stallings: Chapter 2, Appendix B

Guide 102: Unit 3, Appendices A and B


Weeks 9-12 Stallings: Chapter 3

Do and submit Assignment 01

Guide 102: Units 4, 5 and 6


Stallings: Chapters 14, 10 and 12
Guide 102: Appendix C (work through)
Appendices A, B, D, E & F (use as
Week 13-16 references)

Do Self-test A

Guide 102: Units 7, 8 and 9


Stallings: Chapters 13, 4 and 5
Weeks 16-20 Do Assignment 02, theoretical questions

Guide 102: Appendices A - F (use as


references)

8
COS2621/101/0/2022

Do Assignment 02, practical question


Week 20-24

Do and submit Assignment 02

Guide 102: Units 10, 11 and 12


Weeks 24-28 Stallings: Chapters 6, 7 and 15

Do Self-test B

Weeks 32 & 40 Revision

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

 To complete this module, you will be required to submit 2 assignments.

 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.

 To gain admission to the examination, you will be required to submit 1 assignment.

 Your assignments will comprise a combination of MCQs, and written assessment

 You need to obtain a year mark average of 10% for the assignment/s to gain admission to the
examination.

 The assignment weighting for the module is 20%.


10
COS2621/101/0/2022

 The examination will be take-home examination

 The examination will count 80% towards the final module mark.
9.2 Assignment due dates

 There are no assignment due dates included in this tutorial letter.

 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.

9.3 Submission of 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.

 The University undertakes to communicate as clearly and as frequently as is necessary to


ensure optimum advantage in the use of the new learning management system.

 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.

9.4 The assignment

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:

 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.

Mark-reading part of the assignment - submit Q1.1 to Q1.10

Question 1 (Submit on mark-reading sheet) [30]

12
COS2621/101/0/2022

1 What is the result of the following hexadecimal calculation? FB + CA


(1) C5
(2) 1A5
(3) 1D6
(4) 1C5
(5) None of the above

1.2 Simplify ABC′ + (AB′)′ + BC by using Boolean identities.


(1) A′ + B
(2) A′ + B + C′
(3) A′ + BC′
(4) A′
(5) A′ + ABC′ + B

1.3 Which of the following are language processors?


(1) C++
(2) Assembler
(3) Compiler
(4) Interpreter
(5) All of the above

1.4 ------------------- controls the operation of the computer and performs its data
processing functions.

(1) Main memory


(2) Control memory
(3) Processor
(4) Control unit
(5) Register

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.6 -------------------------- permits addresses to be computed in the ALU and then


inserted into instructions stored in memory.
(1) Address modify
(2) Address memory
(3) I/Oinstructions
(4) Program counter
(5) Address register

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

(1) It allocates space for the literals


(2) It computes the total length of the program
(3) It builds the symbol table for the symbols and their values
(4) all of the above
(5) It adds the instruction operand field empty in the assembled binary instruction.

Self-evaluation: written part of the assignment (do not


submit)
Question 2
a) Why is it important for a Computer Scientist to study computer organisation?
b) Explain the following terms in relation to microprocessor speed:
(i) Branch prediction
(ii) Data flow analysis
(iii) Speculative execution
(iv) Pipelining

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.

(a) Load the program by entering: debug [Link]


(b) ‘Unassemble’ the object code by entering: u 100 130
(c) Why did we use test_ for a label name instead of just test without the underscore?
(d) Which ASCII character is stored in memory position 120h?
(e) What are the actual memory positions that are associated with the labels test_
and disp respectively?
(f) Where do the instructions that follow the ‘$’ symbol at the end of the string mess
in the ‘unassembly’ come from?
(g) Which byte(s) is/are occupied by the mov bl,[b] instruction?
(h) Which are the first and last memory positions respectively 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
17
sub al,bl?
(k) What ASCII character will be moved into DL if the mov dl,37 instruction
is executed?
Use the T-option of DEBUG to trace the program. Remember to use the P-option to trace the INT
instructions. Use the trace to answer the following questions:
(l) What is the value of IP before execution of the jg disp instruction?
(m) What are the values stored in AL and BL respectively just before the sub
instruction is executed?

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)

Stallings: Chapters 10, 12 & 14

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?

(a) the sign flag


(b) the carry flag
(c) the overflow flag
(d) the zero flag

1. (a) 0 (b) 0 (c) 1 (d) 0


2. (a) 0 (b) 0 (c) 0 (d) 0
3. (a) 1 (b) 0 (c) 1 (d) 0
4. (a) 1 (b) 1 (c) 0 (d) 1

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?

1. (i) 1234h (ii) 1234h


2. (i) 123410 (ii) 123410
3. (i) 1234h (ii) 123410
4. (i) 123410 (ii) 1234h

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?

1. All machines use the same standard regarding endianness.


2. The bit and byte ordering on one machine are always the same.
3. Both bits and bytes are numbered from 0.
4. The Intel Pentium is a little-endian machine.
24
COS2621/101/0/2022

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?

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.

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

1. AX = 1234h and BX = 1234h


2. AX = 1234h and BX = FFFFh
3. AX = FFFFh and BX = FFFFh
4. AX = FFFFh and BX = 1234h

Question 32
Suppose AX = 1357h and BX = 2468h. What is the result of the following instruction?

27
or ax, bx

1. AX = 1357h and BX = 377Fh


2. AX = 377Fh and BX = 2468h
3. AX = 7777h and BX = 2468h
4. AX = 1357h and BX = 777Fh

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:

(a) How many times will the loop be executed?


(b) What is the final value of AX after the execution of the loop?
mov ax,2 mov bx,7 mov cx,9

loop1:

add ax,1 loop 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

What values do the following instructions load into the accumulator?


LOAD DIRECT 300
LOAD DIRECT 320
LOAD INDIRECT 325

(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]

Assembly language programming:

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

Display an enlarged version of the letter on the screen.

Example: If the user enters B, the following pattern is displayed:


Enlarged letter Bit pattern Hex number Line number

$$$$ 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.

Terminate the program.

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.

Marks will be allocated as follows:

Clearing the screen, changing the screen colour and setting the cursor position (3)

Displaying the user prompt (1)

Reading the letter (ASCII character) (2)

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)

A program listing submitted (5)

Three screen shots of test cases submitted (3 × 5) (15)

The program structure (5)

The program documentation (comments) (5)

___________________________________________________________________________

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

9.5 Other assessment methods

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:

 Completing assessments on behalf of another student, copying from another student


during an assessment or allowing a student to copy from you.

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]

11 STUDENT WITH DISABILITY


The Advocacy and Resource Centre for Student with Disability ARCSWiD) provides an
opportunity for staff to interact with new and returning students with disabilities.

 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.

12 FREQUENTLY ASKED QUESTIONS


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:
To print text from a DOS screen - Windows XP, 7:
To get your DOS window from full-screen mode to window mode, you can do the following:
• Click on Start, then on Programs, then on Accessories.
• Now move to Command prompt and RIGHT-click. Click on Properties, then click on
Options.
• At Edit Options, mark Quick edit mode, and at Display options, mark Window. Click on
OK. Exit.
When you want to print text from the DOS window:
• 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 Mark. Select the output with the mouse, i.e.
highlight it.
• 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.
How do I obtain a screen shot?
The easiest way: Open a blank MS Word document.
Run the program for which you want to obtain a screen dump. Press Shift + PrtScn.

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

You might also like