3.7 organisation and architecture Flashcards
computer system
any device that can take a set of inputs and process them into useful outputs
(e.g. screen press (input) -> charas encoded (process) -> text displayed (output))
stored program concept
- instructions stored in main memory
- instructions are fetched and executed serially by the processor
- programs can be moved in/out of main memory
john von neumann architecture
- most common implementation of stored program concept, used in general purpose computing systems
- instructions + data share buses/addresses/memory
harvard architecture
- instructions + data have separate buses
- instructions + data stored in separate memories
- instructions + data can be fetched simultaneously
when is harvard architecture usually used
embedded systems like digital signal processing, where speed takes priority over complexities of design
parts of the cpu
- arithmetic logic unit
- control unit
- clock
- cache
- general-purpose registers
- dedicated registers
i/o controllers
act as interface between peripheral device and computer (cannot be directly connected to processor)
how do i/o controllers work
controller converts signals received from peripheral into processable format, vice versa
what does main memory do
stores data and instructions to be processed
word
- group of bits that is treated as single unit by processor
- can be used for representing both instructions + data
- usually 8, 16, 32, 64 bits
- each word has separate memory address
word length
the number of bits that are assigned to it
CPU
controls, calculates and executes instructions
arithmetic-logic unit
performs arithmetic, logical and shift operations on data
control unit
- coordinates activity of all other components
- each instruction accepted + decoded
- separate steps (fetching data address, fetching data itself) are identified
- each step synced with regular pulse from system clock
system clock
- series of regular on/off signals used to sync operations
- actions usually carried out on rising edge of clock
- actions each take fixed number of cycles to complete
factors affecting cpu performance
- number of cores (more processors = more instructions executed simultaneously)
- word length (amount of data that CPU can process simultaneously)
- address/data bus widths
- clock speed
- cache size
buses
- series of wires that transfer data signals between internal components
- typically consist of 8, 16, 32 or 64 lines
control bus
used to send control signals between
- each I/O controller and the processor
- as well as between the processor and memory
data bus
- sends data between components
- bi-directional
why data buses bidirectional
- when data/instructions needed, transferred from memory to processor
- after execution, data transferred back to memory
address bus
- carries address of a memory location from processor to I/O controllers + memory
- may carry address of next instruction to be processed, or data referred to in the instruction
- unidirectional
control bus - control signals
- memory read
- memory write
- bus request
- bus grant
- clock signal
memory read
causes data from addressed location to be placed on data bus
memory write
causes data on data bus to be written into addressed location
bus request
device requesting use of the data bus
bus grant
CPU has granted access to the data bus
how are buses used in write process (writing data to main mem)
- address of memory to be written to placed on address bus
- data to be written is placed on data bus
- signal to write is placed on control bus
- control bus carries a clock signal (to synchronise memory + processor)
- when write signal received on the control bus > data from data bus stored > into location identified by address bus
data bus width
- width of data bus defined by number of wires or lines it contains
- bus width affects overall system performance
- if data bus same width as word, data can be transferred to+from memory in a single operation
- (i.e. if it is 16 lines and a word is 32 bits, it will require two memory access and data transfer operations)
address bus width
- determines the maximum possible memory addresses of the system
- i.e. a 32-bit bus can carry 2^32 bits (4GiB)
what is a register
memory/storage location inside a processor
general purpose registers
- used to temporarily store results from ALU
- faster than writing data back to slow memory
- processor able to immediately access and re-use these results
accumulator
a single general purpose register that some processors have
dedicated registers
program counter (PC)
current instruction register (CIR)
memory address register (MAR)
memory buffer registers (MBR)
status register (SR)
program counter PC
holds the memory address of the next instruction to be executed
current instruction register CIR
holds the current instruction
memory address register MAR
holds the address that the CPU needs to fetch/store data to/from in memory
memory buffer register MBR
temporarily holds data moving between the processor and main memory
status register SR
- holds information about current state of operations
- used to set flags (e.g. carry or overflow)
- used to detect error conditions
cache
small amount of super-fast memory that stores data frequently used by the processor (i.e. freq used programs)
cache specs
- larger and slower than a register
- faster and smaller than RAM
- larger amounts of cache memory can improve processing speed, but massively increase processor cost
order of memory speed
CPU registers
lvl 1 cache
lvl 2 cache
lvl 3 cache
RAM
executing instructions
- processor temporarily holds current instruction being executed
- holds address of the data that it needs, and also the data itself
- also keeps track of the address of the next instruction to be executed
fetch-execute cycle
- processors operate in defined stages that are used to carry out program instructions
- process repeated for each instruction in a program
fetch
- contents of PC transferred to MAR (to enable mem address to be transferred along address bus to memory)
- contents of MAR placed onto address bus (so correct location in main memory will be accessed)
- transfer of actual data uses data bus
- contents of addressed memory location/value received on data bus loaded into MBR (not all fetches will be for instructions, so cannot be loaded directly into CIR)
- PC is incremented (so next instruction in sequence can be fetched)
- contents of MBR copied to CIR (because control unit uses instruction from CIR)
decode
- control unit decodes instruction held by CIR
- instruction split into opcode and operand
instruction set
- defines all the instructions and how they are represented
- different processors have own instruction sets, but may perform similar/identical operations
types of instruction
- data transfer (i.e LOAD, STORE)
- arithmetic operations (i.e. ADD, SUBTRACT)
- comparison operation to compare two values
- logical operations (i.e. AND, OR, NOT)
- branch – conditional and unconditional
- shift operations (shift bits left or right in a register)
the number of bits used for machine code instruction dependent on …
… processor word length
instruction components
instruction typically includes 2 parts
- operation code / opcode (first set of numbers)
- operand(s) (second set of numbers)
opcode includes:
- actual instruction the processor needs to carry out (e.g. ADD, SUB)
- the addressing mode
addressing mode
specifies whether the operand is
- the actual data to be used
- the memory address where the data is held
- a register where that data is held
operand
one or more items of data (which can be values, memory addresses or registers) that are to be used in the instruction
immediate addressing
addressing mode specifies that data is a value
direct addressing
addressing mode specifies that data is an address
dis/advantages of secondary storage devices
- durability
- read/write speed
- capacity
- portability
- cost
how does hdd work
- concentric tracks (containing sectors) created on magnetic disk platters
- disk spins at high speeds (3,600 - 7,200rpm)
- spinning platters are each read by drive heads
- data read or written as sector moves under the head
how do !magnetic! storage devices work
- positive or negative polarisation of magnetic particles creates binary pattern on the disk
- changes of polarisation create electromagnetic pulses
- each pulse read as a 1. anything else is a 0
development of hdds
fitting more data in same physical space requires technological changes:
- more densely packed platters
- smaller magnetic parts
- smaller read/write heads
- perpendicular over longitudinal recording
how does optical disk work
- high powered laser “burns” pits into the CD surface
- low powered laser detects the reflection from pits and lands
- only a pit end deflects the laser light, and is read as a binary 1
optical disk formats
- available as read-only, recordable, or re-writeable
- each format uses diff techniques to achieve a differential between a ‘pit’ and a ‘land’
optical disk format - recordable
recordable formats use a transparent dye that becomes opaque when heated by a laser
optical disk format - re-writeable
re-writeable formats use a laser to change the state of a phase-change alloy, and a magnet to set the new state
optical disk capacity
- different laser wavelengths “burn” smaller pits
- spiral track can therefore be more tightly wound, creating longer track = higher capacity
NAND flash memory cells
- flash mem contains no moving parts
- used by SSDs
- floating gate transistors trap and store a change. the charge is retained without power
combining flash memory cells
- cells combined in blocks
- cells trap charge
- data must be read, deleted or written in blocks
- data cannot be overwritten w/o being erased first
inside a solid state disk
- ssd comprises millions of NAND flash mem cells
- cells also managed by a controller that organises pages and blocks of memory
- these are arranged within an array of chips on a circuit board
solid state disk advantages
- no moving parts > faster access speed, more durable
- lower power consumption > extended battery life in portable devices, devices stay cooler
- purely electronic > minimal latency
- silent in operation
- light in weight
why use ssd and hdd
- hdds useful where large capacity is needed > cheaper than ssd
- ssds have faster access speeds/lower latency than hdds > access to data faster than if just hdd used
barcode readers
- typically work on principle of reflected light
- light from laser directed at pattern
- sensor detects intensity of light that bounces back
barcode pattern physics
- black bar absorbs more light, less reflective, binary reading of 0
- white bar more reflective, binary reading of 1
- binary pattern creates a unique identity
common type of barcode system
universal product code version ‘a’ (UPC-A) / european article number (EAN)
laser printers
- print drum coated in positive static charge
- printer generates bitmap of page from data
- laser shone on print drum, reverses charge on drum where image should be dark
- toner given positive charge
- charged drum picks up toner
- toner transferred from drum to paper
- toner then fused to paper (once off drum)
how do radio frequency id systems work
- RFID systems use a transponder and a receiver
- powered receiver emits radio frequency energy
- transponder antenna in tag becomes energised by radio waves
- transponder can then send data to receiver
uses of RFID tags
- security control points
- identification of people/goods
- shipping and supply chain tracking for goods
- banking payments
passive tags
- passive transponders (used in bank cards e.g.) have no power source themselves
- rely on radio waves from receiver for their energy
- transponders need to be placed very close to receiver
active tags
- use larger, battery-powered beacon which can broadcast own signal to receivers up to 300m away
- useful for larger items not placed on a receiver by hand (e.g. in shipping, warehousing)