Topic 3 Flashcards
von Neumann stored program
Includes:
- memory unit : into which program instructions and data are loaded prior to being processed.
- processing unit : decodes and executes program instructions fetched from memory one at a time.
- input and output mechanism: to input programs and data and output the result of processing.
main memory
–> short term, work memory.
only holds the instructions and data that the CPU is currently using.
–> consists of a collection of storage location, each with a unique address.
a storage location can hold a program instruction of an item of data.
- -> referred to as RAM.
- -> volatile
- -> primary storage because the CPU has fast, direct address to it.
Central processing unit (CPU) : detailed
buses: work together to transfer data between the CPU, main memory and input/output devices.
control unit: fetches program instructions from main memory one a time, decodes them and directs the operations of the other parts of the system to execute them.
clock - synchronise the actions of the CPU,
ALU - performs arithmetic and logic operations on data.
Registers: also know as immediate access storage.
memory that is extremely fast.
some are general purpose others have specific functions.
CPU includes:
Buses Control unit Clock ALU Registers
Clock
an electronic device that ticks at regular intervals and is used to synchronise the actions of other components of the CPU.
Control bus
signals are carried between the CPU and other parts of the computer system
Address bus
holds the memory address of the memory location that the CPU needs.
(unidirectional).
data bus
transfers program instructions and data between memory and teh CPU.
Fetch - Decode - Execute
The Fetch stage
1) the CPU places the memory address of the next instruction on the address bus.
2) the control unit sends a read signal along the control bus to memory.
3) the content of memory location is transferred along the data bus to the CPU, where its stored in a register.
The decode stage
- the control unit decodes the instruction by looking it up in the CPU’s instruction set
The execute stage
- the CU then carries out the instruction.
- it instructs the ALU if calculations need to be performed.
Why secondary storage is needed
RAM is volatile.
it loses its contents when the power of switched off.
Secondary storage provides non-volatile storage that can be used to write and rewrite data, so that it does not vanish when the power is turned off.
differences between primary and secondary storage
primary
- volatile and power dependent
- short term
- directly accessible by CPU
- Limited storage capacity
- Limited scope for expansion.
Secondary:
- non volatile
- long term
- programs and data must be transferred to memory in order for them to be accessed by the CPU.
- large storage capacity
- can be expanded by using external device (USB)
advantages and disadvantages of optical
+ cheap yo produce
+ thin and lightweight
+ portable
- slow to access
- low capacity
- prone to scratches
advantages and disadvantages of magnetic
+ high capacity
+ quick to access, providing the disk is defragmented periodically.
- Has moving parts that will eventually fail.
advantages and disadvantages of solid state
\+ quick to access \+ no moving parts so reliable \+ quite \+ low power requirements \+ no need to defragment
- expensive
- has a limited number of read write cycles
magnetic storage
Magnetic media are coated with a substance that can be magnetised.
Magnetic storage technology works by magnetising parts of this substance as north and south poles to represent binary 1s and 0s.
Examples include: hard disk drive, tape drive and cassette.
optical storage
Optical media consists of a platter with a flat reflective surface.
Optical storage technology works by using a laser to burn ‘pits’ into the flat surface.
The reflective areas between pits are known as ‘lands’.
A laser is directed onto the medium’s surface.
When it hits land, a beam reflects (this is read as binary 1).
When it hits a pit, the beam does not reflect (this is read as binary 0).
Examples: CD and DVD.
solid state / flash storage
Solid state media consists of silicon chips that feature a special kind of transistor called NAND flash.
This type of media is called ‘solid state’ because it has no moving parts.
Solid state technology works by using a large electric current to force electrons through a barrier trapping them in positions called pools.
A full pool - 0.
An empty pool - 1.
Examples include: SSD card, USB, SD memory card and flash storage.
Embedded systems
features
hardware
firmware
IoT
operating system (user management)
- provides a user interface to enable users to interact with the computer.
access control: the OS uses log in name and passwords and or some form of biometric identification to authenticate users and control who can log in.
file permissions: control who can do what with each file
(read, write, execute, delete)
utility programs (data compression)
data compression
purpose - to reduce the size of a file so that it takes up less space in secondary storage and is quicker to transfer across networks.
how it works - it repackages (lossless compression) or removes (lossy compression).
some of a file’s data to reduce its size
robust software
a program is deemed robust if it can handle unexpected actions without crashing or producing incorrect output and if it free from vulnerabilities that can be exploieed by criminals.
code reviews
purpose to a code review is:
- to check that software adheres to agrees standards.
- to find any instances of insufficient code
- to identify potential vulnerabilities
how it works:
- -> carried out by other programmers or by specialised software.
- -> that checks the code to make sure it meets a pre-defined set of rules
- -> detect bugs and security issues
- -> may suggest ways to fix them
audit trail
what is it:
- helps improve accountability
- by keeping track of who made what changes and when during the development process.
- if a problem is discovered, it can be tracked back to its source and the code rolled back to a version before the flow was introduced.
version control software
- -> often used alongside audit trails, especially when a team of programmers is working on a large program.
- it uses a database to keep track of every modification to the code.
- if a mistake is made, programmers can revert to an earlier version
three things programmer can do to make their programs robust?
adhere to good programming practises
carry out regular code reviews
keep an audit trail