Hardware and Virtual Machines
Hardware and Virtual Machines
1 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
Memory
2 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
Fix the amount of memory it will consume for example 16 bits, 4 bits
3 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
FEATURES OF CISC
1. CISC has more instructions
2. CISC has fewer registers: because most of the processing is done in memory
3. CISC instructions are more complex
4. CISC has many instruction format: One thing can be done in another format as
well
5. CISC uses multicycle instruction: One instruction breaks down in more
instruction
6. CISC uses variable length instruction
7. CISC has poor pipelinebility
8. CISC require more complex circuit : To deal with complex instruction
9. CISC has more addressing modes for example immediate, direct, indirect and
index
10. CISC makes less use of RAM
11. CISC has programmable control unit
4 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
5 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
FEATURES OF RISC
RISC has fewer instructions
RISC has many registers
RISC instructions are simpler
RISC has few instruction format
RISC usually uses single cycle instructions
RISC uses fixed length instructions
RISC has better pipelineability
RISC requires less complex circuit
RISC has fewer addressing modes
RISC makes more use of RAM
RISC has hardwired control unit
6 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
PIPELINING
It is a way of improving computer performance
Example
Lets assume that we are doing Laundry
1. One washer (takes 30 mins)
2. One drier (takes 40 mins )
3. One folder ( takes 20 mins )
7 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
PIPELINING
THE SLOW WAY
8 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
PIPELINING
LAUNDRY PIPELINING
9 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
PIPELINING
What is meant by pipelining ?
Pipelining is instruction level parallelism ( multiple operations are performed in
single cycle )
Execution of an instruction is split into number of stages
When first stage for an instruction is completed the first stage of the next
instruction can start executing
Another instruction can start executing before the previous one is finished
Processing of a number instructions can be done simultaneously
5 STAGES PROCESSOR
1. Fetch instruction
2. Decode instruction
3. Execute instruction
4. Access operand in memory
5. Write results to register
OPCODE: What do we need to do ( Decoded instruction)
OPERAND: What do we need to do it to (Data)
10 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
PIPELINING
Qtn: Given 4 instructions ABCD Demonstrate how the are handled with pipeline
and without pipeline with in a processor.
11 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
PIPELINING
WITH PIPELINING.
12 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
INTERRUPT
1. In pipelining there is one added complexity: As the interrupt is received, there
could be a number of instructions still in the pipeline.
2. The usual way to deal with this is to discard all instructions in the pipeline
except for the last instruction in the write back stage.
3. Then interrupt handler routine can then be applied to the remaining
instruction and they are serviced. The processor can restart with the next
instruction.
ALTERNATE METHOD
1. The content of five stages can be stored in register
2. Then the processor can be restored to its previous state once the interrupt has
been secured
13 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
PROCESSOR
Instruction
Data
Instruction Stream : Sequence of instructions executed by the processing unit
Data stream: Sequence of data or temporary result called by instruction stream
TERMINOLOGIES
14 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
DATA
PROCESSOR INSTRUCTION
SOURCE
15 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
Processor
Processor
Data Data
Source Processor Source
Processor
16 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
Processor
There are several processors
Each processor executes different sets of instruction on one
Set of data at the same time
17 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
Processor
There are several processors
Each processor executes a different sets of instruction.
Each processor operates on different set of data
18 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
19 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
20 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
21 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
22 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
23 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
Host operating system: The operating system that is actually controlling the
physical hardware or the operating system is running virtual machine software.
Note:
Guest OS is running under the host OS software
A virtual machine is a software that emulates a different computer system
A virtual machine allows multiple Guest operating systems to run on one
computer using a host operating system
24 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
APP TESTING
ROLE OD VIRTUAL MACHINE SOFTWARE IN TESTING OF AN APP
By virtual machine software you can create and manage virtual machine
Translate instructions used by guest operating system to that required by the host
OS
Emulates hardware
Protect each virtual machine so instances of the App can be tested together
25 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
VIRTUAL MACHINE
26 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
VIRTUAL MACHINE
Qtn: Describe the role of the four operating system in the diagram above
1. OS1, OS2, OS3 are guest operating systems secondary to the one installed on
the hardware
2. OS4 is the host operating system which interacts directly with the computer
hardware
3. The virtual machine app need to run all the three guest operating system with
identical results
Note: To identify host OS, look for the OS which is in direct contact with hardware
27 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
SOFTWARE PRODUCTION
Qtn: State the benefit of using VM to produce software
1. Software can be tried on different OS using same hardware
2. No need to purchase different types of hardware
3. Easier to recover if software causes system crash
4. Virtual Machine provides protection to other software
28 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
VIRTUAL MACHINE
Qtn: What happens if guest OS receives the data request from an application
Guest OS handles the request as if it were running on its own physical machine and
Guest OS is not aware that it is running on virtual machine.
29 Davis_Kazibwe@2023KIS
AS & A LEVEL COMPUTER SCIENCE 9618
VIRTUAL MACHINE
USES OF VIRTUAL MACHINE BY WEBSERVER COMPANY
1. Could be used as alternative OS to identify possible problems and it is much
easier to create a VM with a new operating system rather than creating a new
computer system
2. Provides a safe environment during testing which does not disrupt the web
server services
3. Can be used as an alternative replacement web-sever software to identify
possible problems in the web server on different OS
4. It is easier to try different webserver and OS combinations
30 Davis_Kazibwe@2023KIS