what is the function of the Arithmetic Logic Unit (ALU) ?
completes all arithmetic and logic functions
results are often stored in general-purpose registers (e.g. the ACC)
give three examples of operations the ALU performs.
arithmetic operations on fixed/floating point numbers (e.g. ADD, SUBTRACT, MULTIPLY or DIVIDE)
bitwise shift operations
boolean logic operations (e.g. comparisons, AND, OR, NOT or XOR)
what is the function of the Control Unit (CU) ?
coordinates all activities of the CPU
accepts and decodes instructions
sends memory read/write requests to RAM along the control bus
sends control signals
e.g bus requests/grants, or interrupt requests
makes extensive use of the status registers and clock
communicates with all elements of the CPU
define a register.
registers are small memory cells that operate at a very high speed, they are used to temporarily store data
what is the function of the Program Counter (PC) ?
holds the address of the next instruction to be executed
this could be:
the next instruction in a sequence
an address to jump to, if the previous instruction was to branch (copied from the CIR)
at the start of every FDE cycle, the instruction in the PC is copied to the MAR
what is the function of the Memory Data Register (MDR) ?
used to temporarily store data/instructions that are to be written to memory, or have been read from memory
contents of MDR are copied to the CIR (if MDR contains an instruction)
acts as a buffer
what is the function of the Memory Address Register (MAR) ?
holds the address of a memory location from which data or an instruction is to be fetched, or which data is to be written to
sends this address to memory down the address bus
where does the address in the MAR come from?
it is either the address of an instruction sent from PC…
or the address of data sent from CIR
what is the function of the accumulator (ACC) ?
data and control information often stored here
stores the results of operations performed in the ALU
describe two ways the accumulator is used.
temporary storage for data being processed during calculations
I/O in processor, used as a buffer
what is the function of the Current Instruction Register (CIR) ?
holds the current instruction being executed
contents of MDR are copied to the CIR (if MDR contains an instruction)
contains the opcode and operand(s) of the instruction
what is a bus?
buses are a set of parallel wires which connect two or more components inside the CPU
what does the ‘width‘ of a bus represent?
the width of the bus is the number of parallel wires the bus has:
the width of the bus is directly proportional to the number of bits that can be transferred simultaneously at any given time
buses are typically 8, 16, 32 or 64 wires wide
what is the function of the data bus?
a bi-directional bus that transports data and instructions (in binary) between components
what is the function of the address bus?
transmits memory addresses to RAM, specifying where data or instructions are to be sent to/retrieved from
what is the function of the control bus?
transmits control signals between internal/external components
coordinates the use of the address and data buses
provides status information between system components
what is a bus request?
a control signal that shows that a device is requesting the use of the data bus
what is a bus grant?
a control signal that shows that the CPU has granted access to the data bus
what is a memory write request?
a control signal that requests that data is written into the addressed location using the data bus
what is a memory read request?
a control signal that requests that data is read from a specific location to be placed onto the data bus
what is an interrupt request?
a control signal that shows that a device is requesting access to the CPU
what is the Fetch Decode Execute cycle?
the cycle that a CPU follows to process and execute a instruction
what occurs during the fetch stage?
address of the next instruction is copied from PC to MAR
contents of MAR are sent along the address bus to memory, where it waits to receive a signal from the control bus
the data/instruction held in the corresponding memory address is copied to MDR by the data bus
if MDR holds an instruction, its contents are copied to CIR
PC is incremented by 1
what occurs during the decode stage?
the instruction in CIR is split into opcode and operand
the instruction is decoded in the decode unit
what occurs during the execute stage?
the instruction is executed, for example…
performing arithmetic operations in the ALU
storing the contents of the accumulator in a memory address in RAM
what is clock-speed?
clock speed is the number of clock cycles completed per second
clock speed is determined by the system clock (an electronic device which generates signals, switching periodically between 0 and 1)
how does the clock regulate CPU operations?
all processor activities begin on a clock pulse, and each CPU operation starts as the clock changes from 0 to 1
how is clock-speed measured?
measured in GigaHertz (GHz)
one GHz is one billion instructions fetched per second
what is a core?
an independent processor that is able to run its own FDE cycle
give a reason why a multi-core processor may run faster than a single-core processor.
computers with multiple cores can execute multiple instructions/FDE cycles at the same time
give a reason why a multi-core processor may not run faster than a single-core processor.
some instructions may not be able to be run in parallel
an instruction may be dependent/waiting for other instructions to be completed
other factors influence processing speed (e.g. clock speed/ cache/bottlenecks)
a program/OS needs to be written to specifically use multiple cores
what is cache memory?
cache memory is located on or near the CPU
much faster to access than RAM
instructions fetched from main memory are copied to the cache, so if required again, they can be accessed quicker
as cache fills up, unused instructions are replaced
what is pipelining?
pipelining is the process of completing the FDE cycles of separate instructions simultaneously and holding appropriate data in a buffer in close proximity to the CPU until it’s required
it aims to reduce the amount of the CPU which is kept idle
it is separated into instruction pipelining and arithmetic pipelining
what is instruction pipelining?
separating out the instruction into fetching, decoding, and executing
what is arithmetic pipelining?
breaking down the arithmetic operations and overlapping them as they are performed
why can pipelining sometimes become inefficient?
pipelining is inefficient when programs contain lots of branching
as each time a program branches the processor will have to ‘flush the pipe’ and remove any instructions that would have been performed had the program not branched
describe harvard processor architecture.
instructions and data stored in separate memory units
each has its own bus
reading/writing data can be done at the same time as fetching an instruction
used in RISC processors
describe von neumann processor architecture?
shared memory space for data and instructions
built on the ‘stored program’ concept
instructions and data stored in the same format
a single control unit follows a linear FDE cycle
one instruction at a time
what are the advantages of von neumann architecture?
cheaper to develop, control unit is easier to design
programs can be optimised in size
what are the advantages of harvard architecture?
quicker execution as data and instructions can be fetched in parallel
memories can be different sizes, makes efficient use of space
what is CISC?
Complex Instruction Set Computing
a computer architecture that uses a large number of complex instructions with variable lengths
these instructions may require multiple machine/clock cycles to execute
what devices use CISC architecture?
used in laptops and desktop computers
why is CISC architecture more expensive that RISC?
requires larger and more complex circuitry
this requires more silicone to produce
therefore it is more expensive
what are some benefits of CISC architecture?
compiler has to do less work
small code sizes and higher cycles per second
makes more efficient use of RAM
multiple addressing modes available
what are some drawbacks of CISC architecture?
greater energy consumption
more expensive
can't support pipelining
what is RISC?
Reduced Instruction Set Computing
a computer architecture that uses a smaller number of simple, standardised instructions of a fixed length
single machine cycle per instruction
what devices use RISC architecture?
used in smartphones and embedded systems
what are some benefits of RISC architecture?
smaller and less complex circuitry so typically cheaper to produce
lower energy requirements
can support pipelining
what are some drawbacks of RISC architecture?
compiler has to do more work
larger code sizes, lower cycles per second
heavier use of RAM
risks bottlenecks if RAM is limited
fewer addressing modes available
what is a Graphics Processing Unit (GPU) ?
a type of co-processor which has lots of independent processors (stream processors) which work in parallel
this makes it very efficient at completing repetitive tasks such as image processing and machine learning
highly specialised
SIMD structure
what is a multi-core processor?
a single chip with multiple independent cores
these can process instructions separately
this results in higher performance
what is parallel processing?
the process of dividing instructions between multiple processors or processor cores, to be executed simultaneously
give an example of an input device
keyboards
webcams
magnetic stripe readers
barcode readers
give an example of an output device
speakers
printers
projectors
what factors affect the performance of an input or output device?
speed
accuracy
cost
relevance to task
how is data represented through optical storage?
read from and written to using lasers
binary information represented by portions of the disc which either reflect or scatter the incident laser light
a pit scatters light and represents a 0
a land reflects light and represents a 1
pits and lands are written in spiral tracks on the disc’s surface
what is a CD and what does it commonly store?
Compact Disc
use optical technology to store small quantities of information
most commonly used for audio files
can also be used to store text and digital images
what are the benefits of using a CD for storing data?
small, thin and light so very portable
what are the drawbacks of using a CD for storing data?
easily damaged by scratches
limited storage capacity
relatively slow transfer speeds
what is a DVD and what does it commonly store?
use optical technology to store information
has higher storage capacity than CDs
suited to storing digital videos
what is a Blu-Ray disc and what does it commonly store?
use optical technology to store information
more than five times as much storage than traditional DVDs
useful for storing high-resolution films
how is data represented through magnetic storage?
binary information is represent using two magnetic states: polarised and unpolarised
how is data stored on a Hard Disc Drive (HDD) ?
data is stored on magnetic platters
the HDD rotates these magnetic platters at high speeds under a read/write head on an actuating arm
most will have multiple platters stacked to maximise storage capacity
what are the benefits of using a HDD for storing data?
typically have high capacities of between 500GB and 5TB
cheapest (per GB) type of secondary storage
what are the drawbacks of using a HDD for storing data?
have somewhat slow data transfer speeds
many moving parts introduces tendency to be damaged by movement
what is magnetic tape?
popular storage medium through to the 1980s
long stretches of (magnetic) tape wound onto reels passed through readers
a space consuming way to store data
what is a floppy disc?
a thin magnetic disk enclosed in plastic to protect the disk from dust and dirt
thin size and low weight made them extremely portable
typical storage capacity of 1MB
how is data represented through flash storage?
logic gates used to store electrical charge in one of two states: high or low
silicon semiconductors form the logic gates NAND and NOR
NOR gate is used for storing small quantities of data
NAND is the preferred technology for larger files
information stored in blocks, combined to form pages
can be erased and reprogrammed electronically
what are the benefits of using an SSD for storing data?
extremely light and portable
no moving parts, so much more resistant to damage from movement than HDDs
renowned for high data transfer rates
what are the drawbacks of using an SSD for storing data?
primary drawback is cost
another drawback is limited lifespan:
when a page is written to, the voltage required increases..
over time, this will become too high
what is Random Access Memory (RAM)?
a fast, volatile main memory that stores data and instructions for programs that the computer is currently running
having more RAM speeds up the computer’s execution
higher access speeds than even flash memory
more expensive per gigabyte than secondary storage devices
computers often have only 4 - 8 GB of RAM
what is Read Only Memory (ROM)?
a non-volatile memory used for storing fixed sequences of instructions like a computer’s startup (bootstrap) routine
once programmed, the state of the memory cells inside does not change
what is virtual storage?
name given to storing information remotely so that it can be accessed by any computer with access to the same system (e.g. over the Internet)
often an abstraction of multiple drives acting like one
give an example of a virtual storage system?
cloud storage services
networked storage used in offices and schools
give a benefit to using virtual storage.
the data from multiple machines can be backed up at the same time
can be accessed from elsewhere/on other machines
storage can be expanded as necessary (no limit on size)
no on site maintenance required/allows more local storage capacity for data
give a drawback to using virtual storage.
limited by user’s network speed
high costs
unclear who is in possession of data
what is an operating system?
a collection of programs that work together to provide an interface between the user and computer
it enables the user to communicate with the computer and perform certain low-level tasks involving the management of computer memory and resources
name three features of an operating system.
memory management (paging, segmentation, virtual memory)
resource management (scheduling)
file management (moving, editing, deleting files and folders)
input/output management (device drivers)
interrupt management
utility software (disk defragmenter, backup, formatting etc.)
security (firewall)
user interface
why do computers need memory management?
RAM is often not large enough to store all of the programs being used
if RAM is unavailable or full, applications cannot be loaded
memory management is used by the OS to ensure RAM is shared effectively by programs
it removes data not needed anymore, frees up space and allocates memory to applications (through the use of paging, segmentation and virtual memory)
what is paging?
a memory management process where memory is split up into equal-sized sections known as pages
pages are physical divisions
programs are split to fit a given number of pages
pages are swapped between RAM and the hard disk as needed
what is segmentation?
a memory management process where memory is split up into logical divisions, called segments
segments are complete sections of a program such as if statements or loops
segments vary in size
segments represent the structure and logical flow of the program
name 3 differences between paging and segmentation.
pages is physical divisions, segments are logical divisions
pages are fixed size, segments can vary in size
paging causes internal fragmentation , segmentation causes external fragmentation
a page table is used to map page location which is slower than a segmentation table
its easier for the OS to manage page locations as they can be stored non-contiguously, segments can be non-contiguous but work better contiguously
paging can be more effective because any free memory space can be used to swap data in and out, with segments lots of space will sit unused until a segment the right size is available
what is virtual memory?
a process where a section of the hard drive acts as RAM when the space in main memory is insufficient to store programs being used
sections of programs not currently being used are temporarily moved into virtual memory through paging
this frees up memory for other programs in RAM
RAM is much more expensive than secondary storage (per GB) so virtual memory is useful rather than having to buy more RAM
*note, the exam will not accept VRAM in place of virtual memory
what are the drawbacks of using virtual memory?
slower to access than RAM as pages have to be swapped back to RAM to be accessed
can cause slow down or even disk thrashing, when the computer ‘freezes’ due to pages being swapped too frequently between the hard disk and main memory
what is an interrupt?
a signal generated by software or hardware to indicate to the processor that a process needs attention
interrupts have different priorities and this is considered when allocating processor time
stored within an abstract data structure called a priority queue in an interrupt register
describe the process of a processor checking for interrupts.
processor checks the interrupt register at the end of each FDE cycle
if there is an interrupt exists with a higher priority to the current process
the current contents of the registers in the CPU are transferred into a stack.
the relevant interrupt service routine (ISR) is loaded into RAM.
a flag is set to signal the ISR has begun
the flag is reset once the ISR has finished.
this process is repeated
if there are no interrupts with a higher priority to the current process
the contents of the stack are popped back into the registers
FDE cycle resumes
why do operating systems use scheduling?
to ensure all sections of programs being run (jobs) receive a fair amount of processing time
what are the two types of scheduling algorithm?
pre-emptive: jobs are actively made to start and stop by the operating system
non pre-emptive: once a job is started, it is left alone until it is completed
describe the round robin algorithm.
pre-emptive scheduling algorithm
each job is given a section of processor time (a time slice) within which it runs
once each job in the queue has used its first time slice, they are given another slice of processor time until a job has been completed
completed jobs are removed from the queue
what are the benefits/drawbacks of using the round robin algorithm?
all jobs will eventually be attended to
longer jobs will take a much longer time for completion
does not take into account job priority or urgency
describe the first come first served algorithm.
non pre-emptive scheduling algorithm
jobs are processed in chronological order by which they entered the queue
what are the benefits/drawbacks of using the first come first served algorithm?
straightforward to implement
does not take into account job priority or urgency
describe the multi-level feedback queue algorithm.
pre-emptive scheduling algorithm
makes use of multiple queues, each which is ordered based on a different priority
what are the benefits/drawbacks of using the multilevel feedback queue algorithm?
takes into consideration different job priorities
difficult to implement
describe the shortest job first algorithm.
non pre-emptive scheduling algorithm
the queue storing jobs to be processed is ordered according to the time required for completion
the longest jobs are serviced at the end
what are the benefits/drawbacks of using the shortest job first algorithm?
suited to batch systems, as waiting time is reduced
requires processor to calculate how long each job will take
risk of processor starvation if short jobs are continuously added to the queue
does not take into account job priority or urgency
describe the shortest time remaining algorithm.
pre-emptive scheduling algorithm
the queue storing jobs to be processed is ordered according to the time left for completion
the jobs with the least time to completion are serviced first
what are the benefits/drawbacks of using the shortest time remaining algorithm?
throughput is increased as shorter processes can be quickly completed
does not take into account job priority or urgency
processor starvation if short jobs are continuously added to the queue
what is a distributed operating system?
run across multiple devices
means the load of a task is spread across multiple computers
*note, the exam will not accept processors instead of computers
what is an embedded operating system?
built to perform a small range of specific tasks
catered towards a specific device e.g. a household appliance
limited functionality and is read-only (so it cannot be updated)
consumes less power than other types of OS