Chapter 15 Flashcards
"Hardware and Virtual Machines"
RISC (reduced instruction set computer)
assembly code is broken into a number of single cycle instructions
- fewer, simpler instructions
- few instruction formats
- fewer addressing modes
- single-cycle instructions
- fixed-length instructions
- easier to pipleine
- fewer addressing modes
- many registers (general purpose)
- hardwired CU
- more emphasis on software
CISC (complex instruction set computer)
aims to carry out a given task in as few lines of code possible
- more complex instructions
- many instruction formats
- multicycle instructions
- variable length instructions
- more addressing modes
- fewer registers (most processing is done in memory)
- microprogrammed control unit
- pipelining is more difficult (variable length)
- emphasis on hardware
hardwired control unit
uses logic circuits, e.g. flip flops
microprogrammed control unit
uses programs, code will compile, run and generate output
what is pipelining?
- allows several instructions to be processed simultaneously
- therefore increasing the number of instructions completed per unit time
- each stage of instruction is completed during one clock cycle
- when the first stage of 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 several instructions can be done simultaneously
pipelining during the fetch-execute cycle in RISC processors
- Instructions are divided into subtasks / 5 stages
- … Instruction fetch / IF, Instruction decode / ID, operand fetch / OF, opcode/instruction execute IE, result store / write back result / WB
- Each subtask is completed during one clock cycle
- No two instructions can execute their same stage at the same clock cycle
- The second instruction begins in the second clock cycle, while the first instruction has moved on to its second subtask.
- The third instruction begins in the third clock cycle while the first and second instructions move on to their second and third subtasks, respectively, etc.
interrupt handling with pipelining
when an interrupt occurs:
option 1: erase the pipeline
option 2: construct individual units in processor with individual program counters. this allows current data to be stored for all instructions in pipeline while interrupt is handled.
SISD
single instruction single data
processor executes one set of instructions on one data set
only one processor
commonly used among early personal computers
no ability for parallel processing
SIMD
single instruction multiple data
- many processors execute the same instruction using different data sets
- has several ALUs
- each ALU executes the same instruction on different data sets at the same time
used in sound sampling
MISD
multiple instruction single data
several processors
* many processors execute different instructions on the same data set at the same time
not commercially used
MIMD
multiple instruction multiple data
* several processors
* many processors executing different instructions on different data sets
used in most modern personal systems
uses parallel processing
massively parallel computers
- large number of processors, usually within the same computer
- working collaboratively and simultaneously on the same program
- communicating via message interface
- network infrastructure
hardware issue in massively parallel computers and cluster computing (they are not the same though)
- processors need to be able to communicate
- so that processed data can be transferred
- from one processor to another
- so it’s a very challenging topology
software issue in massively parallel computers
appropriate programming language should be used
which allows data to be processed by multiple processors simultaneously
cluster computing
large number of computers/PCs are linked/networked together.
each computer’s processor forms part of a larger pseudo-parallel system, acting as a supercomputer.
characteristics of massively parallel computers
- large number of processors
- collaborative and simultaneous processing
- network infrastructure
- communicate by sending messages
virtual machines
software that emulates a different computer system
allows the guest OS to operate on the computer’s hardware through the host OS
- use of software to implement a hardware set-up emulating another machine.
- a process would interact with a software interface provided by the operating system.
- kernel of VM OS interacts with host hardware.
- software interface provides an exact copy of hardware.
tasks of a virtual machine
- creates and manages VM (file retrieval, allow user to interact),
- hardware emulation - existing hardware is made available to guest OS
- protect VM from the actions of another
requesting a file using a virtual machine
- process sends request to VM operating system
- guest OS handles request as if it were running on its own physical machine (not aware).
- the I/O request is translated by the VM software, instructions are executed by host OS.
- host os retrieves data from file and gives it to the vm software.
- vm software passes the data to the guest OS and guest OS passes data to the application
role of virtual machine software in the testing of an app
- can create and manage a virtual machine
- translate instructions used by guest OS to what is required by host OS
- emulates hardware
- protects each VM so instances of the app can be tested together
applications of a virtual machine
software development
allow running of legacy applications
advantages of a virtual machine
- a virtual machine can crash without affecting the host machine
- provides protection to host OS and software from malfunction and viruses
- different instruction set architectures can be emulated on a single computer
- cost savings due to not needing to purchase extra hardware
- multiple VMs can be used on the same computer
- can run legacy applications
- not always in mark scheme/applicable - useful to programmers in development to test software/code.
disadvantages of a virtual machine
- costly and complex to implement and manage
- VM has poorer performance due to extra load on the host computer.
- performance of the guest system cannot be adequately measured
- VM may be affected by any weaknesses of the host machine
- not possible to emulate some hardware
half adder
fundamental operation in computing binary addition.
two inputs and two outputs:
sum = A XOR B
carry = A AND B