1.3.2 Computer Architecture Workbook by Inqilab Patel
1.3.2 Computer Architecture Workbook by Inqilab Patel
Assessment at a glance
Components Weighting
Paper 1 Theory 1 hour 45 minutes 60%
This written paper contains short-answer and structured questions. All
questions are compulsory.
No calculators are permitted in this paper. 75 marks
Externally assessed.
Paper 2 Problem-solving and Programming 1 hour 45 minutes 40%
This written paper contains short-answer and structured questions. All
questions are compulsory. 20 of the marks for this paper are from questions
set on the pre-release material. 1
No calculators are permitted in this paper. 50 marks
Externally assessed.
Page | 3
About the developer of this workbook
Inqilab Patel is an O &A Level Computer Teacher. He has taught in many schools
including Yaqeen Model School, Karachi Cadet School, KN Academy, Beacon House
and The City School, PAF Chapter, Nakhlah Boys Campus Society and Hexis A
Level. Cambridge has selected him as a Member of Cambridge Editorial Review
Board. He is also associated with Aga Khan University Examination Board in the
capacity of Chief Examiner, Item Writer, E-Marker, Karachi Board of Secondary
Education the capacity of Deputy Head Examiner and Sindh Board of Technical
Education.
His entire career path revolves around computer science; either he was a student or a
teacher. He got a chance to polish his skills of teaching and studying more about
computers at various levels which has given him great confidence in presenting
himself for any senior level position of transferring his knowledge to the youth.
He has not stopped, he is continuing with his education at the higher levels. It is his
second semester of MPhil computer studies from a well-known university of Pakistan;
The Institute of Business & Technology.
Inqilab Patel knows a lot of methods of teaching computers and has developed tutorial
notes, worksheets and assignments for my students. He also maintains a website
(www.ruknuddin.com) which is specifically designed for the support of those who want
to excel in GCSE computer science. He also regularly contributes material to CIE
teacher support website, for which he receives appreciation from different people
across the world.
He has also received various training in innovative and special methods of teaching
this subject.
Page | 4
Disclaimer
This workbook is developed by combining different materials related to Cambridge
IGCSE & O Level Computer Science 0478 & 2210. It is combination of work
developed by me and the resources, which are available in different web sites, books,
magazines, past papers and guides, just to facilitate students and teachers in
preparation for examinations.
Examination questions and marking schemes used in this workbook are taken from
CIE (Cambridge International Examinations)
Note
Study of at least one of the following books, is compulsory for solving this workbook.
Page | 5
Paper 1
Theory of Computer Science
Page | 6
Chapter 4
Computer Architecture
1.3.2 Computer architecture and the fetch-execute cycle
Have Revised
Have Read
To Revise
Learning Outcome
Prepared
To Read
Courtesy to http://web.eecs.utk.edu/research/cs100modules/module1/index.html
http://inqilabpatel.com/fetchexecute.html
a) Program Counter (PC) - an incrementing counter that keeps track of the next memory
address of the instruction that is to be executed once the execution of the current
instruction is completed.
b) Memory Address Register (MAR) - the address in main memory that is currently being
read or written
c) Memory Buffer/Data Register (MBR/MBR) - a two-way register that holds data fetched
from memory (and ready for the CPU to process) or data waiting to be stored in memory
d) Current Instruction register (CIR) - a temporary holding ground for the instruction that
has just been fetched from memory
e) Accumulator Register (ACC)is used for storing data for ALU to process and the results
those are produced by the ALU.
Buses: ''The set of wires used to travel signals to and from CPU and different components
of computer is called Bus.''
Bus is a group of parallel wires that is used as a communication path. As a wire
transmits a single bit so 8-bits bus can transfer 8 bits (1 byte) at a time and 16-bits bus can
transfer 16 bits (2 bytes) and so on. There are three types of buses according to three types
of signals, these are:
a) Data Bus: ''The buses which are used to transmit data between CPU, memory and
peripherals are called Data Bus.''
b) Address Bus: ''The buses which are connecting the CPU with main memory and used
to identify particular locations (address) in main memory where data is stored are called
Address Buses.''
Page | 10
c) Control Bus: The wires which are used to transmit the control signals (instructions)
generated by Control Unit to the relevant component of the computer.
Example Question
Q 4.1)(a) One of the key features of von Neumann computer architecture is the use of
buses.
When that instruction is done, the cycle starts all over again with the next instruction.
Registers/circuits involved
Program Counter (PC) - an incrementing counter that keeps track of the next
memory address of the instruction that is to be executed once the execution of the
current instruction is completed.
Memory Address Register (MAR) - the address in main memory that is currently
being read or written
Memory Buffer Register (MBR) - a two-way register that holds data fetched from
memory (and ready for the CPU to process) or data waiting to be stored in memory
Current Instruction register (CIR) - a temporary holding ground for the instruction
that has just been fetched from memory
Page | 12
Accumulator Register (ACC)is used for storing data for ALU to process and the
results those are produced by the ALU.
Control Unit (CU) - decodes the program instruction in the CIR, selecting machine
resources such as a data source register and a particular arithmetic operation, and
coordinates activation of those resources
Arithmetic logic unit (ALU) - performs mathematical and logical operations
Q 4.3 (a) Explain how the width of the data bus and system clock speed affect the
performance of a computer system.
Width of the data bus
........................................................................................................................
Clock speed
............................................................................................................................[3]
(b) The table shows six stages in the von Neumann fetch-execute cycle.
Put the stages into the correct sequence by writing the numbers 1 to 6 in the right hand
column. [6]
Sequence
Description of stage
number
the instruction is copied from the Memory Data Register (MDR) and placed
in the Current Instruction Register (CIR)
the instruction is executed
the instruction is decoded
the address contained in the Program Counter (PC) is copied to the
Memory Address Register (MAR)
the value in the Program Counter (PC) is incremented so that it points to
the next instruction to be fetched
the instruction is copied from the memory location contained in the Memory
Address Register (MAR) and is placed in the Memory Data Register (MDR)
Marking Scheme
Width of the data bus
the width of the data bus determines the number of bits that can be simultaneously
transferred
increasing the width of the data bus increases the number of bits/amount of data that
can be moved at one time (or equivalent)
Page | 13
hence improving processing speed as fewer transfers are needed
By example: e.g. double the width of the data bus moves 2x data per clock pulse
Clock speed
determines the number of cycles the CPU can execute per second
increasing clock speed increases the number of operations/number of fetch-execute
cycles that can be carried out per unit of time
however, there is a limit on clock speed because the heat generated by higher clock
speeds cannot be removed fast enough
Register notation
To describe the cycle we can use register notation. This is a very simple way of noting all
the steps involved. In all cases brackets e.g. [PC], means that the contents of the thing
inside the brackets are loaded. In the case of the first line, the contents of the program
counter are loaded into the Memory Address Register.
MAR [PC]
MBR [Memory] ; PC [PC] +1 (Increment the PC for next cycle at the same time)
CIR [MBR]
CIR sends instruction to Decoder of control unit
Decoder decodes
Or ACC [MBR]
ACC sends data to ALU
ALU executes
Detailed description of Fetch-Decode-Execute Cycle
To better understand what is going on at each stage we'll now look at a detailed description:
The contents of the Program Counter, the address of the next instruction to be executed, is
placed into the Memory Address Register
Page | 14
The address is sent from the MAR along the address bus to the Main Memory. The
instruction at that address is found and returned along the data bus to the Memory Buffer
Register. At the same time the contents of the Program Counter is increased by 1, to
reference the next instruction to be executed.
The MBR loads the Current Instruction Register with the instruction to be decoded by
decoder of control unit or the MBR loads Accumulator with the data to be executed.
Practice Questions
Q 4.5) Describe what differs a computer with a calculator
.... .............. ................................................................................................................
.................................. ............................................................................................ [1]
Q 4.6) Differentiate an ALU with a calculator.
.... .............. ................................................................................................................
.................................. ............................................................................................ [1]
Q 4.7) Von Neumann gave the idea how computer should be built.
a) Describe the purpose of each of the following parts of a processor:
(i) Control unit
.... .............. ................................................................................................................
.................................. ............................................................................................ [1]
(iii) Register
.... .............. ................................................................................................................
.................................. ............................................................................................ [1]
Q 4.8) Draw the diagram and describe the stages of fetch-execute cycle.
.....................................................................................................................................
……………………….............................................................................................. [1]
Page | 19
Q 4.13) One of the buses found in a typical microprocessor architecture is the control bus.
Describe its purpose.
.....................................................................................................................................
……………………….............................................................................................. [1]
Q 4.14) (i) One of the buses found in a typical microprocessor architecture is the control
bus. Describe its purpose.
.....................................................................................................................................
………………………......................................................................................................
Give one example of a control signal used.
.............................................................................................................[2]
(ii) Name and describe two other buses used in a typical microprocessor architecture.
1 .....................................................................................................................................
2 .................................................................................................................................[4]
Q 4.15) The steps in the fetch stage of the fetch-execute cycle are shown in the first
column using register transfer notation.
(i) Describe what happens at each stage of the fetch cycle. [4]
Register transfer
Description
notation
..............................................................................
MAR [PC]
..............................................................................
..............................................................................
PC [PC] + 1
.............................................................................
..............................................................................
MDR [[MAR]]
.............................................................................
..............................................................................
CIR [MDR]
..............................................................................
Page | 20
(ii) The contents of some special-purpose registers change as the program is executed.
Complete the trace table for the fetching of the first program instruction (867A):
• Show how the contents of the registers change.
• Put a tick in the address bus and/or data bus column to show when there is a signal
change on each bus.[5]
Special purpose registers
Buses
(Contents shown in hex)
Fetch stage
Address Data
PC MAR MDR CIR
bus bus
58
MAR [PC]
PC [PC] + 1
MDR [[MAR]]
CIR [MDR]
Q 4.16) The trace table below is used to show how the contents of the special-purpose
registers change as the program is executed.
The steps in the fetch stage of the fetch-execute cycle are shown in the first column using
register transfer notation. Complete the trace table for the fetching of the first program
instruction (2150):
• Show the changing contents of the registers
• Put a tick in the Address bus/Data bus column to show when the signals on
that bus change. [5]
Special purpose registers
Buses
(Contents shown in hex)
Fetch-execute stage
Address Data
PC MAR MDR CIR
bus bus
7A
MAR [PC]
PC [PC] + 1
MDR [[MAR]]
CIR [MDR]
Page | 21
(b) The following table is to show the steps in the fetch stage of the fetch-execute cycle.
Complete the table. [4]
Fetch-execute stage Description
The contents of the Program Counter are copied to the Memory
...............................
Address Register.
...........................................................................................
PC [PC] + 1
……...................................................................................
The Memory Address Register contains an address. Copy the
...............................
contents of this address to the Memory Data Register.
...........................................................................................
CIR [MDR]
...........................................................................................
Q 4.17) The following text includes a description of four stages of the fetch-execute cycle.
Use the terms below to complete the text:
Memory Data Register (MDR), Memory Address Register (MAR), Program Counter
(PC), Current Instruction Register(CIR), address, data bus, main memory,
address bus.
The program instructions are stored in a continuous block of .................. .
The Program Counter stores the ........................................ of the next instruction to be
fetched. Stage 1: The contents of the Program Counter are copied to the
........................................... .Stage 2 The contents of the .................................. are then
incremented. Stage 3 The value in the Memory Address Register is loaded to
the................................... .The data value found at this address is loaded on to
the.................................... and copied to the ........................................... .Stage 4 The
contents of the Memory Data Register are copied to the............................... and. The
instruction can now be decoded and executed. [6]
Page | 22
Topical Questions from Past Papers
Q 4.1) Summer 2015 P11
7 (a) One of the key features of von Neumann computer architecture is the use of buses.
Three buses and three descriptions are shown below.
Draw a line to connect each bus to its correct description.
This bus carries signals used to
Address bus coordinate the computer‟s activities
Data bus
This uni-directional bus carries signals
relating to memory addresses between
processor and memory
(b) 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.
Stage Sequence
number
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 instruction is finally decoded and is then executed
the PC (program counter) contains the address of the next instruction to 1
be fetched
the entire instruction is then copied from the MDR (memory data
register) and placed in the CIR (current instruction register)
the address contained in the PC (program counter) is copied to the
MAR (memory address register) via the address bus
the address part of the instruction, if any, is placed in the MAR (memory
address register)
the value in the PC (program counter) is then incremented so that it
points to the next instruction to be fetched
Page | 23
Examiner’s Comments on Question 7 (a) and (b)
Part (a) was answered very well with most candidates able to gain two marks.
In part (b) very few candidates gained full marks despite the range of responses they could have given.
Most candidates demonstrated a need to improve their knowledge of the fetch-execute cycle. Many
candidates gained just one mark for the incrementation of the program counter. Some candidates gained
three marks for identifying some correct stages.
Q 4.2) Winter 2015 P13
3 A section of computer memory is shown below:
Address Content
1000 0000 0110 1110
1000 0001 0101 0001
1000 0010 1000 1101
1000 0011 1000 1100
`
1000 1100
1000 1101
1000 1110
1000 1111
(a) (i) The contents of memory location 1000 0001 are to be read.
Show the contents of the Memory Address Register (MAR) and the Memory Data Register
(MDR) during this read operation: [2]
MAR
MDR
(ii) The value 0111 1001 is to be written into memory location 1000 1110.
Show the contents of the MAR and MDR during this write operation: [2]
MAR
MDR
Page | 24
(iii) Show any changes to the computer memory following the read and write operations in
part (a)(i) and part (a)(ii). [1]
Address Content
1000 0000 0110 1110
1000 0001 0101 0001
1000 0010 1000 1101
1000 0011 1000 1100
`
1000 1100
1000 1101
1000 1110
1000 1111
(b) Name three other registers used in computers.
1 .........................................................................................................................................
2 .........................................................................................................................................
3 ................................................................................................................................... [3]
(c) The control unit is part of a computer system.
What is the function of the control
unit?..........................................................................................................................................
..................................................................................................................................................
..................................................................................................................................................
.............................................................................................................................
....................................................................................................................................... [3]
Examiners’ Comments Question 3 (a), (b) and (c)
In part (a) some candidates were able to recognise and select the correct address and contents. Candidate need to make
sure they read the whole question before answering as some had not noted the correct memory location provided in the
question. Some candidates were able to provide the correct contents of the second set of registers, but some candidates
did not manage to recognise how a section of memory worked and could not provide a correct answer to the question.
In part (b) some candidates could provide three correct registers, but many could only provide one or two.
In part (c) many candidates demonstrated limited knowledge of the workings of the control unit. Most were vague in
their description and needed specific detail about how the unit operates.
Page | 25
Buses
1 ..........................................................................................................................................
..........................................................................................................................................
2: .........................................................................................................................................
........................................................................................................................................[4]
Examiners’ Comments Question 3(a) and (b)
In part (a) most candidates were able to correctly identify that cookies detect if a viewer has previously viewed a
webpage. Some candidates incorrectly thought that cookies generate website pop ups.
In part (b) many candidates were able to provide at least one correct register and one correct bus.
Page | 26
Examiner Report
The full range of marks was seen from candidates in this question on terms and descriptions. Some
candidates only connected a single line from each computer term. The question stated to draw lines,
candidates should note this type of question means that there may be more than one line that can be drawn to
connect terms to description. If a question states to draw a line, this is when only a single line should be drawn
from each term to a description.
Page | 27
Examiner Comment on Q 1
Many candidates provided three correct busses. The most common incorrect answer was candidates providing fetch, decode and
execute, which demonstrated a misunderstanding of the question.
.......................................................................................................................................[1]
(ii) State the data that will be placed in the memory data register (MDR).
.......................................................................................................................................[1]
(b) Describe the stored program concept when applied to the Von Neumann model.
..................................................................................................................................................
..................................................................................................................................................
..................................................................................................................................................
..................................................................................................................................................
..................................................................................................................................................
..................................................................................................................................................
..................................................................................................................................................
............................................................................................................................................[4]
Comments on Question 10
(a) (i) and (ii) Most candidates provided a correct response and demonstrated an excellent
level of understanding.
(b) This question appeared to be very challenging for candidates. Many candidates
described the fetch execute cycle. It would be helpful if candidates understood that the
stored program concept is a specific infrastructure for the central processing unit and not
the fetch execute cycle. It would be encouraging to see candidates demonstrate a more
confident level of knowledge of the stored program concept.
Page | 31
Marking Schemes
Q 4.1) Summer 2015 P11