1/99
For now it's gonna be for Dec 10th
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
What is a Computer?
An electronic device that takes input, processes data & delivers output
What is a program?
A set of instructions that the computer follows to process data
What does a CPU do?
Carries out instructions and stores the program in the memory
What are factors that affect performance of a computer? (3 marks)
Clock Speed, Number of Cores, Cache Size
What is clock speed?
The rate the processors sends electronic pulses to synchronize the CPU’s operations, measured in Hz
What does GHz mean? How many clock cycles per second?
Gigahertz, One Billion clock cycles per second.
What is the Cache?
Temporary storage of data & instructions being read & written from
What does the Cache do?
Stores copies of recent data & instructions. Much quicker to access than Main Memory.
What is a Core?
100% copy of a CPU.
What does a core contain?
Processing units, ALU, Accumulator, CU
What are disadvantages to cores?
They need to communicate with each other which takes time
Many programs are not designed to make use of multiple cores
What are properties of Von Neumann Architecture?
Shared memory space for instructions & data
Instructions & data are stored in the same format
A single CU or processor follow a linear FDE Cycle
One instruction at a time
Registers are used as fast access to instructions & data
What are properties of Harvard Architecture?
Instruction & data stored in seperate memory
Each has it’s own bus
Reading & Writing data can be done at the same time as fetching an instruction
Used by RISC processors
What does the Control Unit?
Decodes instructions
Sends signals to control how data moves around the CPU
What is a register?
Tiny areas of extremely fast memory located in the CPU
Enables FDE Cycle to operate
Designed for a specific purpose, where data or info is stored temporarily
What does the Current Instruction Register do?
Stores the address of the instruction currently being decoded or executed.
What does the Program counter do?
Holds the address of the next instruction
The value here is passed to the MAR
What can cause the value in the PC to change?
A jump instruction will cause it to the change the value it stores
What does the Memory Address Register do?
Holds the address of an instruction passed from the program counter
Holds the address of the data to be sent to the Memory Data register
What does the Memory Data Register do?
Holds data to be fetched from or to the memory or CPU
What does the Arithmetic Logic Unit do?
It performs calculations
Handles Bit Shifting
Manipulates data
Handles logical comparisons allowing a program to make decisions
What does the Accumulator do?
Holds the results of calculations
What are Buses?
Tiny wires that connect the internal components of a computer system.
Tiny wires that transfers binary between components
What is the Control Bus?
Set of wires that carry control signals to and from the processor and components of a computer
What is a Data Bus?
Set of wires that carry data to and from other components
What is an Address Bus?
Set of wires that carry the address of an instruction or data from cpu that’s read/written to the memory unit
What is Simple Instruction Multiple Data
Parallel processing is where a processor carries out a single instruction on multiple data items at the same time - often used by graphic processor
What is Multiple Instruction Multiple Data?
Multiple instructions are carried on multiple data items across several cores
What does Complex Instruction Set Computer do?
Aims to complete the task in a few lines of assembly as possible - this means the processor hardware & circuitry has to be more complicated so it can understand & execute a series of operations
CISC PROPERTIES
When executed, this instruction would load the 2 values into the register, multiply them together & store the result back out
MULT is an exmaple of a COMPLEX instruction
Complex Instructions might take more than one machine/clock cycle to execute
They’re found in desktops, computers & laptops
What does Reduced Instruction Set Computer do?
Aims to use simple instructions that’ll be executed within a single machine/clock cycle
RISC PROPERTIES
More RAM needed to store the assembly instructions. The process seems less efficient. Compiler has to do more work
However, each instruction can be completed in a single clock cycle.
Have fewer transistors
Less complex hardware = No room for general purpose registers & cache
They’re found in low-power portable devices: Smart TVs, thermostats, smart watches, smartphones, tablets, printers
Differences between CISC and RISC
Used in laptops/desktops in x86 processors made by Intel & AMD
Used in smartphones, tablets, embedded systems. Made by ARM
Has more complex hardware
Has more simple hardware
Large num of complex instruction of variable lengths
Smaller number of simple, standard instructions that are fixed length
Great energy requirements
Lower energy requirements
Doesn’t support pipelining
Suports pipelining
Compiler (software) does less work.
Compiler has to do more work
Small code size, Higher cycles per second
Large code size, Lower Cycles per second
Makes more efficent use of Ram
Multiple addressing modes usable
Heavy use of RAM (can cause bottlenecks if RAM is limited)
Fewer addressing modes available
What is a parallel system?
When a computer has multiple cores
Each core works on the same task, to complete it more quickly or each core can work on seperate tasks simultaneously
What do Multi-core Systems have?
It has more than one processing unit in a single processor which can independently process instructions at the same time
What are benefits to using Multi-core Systems?
Multitasking
Each core can work on a different task - this is particularly effective when the user has multiple applications open at the same time
Background tasks
When using a single core processor, a background task like anti-malware scans can slow down the user's other task. A multi-core processor can assign the background task to one core, to reduce the impact on the other task
Improved responsiveness
If a program becomes unresponsive, it won’t slow the user's computer down as much if they're using multi-core as other cores will continue running their task
What are limitations to Multi-core Systems?
Limit on Max Speed: If a program can’t be parallelised, then there’ll be a cap on the max speed a multicore system can give.
Complex code: Harder to write code for parallel processing. Tasks have to be synchronised and data shared correctly.
Limited appliances: Not all tasks can run in parallel and must be executed serially
What is an Input Device?
Peripheral device that allows data to enter a computer system
What is an output device?
Peripheral Device that translates signals from the computer into a human-readable form
They enable the computer to communicate the results of data or commands
Examples of Input Devices
Keyboard, Mouse, Touchscreen, Microphone, Joystick
Examples of Output Devices
Monitor, Printer, Speakers, Headphones, Projector
Properties of ROM
Stores BIOS or firmware used to start computer & initialise the hardware components
Non-volatile: Keeps contents when computer is turned off. Can be read but not written to or modified.
Loads the Operating System
Properties of RAM
Stores data that is currently being used by the computer such as open apps and files.
Volatile: Loses all contents when computer is turned off.
Directly accessible = Processor can access any part of it equally as fast.
What is Virtual Storage?
Storing & retrieving data over the internet in the cloud instead of a local storage device
Advantages to Virtual Storage
Data can be accessed from any device at any time as long as there’s internet
Data can easily be shared without the need for media transfer
Storage is considered “limitless”
Disadvantages to Virtual Storage
Can become quite expensive
If connectivity is poor, access times can be slow
No internet connection = No access to files
What is secondary storage?
A non-volatile storage that is used for the permanent collection of programs, data and instructions.
What do you consider when purchasing a Secondary Storage device?
Cost, Portability, Capacity, Performance needs
Optical Storage
Data is stored as pits and lands
Read by a laser
Stores data by burning pits via laser into surface of a disc
Advantages of Optical Storage
Durable (Especially to environmental phenomena)
Portable
Suitable for sharing music or movies
Disadvantages of Optical Storage
Low storage capacity
Slower read/write speeds
Easily scratched or damaged.
Magnetic Storage
Stores data via polarised metal
Polarity used to represent a 0 or 1
Advantages of Magnetic Storage
High storage capacity
Low cost per gigabyte
Disadvantages of Magnetic Storage
Moving Parts that can wear out overtime
Slower read/write than Flash Memory
Suspect to Physical Damage
Not Portable
Makes Noise
Flash Storage
Stores data in flash memory cells by removing or trapping electron in a floating gate transistor
Advantages of Flash Storage
Fast read/write speeds
No moving parts so less likely to fail due to physical shock
Silent
Disadvantages of Flash Storage
High cost per GB
Wears out after certain num of read/write cycles
What is a multicore processor
A single chip containin 2 or more duplicate CPUs, each can FDE instructions
What is parallel processing?
The processing of program instructions by diving them between multiple processors or proessor cores
How is parallel processing achieved?
Processing Cores carrying out a single job split into tasks, with each task able to execute on any unit.
The main processing core fetches & decodes an instruction & then farms off various parts of the program to other processing units
Advantages of Parallel Processing
Problems which are large and complex can be solved more easily
If a task can be divided into subtasks that can be executed simultaneously, the total execution time can be reduced
Parallel processing allows for better use of computer resources as multi-core or multiple processors can be used more effectively
Disadvantages of Parallel Processing
Not all tasks can be run in parallel and must be executed serially
It is more difficult to debug a parallel program than a serial program due to the precise timing of specific events
Limit to the maximum speed improvement that can be made using parallel processing if a part of the program can’t be parallelised
What does the Operating System do?
Provides the interface between the user & the hardware
Managing the hardware and software resources of a computing system
What does the Application Software do?
User doesn’t interact directly with hardware but they use this such as word processors, spreadsheets or graphic programs to accomplish a given task. OS provides a platform on which that Application Software can run
What does the User Interface do?
Allows the users to interact with the computer & hardware
(GUI, Command Line Interface)
What does Resource Management do?
Manage the computer's resources, including the CPU, memory, disk drives, and printers
They allocate resources to specific tasks and ensure that they are used effectively
What does File Management do?
Manages the storage, retrieval, and manipulation of data files
Security in an Operating System
Operating systems provide various security features such as password-protected system accounts, a firewall, virus scanning and file encryption
Providing Utilities in an Operating System
Utility programs help with system maintenance and security
Some utility programs include: file encryption, file compression, disk defragmentation, system backup, disk cleanup
What is Paging?
Paging is a method of chunking the primary memory into equal-sized blocks
Data stored in memory will lead to the smooth running of applications
When an application is launched, data will be moved from the hard disk into Pages for faster access
As users move between applications, memory is dynamically allocated
Pages will be taken away from applications not in active use and granted to applications that are in active use
What is Segmentation?
Segmentation is a method of chunking memory into blocks that correspond to different types of data needed by an application
Segments are not all the same size; they are sized depending on their allocated data
Segmentation is space-efficient due to only allocating space depending on the amount an application needs
What is Virtual Memory?
If a computer is running low on primary memory, it can make secondary storage act as an 'extension' of the main memory
Virtual memory creates an illusion of a larger memory and enables applications to continue to multitask
However, accessing data in virtual memory is considerably slower compared to RAM
What is an Interrupt?
A signal to the processor that stops its current task and performs a different task temporarily
When an interrupt occurs, the processor suspends the current program execution and transfers control to an interrupt service routine
What is the purpose of an Interrupt?
Real-time Event Handling: hardware errors and signals from input devices e.g. hard disk failure
Device Communication: alerts from external devices e.g. printer jams and network errors
Multitasking: suspending processing in one application so that the user can switch to another
What’s the process of an interrupt?
Interrupt Request (IRQ)
An external device or software generates an interrupt, signalling the processor to stop its current task
The interrupt controller passes this to the interrupt handler for assessment
Interrupt Acknowledge
The interrupt handler decides if the interrupt needs to be dealt with now or later
If yes, the current contents of the processor registers are saved in memory
Interrupt Service Routine (ISR) Lookup
The processor fetches the corresponding Interrupt Service Routine (ISR) associated with the interrupt type
ISR Execution
The processor transfers control to the ISR and executes the routine to handle the specific interrupt
Interrupt Exit
After the ISR completes, the processor restores the content of the registers from step 2
The fetch-decode-execute cycle is resumed
What is scheduling?
Deciding which tasks to process, for how long, and in what order is achieved through scheduling algorithms
A CPU is responsible for processing tasks as fast as possible
Different algorithms are used to prioritise and process tasks that need CPU time
What is pre-emptive scheduling?
Allocates the CPU for a specific time quantum to a process
Allows interruption of processes currently being handled
It can result in low-priority processes being neglected if high-priority processes arrive frequently
What is Non-Pre-emptive scheduling?
Once the CPU is allocated to a process, the process holds it until it completes its burst time or switches to a 'waiting' state
A process cannot be interrupted unless it completes or its burst time is reached
If a process with a long burst time is running, shorter processes will be neglected
What is Round-Robin?
Pre-Emptive Scheduling Algorithm
Equally distributing processor time amongst all processes
Each process is given a time quantum to execute
Processes that are ready to be worked on get queued
If a process hasn’t been completed by the end of its time quantum, it will be moved to the back of the queue
Advantages to Round Robin?
All processes get a fair share of the CPU
Good for time-sharing systems
Predictable, as every process gets equal time
Disadvantages to Round Robin
Choosing the right time quantum can be difficult
This can lead to a high turnaround time and waiting time for long processes
What is First Come First Served?
Non-Pre-Emptive Scheduling Algorithm
Prioritises processes that arrive at the queue first
The process currently being worked on will block all other processes until it is complete
All new tasks join the back of the queue
Advantages to First Come First Served
Simple and easy to understand
Fair in the sense that processes are served in the order they arrive
Disadvantages to First Come First Served
This can lead to poor performance if a long process arrives before shorter processes
High-priority tasks wait for their turn in the queue
What is Shortest Job First?
Non-Pre-Emptive Scheduling Algorithm
Where all processes are continuously sorted by burst time from shortest to longest
When new processes arrive on the queue, they are prioritised based on their burst time in the next cycle
Shorter jobs are placed at the front of the priority queue
Longer jobs have lower priority, so they are placed at the back
Advantages to Shortest Job First
Minimises waiting time
Efficient and fast for short processes
Disadvantages to Shortest Job First
Requires knowing the burst time of processes in advance
Long processes can starve if short processes keep arriving
What is Shortest Remaining Time?
Pre-emptive Scheduling Algorithm
Processes with the shortest remaining time are higher priority
Time quantum is set, and if a task doesn’t complete in time, it will be re-queued for further processing
Before the next cycle starts, all processes are inspected and ordered by the shortest remaining time to complete
Advantages for Shortest Remaining Time
Ideal for jobs that have shorter burst times
It is preemptive, so it can be aligned with CPU for best performance (time quantum)
Disadvantages for Shortest Remaining Time
Like SJF, it requires knowing the burst time of processes in advance
High context switching overhead due to preemption
What is Multi Level Feedback Queue
Pre-emptive Scheduling Scheduling Algorithm
Shorter and more critical tasks are processed first
Multiple queues are used so that tasks of equal size are grouped together
All processes will join the highest priority queue but will trickle down to lower priority queues if they exceed the time quantum
Advantages to Multi Level Feedback Queue
Smaller tasks are prioritised
Creates a prioritisation system where similar-sized tasks are queued together
Disadvantages to Multi Level Feedback Queue
More complex than other algorithms
Setting the correct parameters (e.g., number of queues, ageing rules) can be complex
What is a virtual machine?
A virtual machine (VM) is a software-driven computer that runs within a physical machine
It mimics a complete computer system, including virtual CPU, memory, storage, and network interface