Chapter 1.1: Systems architecture
CPU
● Responsible for executing instructions given to it in a program
● Relies on other devices
○ To allow users to input instructions
○ To store instructions
○ To transfer instructions to it so it can carry them out
○ To carry out commands it is issued
● Data and instructions are processed here
● Uses “Von Neumann Architecture”
● 1945: proposes his design for a “stored program” computer where program and data were
stored in memory
● FDE cycle
○ Fetch-decode-execute cycle
○ Before cycle, program instructions are copied from secondary to primary storage
○ Fetch: instructions and data are moved from memory to CPU
○ Decode: control unit figures out what instruction is
○ Execute: control unit sends signals telling CPU what to do, if calculation needed then
performed by Arithmetic Logic Unit
Main parts of CPU
● Arithmetic Logic Unit (ALU)
○ Performs logical and arithmetic calculations
○ 4 operators
○ Logical tests using logic gates
○ Comparisons
○ Logical shifts (multiplying or dividing by 2)
● Control Unit (CU)
○ Coordinates actions of computer
○ Controls FDE by sending out control signals to other parts of CPU
■ Control signals: electrical signals sent out to devices to check their status and
give instructions
○ Sends signals to components of computer system such as input/output devices
○ 2 main elements of CU:
■ Clock
● Timing signals sent to other components to coordinate activities
● Ensures instructions are carried out and completed
● Timing controlled by vibrating quartz crystal
● One instruction can be carried out by each pulse of clock
■ Decoder
● Decodes program instructions and decides actions to take
● Send control signals to other components to do instruction
● Registers
○ Storage locations inside CPU
○ Can be accessed faster than RAM
○ Stores single instruction, value or data currently in use in FDE
○ Used by control unit to carry out instructions
○ Main registers:
■ Program counter:
● Stores address of next instruction to fetch from memory
, ● Increase by one unless told otherwise
■ Memory Address Register:
● Copies and stores address of next instruction to fetch from memory
from program counter
■ Memory Data Register:
● Stores instruction or value fetched from memory
■ Instruction register:
● Stores current instruction being executed
■ Accumulator:
● Stores result of ALU
● Order of operations:
1. Program counter
2. Memory Address Register
(Instruction fetched from memory)
3. Memory Data Register
4. Instruction Register
(Instruction decoded)
5. Arithmetic Logic Unit
6. Accumulator
CPU performance variables
● Clock speed:
○ Rate of instructions processed is controlled by clock speed
○ Faster clock speed = faster instruction processing and FDE
○ Increasing clock speed limitation: generates more heat at higher clock speed and
limits to cooling
○ Number of cycles per second (same as frequency), measured in hertz
● Cache size:
○ RAM is bottleneck due to being slower than CPU - cache bridges gap of speed
○ Stores frequent instructions temporarily and what CPU might need next
○ Very small - if bigger then not efficient
○ CPU first asks cache for instruction then RAM, copy of instruction is stored in case
needed again
○ Primary memory
○ Speed and capacity rank: Registers, L1, L2, L3, RAM
○ Most CPUs have independent instructions and data caches at L1
○ Data caches have to be read and written to but the instruction caches just have to be
read by CPU
○
● Cores:
○ number of instructions possible at once
○ More cores=more instructions done at once
○ Multitasking: running different program on each core
○ Parallel processing: spreads program over cores
○ Each core has its own registers, CU, ALU
, ○ Clock speed, cache, program etc still affect performance and can make multi-core
CPU slower than single-core CPU
○ Good term to use: processing units
○
Embedded systems
● Computer system inside a device
● Examples: washing machine, camera
● Microprocessor, memory, input/output interfaces are all on one PCB
● Programs are often written in assembly language rather than a high level language
● Has RAM and ROM
● Some have EEPROM (updates device)
● Inexpensive
● Designed for specific tasks
● CPU connects directly to inputs and outputs
● Energy efficient
● Fast
● Flexible (works in variety of conditions)
Chapter 1.2: Memory and storage
Primary storage
● Takes long time to fetch data and instructions from secondary storage
● Data and instructions in use are stored here
● Accessed directly by CPU
● RAM
○ Have many storage locations
○ Each byte of data has address
○ More RAM = more programs can be held in memory
○ Slower than cache
○ Memory locations can be accessed in any order
○ Volatile - loses its contents without power
○ More RAM does not always make PC faster
■ If VM is not used then extra RAM is not needed
■ If VM is used, CPU does not have to swap data from VM to RAM
■ Secondary storage is slow so VM is slow
● ROM
○ Stores computer's startup programs and data
○ POST (Power On Self Test)
■ Checks key components are working and connected
■ If any test fails, gives out error message and/or beeps
○ BIOS (Basic Input Output System)
■ Views and changes system settings eg. Date & time and performance
○ Boot loader
■ Searches and loads an operating system from secondary storage
○ Read only - once written, cannot be changed or erased
, ○ Non-volatile - do not need power to retain data (important as it contains bootup
programs)
○ Usually only in MB
○ Contents can only be changed if it is EEPROM
○ Process of changing data of EEPROM is called “flashing”
● Virtual Memory
○ Purpose: allows computer to run more programs than memory can store
○ Uses part of secondary storage as an illusion of extra memory
○ Used as memory overflow
○ Inactive data and instructions are swapped out from RAM into secondary storage
○ If instruction is needed, must be loaded back into RAM
○ Part of OS called VMM (Virtual Memory Manager) manages this
○ Creates file on secondary storage to act as extension to memory
○ Swaps out data inactive in memory to VM
○ Data is swapped between VM and RAM as needed (do not write memory)
○ Slow
○ Disk thrashing - constant read/write of HDD or SSD happens, wearing it out
○ If run out of RAM + secondary storage, error messages and programs not working
Secondary storage
● Any device used to store data for long term
● Non-volatile
● Not accessible by CPU
● Local (inside computer or connected directly)
● Cheapest yet slowest form of storage
● Storage medium (plural: media) is thing that holds storage, storage device is thing that
reads/writes from medium
● Optical:
○ CD, DVD, Blu-ray
○ Uses laser to read “pits” and “lands” in disc
○ CD, DVD etc is storage media NOT device - device is the player/reader
Type Size Purpose
CD 700MB 1 album of uncompressed audio
Retail software
DVD 4.7 or 8.5GB Standard definition movie/video
Retail software
Blu-ray 25, 50, 100 or 128GB High-definition video
○ Benefits:
■ Cheap to mass produce
■ Very quick to make in large quantities
■ Lightweight, transportable
■ Good for data that can be read serially
○ Drawbacks:
■ Can get scratched and damaged
■ Limited storage compared to other media
■ Relatively slow to access and write data
■ Can degrade over time causing data loss
■ Cannot be rewritten (unless using rewritable discs)
○ Opinion (may be asked in exam):
CPU
● Responsible for executing instructions given to it in a program
● Relies on other devices
○ To allow users to input instructions
○ To store instructions
○ To transfer instructions to it so it can carry them out
○ To carry out commands it is issued
● Data and instructions are processed here
● Uses “Von Neumann Architecture”
● 1945: proposes his design for a “stored program” computer where program and data were
stored in memory
● FDE cycle
○ Fetch-decode-execute cycle
○ Before cycle, program instructions are copied from secondary to primary storage
○ Fetch: instructions and data are moved from memory to CPU
○ Decode: control unit figures out what instruction is
○ Execute: control unit sends signals telling CPU what to do, if calculation needed then
performed by Arithmetic Logic Unit
Main parts of CPU
● Arithmetic Logic Unit (ALU)
○ Performs logical and arithmetic calculations
○ 4 operators
○ Logical tests using logic gates
○ Comparisons
○ Logical shifts (multiplying or dividing by 2)
● Control Unit (CU)
○ Coordinates actions of computer
○ Controls FDE by sending out control signals to other parts of CPU
■ Control signals: electrical signals sent out to devices to check their status and
give instructions
○ Sends signals to components of computer system such as input/output devices
○ 2 main elements of CU:
■ Clock
● Timing signals sent to other components to coordinate activities
● Ensures instructions are carried out and completed
● Timing controlled by vibrating quartz crystal
● One instruction can be carried out by each pulse of clock
■ Decoder
● Decodes program instructions and decides actions to take
● Send control signals to other components to do instruction
● Registers
○ Storage locations inside CPU
○ Can be accessed faster than RAM
○ Stores single instruction, value or data currently in use in FDE
○ Used by control unit to carry out instructions
○ Main registers:
■ Program counter:
● Stores address of next instruction to fetch from memory
, ● Increase by one unless told otherwise
■ Memory Address Register:
● Copies and stores address of next instruction to fetch from memory
from program counter
■ Memory Data Register:
● Stores instruction or value fetched from memory
■ Instruction register:
● Stores current instruction being executed
■ Accumulator:
● Stores result of ALU
● Order of operations:
1. Program counter
2. Memory Address Register
(Instruction fetched from memory)
3. Memory Data Register
4. Instruction Register
(Instruction decoded)
5. Arithmetic Logic Unit
6. Accumulator
CPU performance variables
● Clock speed:
○ Rate of instructions processed is controlled by clock speed
○ Faster clock speed = faster instruction processing and FDE
○ Increasing clock speed limitation: generates more heat at higher clock speed and
limits to cooling
○ Number of cycles per second (same as frequency), measured in hertz
● Cache size:
○ RAM is bottleneck due to being slower than CPU - cache bridges gap of speed
○ Stores frequent instructions temporarily and what CPU might need next
○ Very small - if bigger then not efficient
○ CPU first asks cache for instruction then RAM, copy of instruction is stored in case
needed again
○ Primary memory
○ Speed and capacity rank: Registers, L1, L2, L3, RAM
○ Most CPUs have independent instructions and data caches at L1
○ Data caches have to be read and written to but the instruction caches just have to be
read by CPU
○
● Cores:
○ number of instructions possible at once
○ More cores=more instructions done at once
○ Multitasking: running different program on each core
○ Parallel processing: spreads program over cores
○ Each core has its own registers, CU, ALU
, ○ Clock speed, cache, program etc still affect performance and can make multi-core
CPU slower than single-core CPU
○ Good term to use: processing units
○
Embedded systems
● Computer system inside a device
● Examples: washing machine, camera
● Microprocessor, memory, input/output interfaces are all on one PCB
● Programs are often written in assembly language rather than a high level language
● Has RAM and ROM
● Some have EEPROM (updates device)
● Inexpensive
● Designed for specific tasks
● CPU connects directly to inputs and outputs
● Energy efficient
● Fast
● Flexible (works in variety of conditions)
Chapter 1.2: Memory and storage
Primary storage
● Takes long time to fetch data and instructions from secondary storage
● Data and instructions in use are stored here
● Accessed directly by CPU
● RAM
○ Have many storage locations
○ Each byte of data has address
○ More RAM = more programs can be held in memory
○ Slower than cache
○ Memory locations can be accessed in any order
○ Volatile - loses its contents without power
○ More RAM does not always make PC faster
■ If VM is not used then extra RAM is not needed
■ If VM is used, CPU does not have to swap data from VM to RAM
■ Secondary storage is slow so VM is slow
● ROM
○ Stores computer's startup programs and data
○ POST (Power On Self Test)
■ Checks key components are working and connected
■ If any test fails, gives out error message and/or beeps
○ BIOS (Basic Input Output System)
■ Views and changes system settings eg. Date & time and performance
○ Boot loader
■ Searches and loads an operating system from secondary storage
○ Read only - once written, cannot be changed or erased
, ○ Non-volatile - do not need power to retain data (important as it contains bootup
programs)
○ Usually only in MB
○ Contents can only be changed if it is EEPROM
○ Process of changing data of EEPROM is called “flashing”
● Virtual Memory
○ Purpose: allows computer to run more programs than memory can store
○ Uses part of secondary storage as an illusion of extra memory
○ Used as memory overflow
○ Inactive data and instructions are swapped out from RAM into secondary storage
○ If instruction is needed, must be loaded back into RAM
○ Part of OS called VMM (Virtual Memory Manager) manages this
○ Creates file on secondary storage to act as extension to memory
○ Swaps out data inactive in memory to VM
○ Data is swapped between VM and RAM as needed (do not write memory)
○ Slow
○ Disk thrashing - constant read/write of HDD or SSD happens, wearing it out
○ If run out of RAM + secondary storage, error messages and programs not working
Secondary storage
● Any device used to store data for long term
● Non-volatile
● Not accessible by CPU
● Local (inside computer or connected directly)
● Cheapest yet slowest form of storage
● Storage medium (plural: media) is thing that holds storage, storage device is thing that
reads/writes from medium
● Optical:
○ CD, DVD, Blu-ray
○ Uses laser to read “pits” and “lands” in disc
○ CD, DVD etc is storage media NOT device - device is the player/reader
Type Size Purpose
CD 700MB 1 album of uncompressed audio
Retail software
DVD 4.7 or 8.5GB Standard definition movie/video
Retail software
Blu-ray 25, 50, 100 or 128GB High-definition video
○ Benefits:
■ Cheap to mass produce
■ Very quick to make in large quantities
■ Lightweight, transportable
■ Good for data that can be read serially
○ Drawbacks:
■ Can get scratched and damaged
■ Limited storage compared to other media
■ Relatively slow to access and write data
■ Can degrade over time causing data loss
■ Cannot be rewritten (unless using rewritable discs)
○ Opinion (may be asked in exam):