OCR A-Level Computer Science Spec Notes
1.1 The characteristics of contemporary processors, input, output and storage
devices - Summarized
1.1.1 Structure and function of the processor
(a) ALU; Control Unit; Registers
- CPU (Central Processing Unit): A general purpose-processor which completes
instructions using the FDE cycle (Fetch-Decode-Execute).
CPU consists of:
- ALU (Arithmetic Logic Unit):
● Carries out Logical/Arithmetic calculations in the CPU
● Stored in the ACC.
● Acts as a gateway to the processor for easy calculations.
- CU (Control Unit):
● Controls FDE cycles
● Decodes & Executes instructions + Coordinates Data around processor/computer
● Synchronises actions using in-built clock
- Registers: Memory locations inside a computer that temporarily store data/information.
They are faster to access than RAM especially during the FDE cycle
- GPR (General Purpose Registers):
● Temporarily store data than transferring using slower memory.
- PC (Program Counter):
● Stores the address of the next instruction to be processed
- ACC (Accumulator):
● Temporarily stores ALU calculations & deals with I/O data
- MAR (Memory Address Register):
● Temporarily stores address of the next instruction/data from main memory
- MDR (Memory Data Register):
● Contains the instructions of the memory location address specified in the
MAR. Copies data/instructions to CIR
- CIR (Current Instruction Register):
● Hold the most recent instruction for decoding/execution by CU
- Buses: Parallel set of communication wires which carry instructions/data to/from
registers to processors. There are 3 different buses in the CPU:
- Data Bus: Carries data/instructions around the system (CPU <-> Register)
- Address Bus: Carries information on the location of the data (MAR -> Main
Memory)
- Control Bus: Transmits control signals from CPU to sync rest of processor
(b) Fetch-Decode-Execute cycle
Fetch
● PC instruction fetched & stored in Main memory to processor
● PC passess address location to MAR through address bus
● PC is incremented in cycle & Fetch signal is sent to control bus.
● Contents of memory location is sent from memory to processor via data bus which is then
stored on MDR
● Contents of MDR/ACC sent to ALU & calculation sent to ACC
Decode
● Load instruction from address in MAR & send to MDR
● Instruction copied from MDR -> CIR
● Instruction decoded into opcode/operand by CU in CIR
Execute
● The appropriate instruction opcode is carried out on the operand by the processor.
(c) CPU performance (clock speed, number of cores, cache)
CPU performance can be measured in different ways
● Clock Speed
- Clock controls the process of executing instructions/fetching data
- Can be ‘overclocked’ = More cycles per second
- Heat Sink: Fan to cool down overheating CPU
● Number of Cores
- Multiple cores = Speed up smaller problems
- Multi Tasking = Different cores run different apps / All work on one app
● GPU (Graphics Processing Unit)
- Designed to handle graphics/video faster than a CPU
- CPU directly sends Graphics related tasks to GPU
● Cache
- Small memory which runs much faster than main memory (RAM)
- By anticipating the data/instructions that are likely to be regularly accessed , the
overall speed at which the Processor operates can be increased.
- More space for data/instructions in cache memory
- RAM needs to be accessed less frequently as accessing cache is quicker.
- More expensive than RAM
(d) Pipelining
- Allow one instructions to be decoded/executed while the previous one is
fetched/decoded
- Jump instructions can’t be used with pipelining as the wrong instruction can be
fetched/decoded which causes the pipeline to ‘flush’.
(e) Von Neumann, Harvard, contemporary architecture
Computers are built off from mainly 2 architectures:Von-Neumann/Harvard Architecture:
Von Neumann Architecture:
● Single processor CU manages program control.
● Uses FDE cycle to execute one instruction at a time in a linear sequence.
● Program and data stored together in same memory format (Problem due to overwriting of
data)
● Simple OS and easy to program
● Von Neumann Bottleneck: CPU has to wait for data transfer as it’s much faster
Harvard Architecture:
● Data/instructions are stored in separate memory units with separate buses (Complex)
● So while data is being written to or read from the data memory, the next instruction can
be read from the instruction memory (Von Neumann more cost effective)
Contemporary Processor Architecture:
● Modern high-performance CPU chips incorporate aspects of both architectures.
1.1.2 Types of processor
(a) CISC vs RISC processors
Reduced instruction Set Computer (RISC) Complex instruction Set Computer (CISC)
- Simple processor design - Complicated processor design
- Simpler Instructions used - Complex Instructions used
- One machine cycle per instruction - Each instruction (Many cycles)
- Allows pipelining - No pipelining
- Shorter instruction set - Longer instruction set
- Requires More RAM - Requires Less RAM
- Simple circuitry is cheaper - Integrated circuitry is more expensive
- Programs run faster due to simple instructions - Programs run more slowly due to
complicated circuit
- Limited Instructions available - Many Instructions available
- An instruction performs a simple task so - An instruction can do complex tasks
complex tasks can only be performed so no need to combine many instructions
by combining multiple instructions
(b) GPUs
- Specifically designed for enhancing graphics
- Have inbuilt circuitry & instruction set for graphics based calculations
- Large number of cores = run highly parallelizable problems
- Perform on-screen graphics transformations quickly
- Tackles problems in: Science/Engineering, data mining, audio processing, password
beaking, machine learning
Co-Processor: Extra processor to supplement functions of primary processor (CPU)
(c) Multicore and Parallel systems
Multicore processors
- More than one processor incorporated into one chip
- Focuses efforts of multiple CPUs into 1 task
- Hard to program code to decompose problems efficiently for multicore processing
Parallel Systems
- A computer which does multiple computations simultaneously to solve a problem which
takes less time to do one job
- Parallel processing isn’t suited to all to problems. Most problems are only partially
parallelizable.
- Allows faster processing and speeds up arithmetic processes as multiple instructions are
processed at the same time and complex tasks are performed efficiently.
- Complex OS & specific code has to be written for maximum efficiency of parallel
processing.
Different approaches to Parallel processing:
- SIMD (Single Instruction Multiple Data): The same instruction operates simultaneously on
multiple data locations
- MIMD (Multiple Instructions Multiple Data): Different instructions operate concurrently
on different data locations
1.1.3 Input, output and storage
(a) Applying different input, output, storage devices to a problem
Input Devices: Peripheral devices which pass data onto the computer and allow the user to
communicate with the computer.
Output Devices: Peripheral devices used to report the results of processing from a computer to
the user and allow the computer to communicate with the user.
Input Devices Examples: Keyboard, Mouse, Microphone, Scanner
Output Devices Examples: Printer, Speaker, Monitor, Actuators
Storage Devices
- A secondary storage device is the physical hardware that carries out the storage action.
When getting a storage device, the following needs to be considered:
● Cost of media (DVD disk vs an external hard disk)
● Cost per GB (Important for backup of data)
● Speed (Read - Write speed)
● Capacity (How much data it can store)
● Potability (How heavy/light the device is)
● Durability (How long can it last)
Archive: transfer (data) to a less frequently used storage medium such as magnetic tape.
Back-up: a copy of a file or other item of data made in case the original is lost or damaged.
(b) Magnetic, flash and optical storage devices
- Peripheral devices used to permanently store data when Power OFF
- 3 Main storage categories: Magnetic/Flash/Optical
Magnetic Storage Flash Storage Optical Storage
- Use of magnetisable - Data is stored on memory chips - Using a laser which
material to read - Can have contents reads the disc by
magnetic patterns of overwritten/erased when looking at its
platters that run electrical charge is applied reflection
mechanically at high
speeds
- High Capacity at Low - No moving parts = less power - Cheap & resilient
Cost - High read/write speeds
- Less Space & Run silently
- Noisy & Susceptible - Expensive form of storage - Unreadable if there
to damage if moving are scratches
too quickly
- E.g HDD/Zip - E.g SSD/Flash Drives(USB)/Flash - E.g
Drives/Magnetic memory Cards CDs/DVDs/Blu-Ray
Tape discs
(c) RAM and ROM
RAM (Random Access Memory) ROM (Read only Memory)
- User files/applications software/OS - Small memory which can only be READ
temporarily stored into
- Faster read/write speed than - Stores BIOS bootstrap program. Stored
secondary storage media here so it isn’t deleted
- Volatile: Loses contents when Power - Immediately present when computer is
OFF turned on
- Data can be written over by allowing - Non Volatile: Contents not lost when
user to alter saved files in current use Power OFF
- Large & reduces buffering - Memory contents can’t be
altered/maliciously changed
(d) Virtual storage
- Combination of multiple storage devices into 1 virtual storage device
- Remote Storage/Software & Accessible anywhere
- If one storage device fails, can be replaced with inexpensive storage device
- Easy for administrator to monitor one storage device rather than multiple
- Complicated system so requirements to run are high