Chapter 4 - Operating Systems and Computer Architecture: Syllabus Content
Chapter 4 - Operating Systems and Computer Architecture: Syllabus Content
Chapter 4 - Operating Systems and Computer Architecture: Syllabus Content
architecture
Syllabus Content:
1. Computer architecture and the fetch-execute cycle:
show understanding of the basic Von Neumann model for a computer system and the
stored program concept (program instructions and data are stored in main memory and
instructions are fetched and executed one after another)
describe the stages of the fetch-execute cycle, including the use of registers and buses
2. Operating systems:
describe the purpose of an operating system (Candidates will be required to understand the
purpose and function of an operating system and why it is needed. They will not be
required to understand how operating systems work.)
show understanding of the need for interrupts
Page #98
4 Operating systems and computer architecture
Introduction:
All computers have operating systems which makes it possible to communicate with
software and hardware.
There are many ways of representing computer architecture including the more common
ones known as the von Neumann model.
An operating system is software which controls the operations of the computer system
and manages all of the computer’s hardware and programs.
It provides an interface through which a user can run an application.
It controls how the computer responds to user’s requests and how hardware
communicates with each other.
99
2) Types of interface:
The means of communication between the user and the machine is known as the user
interface.
It consists of both hardware and software through which a user provides input to a
computer or receives information from it.
CLI (command line interface) is the one, where user types a series of commands using
keyboard and communicates directly with computer system.
To use this, the user needs to know what commands are available, understand the
commands and understand the way information is stored in computer system.
i) Describe how a user can select and open an application using CLI including any input
hardware needed.
The user communicates directly with computer system by typing in commands in response
to a prompt.
Several commands are entered to carry out a task such as simply loading software.
The input hardware needed for typing these commands is keyboard or keypad.
100
2) Graphical User Interface (GUI):
Graphical interfaces are called GUI (graphical user interface) or WIMP (windows, icons,
menus and pointer) because it displays graphics as well as text.
GUI is very user friendly as user can select options by use of menus of choices and small
pictures which represent different available options.
Choices are selected by the user using a pointing device e.g. mouse.
i) Describe how a user can select and open an application using GUI including any input
hardware needed.
The user interacts with a computer using pictures and symbols or drop down menu.
Tasks are initiated by selecting the icons (e.g. selecting the icon of a software to open it).
It is usually part of a windows environment.
The input hardware needed for selections is pointing device (e.g. mouse) or a touch screen.
101
3) Batch processing and real time transaction processing:
Describe the main differences between batch processing and real time transaction
processing.
1) Batch processing:
102
5) What is handshaking?
Q1. State the term that means “exchange of signals between two devices to ensure
synchronization when communication starts”.
Handshaking.
6) Utility software:
7) File management:
i) The operating system is responsible for the following activities in connections with file
management:
103
8) Interrupts:
It is a signal sent from a device or from software to the processor (that attention is
required).
It is used to attend to certain tasks/issues.
Interrupt causes the processor/OS to pause what it is doing, service the interrupt and then
continue with previous process.
Interrupts have different levels of priority depending upon the task.
It enables multi-tasking to be carried out on a computer.
Example: interrupts can occur when there is a paper jam in a printer, or a software error has
occurred etc.
9) Buffers:
Q1. State the name for the area of memory used to store temporarily the data being sent to
the printer. (1)
Printer buffer.
104
10) What is meant by Von Neumann architecture?
In early years, computers were not able to store programs until 1945; John von Neumann
developed the idea of a stored-program computer, referred to as Von Neumann Architecture
concept.
The Von Neumann architecture uses a single processor which follows a linear sequence of fetch
decode-execute. The processor has some special registers which are discrete memory locations
with special purposes attached.
Quite simply, his idea was to hold programs and data in a memory. Data would then move
between the memory unit and the processor.
11) Buses:
The data, address and control buses connect the processor, memory and I/O controllers.
They are used to connect together the internal components of the CPU and provide
pathway for transmitting data and instructions.
They essentially move data around the computer and send out control signals to ensure
everything is properly synchronized.
105
i) Type of buses with their descriptions:
1) Address bus:
2) Data bus:
3) Control bus:
ii) A more detailed diagram to demonstrate Von Neumann architecture is given below:
106
i) Address:
ii) Register:
1) MAR:
The memory address register (MAR) is used to hold the memory address that contains
either the next piece of data or an instruction that is to be used.
2) MDR:
The memory data register (MDR) acts like a buffer and stores data and instructions that
are in use from the address stored in MAR.
It is used whenever anything is to go from the central processing unit to main memory,
or vice versa.
107
13) Processor:
The central processor contains the arithmetic-logic unit (also known as the arithmetic
unit) and the control unit.
The arithmetic-logic unit (ALU) is where data is processed.
This involves arithmetic and logical operations.
Arithmetic operations are those that add and subtract numbers, and so on.
Logical operations involve comparing binary patterns and making decisions.
The control unit is used to manage the flow of data and interaction between the
components of the processor.
It fetches instructions from memory, decodes them and synchronizes the operations
before sending signals to other components of the computer telling them “what to do”.
It controls the operations of memory, processor and input/output.
The program counter and the current instruction registers are in the control unit.
1) PC:
The program counter (PC) holds the address of the current or next instruction to be
fetched/processed/executed.
It also stores the number of processes that have been completed.
Sometimes the program counter is called the Sequence Control Register (SCR) as it
controls the sequence in which instructions are executed.
2) CIR:
The current instruction register (CIR) holds the current instruction that is to be
executed.
3) ALU:
The arithmetic-logic unit (ALU) is where data is processed. This involves arithmetic and
logical operations. Arithmetic operations are those that add and subtract numbers, and so
on. Logical operations involve comparing binary patterns and making decisions.
*More simply it can be stated that:* ALU is used to carry out calculations on data.
108
4) IAS:
The immediate access store (IAS) is used to hold data and instructions waiting to be
processed after they are loaded from the main memory.
5) ACC:
The accumulator (ACC) is used to temporarily hold data that is currently being used in
a calculation.
It is found in the arithmetic unit.
6) IR:
The index register (IR) is a microprocessor register used for modifying operand
addresses during the run of a program, typically for doing vector/array operations.
They are used for a special kind of indirect addressing where an immediate constant (i.e.
which is part of the instruction itself) is added to the contents of the index register to form
the address to the actual operand or data.
A CPU cannot do math on data registers, although it can do it indirectly with an index
register.
For example, to process your first name, a program move 300 to MAR and 0 to the index
register.
An indexed operation adds the index value to the MDR, retrieving the letter at location
300.
Next, the program increments the index by 1 and gets the next letter.
It repeats this process until it has moved the whole name.
The index register works with the data registers, allowing a program to process strings of data
efficiently. Moreover, it gives greater speed and convenience to address registers.
15) Input/Output:
The processor firstly fetches some data and instructions from memory and stores them in
suitable registers.
Each instruction is then decoded before finally being executed.
This is known as the fetch-execute cycle.
109
The PC (program counter) contains the address of the next instruction to be fetched.
The address contained in the PC (program counter) is copied to the MAR (memory address
register) via the address bus.
The instruction is then copied from the memory location contained in the MAR (memory
address register) and is placed in the MDR (memory data register).
The entire instruction is then copied from the MDR (memory data register) and placed in the
CIR (current instruction register).
The value in the PC (program counter) is then incremented by 1 so that it points to the next
instruction to be fetched.
The address part of the instruction, if any, is placed in the MAR (memory address register).
The instruction is finally decoded and is then executed by sending out signals (via the control
bus) to various components of the computer system.
110
Q1. The seven stages in a von Neumann fetch-execute cycle are shown in the table below.
Put each stage in the correct sequence by writing the numbers 1 to 7 in the right hand
column. The first one has been done for you.
111
Answer:
112
17) READ and WRITE function of memory unit (MAR and MDR):
1) READ operation:
We will use the memory section shown below. Suppose we want to READ the contents of
memory location 1111 0001. We will use this address and its content:
Address Contents
1111 0000 0111 0010
1111 0001 0101 1011
1111 0010 1101 1101
1111 0011 0111 1011
The address of location 1111 0001 to be READ from is first WRITTEN into the MAR
(memory address register):
MAR 1 1 1 1 0 0 0 1
A read signal is sent to the computer memory using the control bus.
Then the contents of the memory location 1111 0001 are put into the MDR (memory data
register):
MDR 0 1 0 1 1 0 1 1
R
113
2) WRITE operation:
Again we will use the memory section given above. Suppose this time we want to show how
the value 1001 0101 was WRITTEN into memory location 1111 1101.
The data to be stored is first WRITTEN into MDR (memory data register):
MDR 1 0 0 1 0 1 0 1
R
This data has to be WRITTEN into memory location with the address 1111 1101; so this address is
now written into MAR:
MAR 1 1 1 1 1 1 0 1
Finally, a write signal is sent to the computer memory using the control bus and this value will
then be written into the correct memory location in the memory section.
The examiner will give you a table of memory section like the one above.
You’ll be asked to perform either READ or WRITE or maybe both operations.
Examiner will tell you that the content of a memory location e.g. 1111 0000 is to be read
and then ask you to show contents of MAR and MDR during this read operation.
Two registers will be given to you, one for MAR and one for MDR.
Now you simply have to write the address which is to be read e.g. 1111 0000 in the MAR
register.
The content value given in the table at this address will be simply copied and written into
the MDR register.
Examiner will tell you that the value e.g. 1100 1100 is to be written into memory location
e.g. 0011 1111 and then again ask you to show contents of MAR and MDR during this
write operation.
Two registers will be given to you, one for MAR and one for MDR.
Now you simply have to write the value (content) which is to be written e.g. 1100 1100 in
the MDR register.
The memory location in which this value is to be written e.g. 0011 1111 will be simply
written in MAR register.
114
iv) In the end,
The examiner may ask you to state or show any changes to the memory following the
read and write operations.
In this case, just look at the table of memory sections. Look at the two addresses used in
both parts of questions. If you find any address has the value of its content missing, just
state that value over there which was given to you in any of the both parts depending upon
which parts content value is missing.
115
Exam Style Questions:
Q1. To process an instruction, a central processing unit (CPU) goes through a cycle that has
three main stages.
Name each stage in this cycle. (3)
Stage 1 = Fetch
Stage 2 = Decode
Stage 3 = Execute
Q2. The Von Neumann model for a computer system has several components that are used
in the fetch-execute cycle. One component is main memory.
Describe what is meant by main memory and how it is used in the Von Neumann model for
a computer system. (3)
Q3.
116
Answer:
Q4.
117
118
Answer:
119
May/June 2020 (12) Questions:
Q1.
Answer:
120
Q2.
Answer:
121