Computers Flashcards
Von Neumann architecture
A structure in which the hardware is connected and organised.
It consists of Main Memory and a Central Processing Unit interconnected by buses.
__________Main Memory
________ (Read)!_____¡(Write)
Input –> Central Processing Unit –> Output
The CPU reads and writes data & program instructions to and from main memory.
Main memory
Known as Random Access Memory(RAM)
It stores the data & programs the CPU can access.
Volatile - Loses content when power is lost.
Faster and more expensive than secondary storage
Programmable computer
A computer that is multi-purpose, can be programmed to carry out different tasks. They are able to store program instructions and data in main memory.
CPU parts
Consists of:
- Control Unit (CU)
- Arithmetic Logic Unit (ALU)
- Registers
Control unit (CU)
- Decodes instructions received from main memory
- Coordinates the actions of other components
Arithmetic Logic Unit(ALU)
Performs arithmetic and logic operations on data.
Registers
Provides fast, temporary storage for instructions.
Buses
Buses connect the components inside a computer.
Types:
- Address bus
- Data bus
- Control bus
Address bus
Carries the address of the memory location. Unidirectional, only the CPU can put an address on this bus.
Data bus
Holds the value being read from or written to memory. Bidirectional.
Control bus
- Carries command signal from the control unit to other components. The status signal is sent back to the CPU.
- Bidirectional.
Clock
A tiny quarts crystal that vibrates and sends out electronic signals to synchronise the actions of the hardware components.
Measured in hertz, 1 hertz = 1 “tick” per second.
Fetch/Decode/Execute cycle
Program instructions and data are stored in main memory and transferred/fetched one data at a time to the CPU, where they are decoded and executed.
Fetch: The control unit sends a read signal to main memory along the control bus. It also places the memroy address of the next instruction on the address bus. The RAM copies the content of the memory location indicated by the address bus on the the data bus.
Decode: The control unit decodes the instructions.
Execute: The control unit sends signal to the other components of the CPU instructing them what to do.
Secondary Storage
- Non-volatile
- Allows the system to store data and programs permanently.
- Cheaper and slower than main memory.
Types:
- SSD(Solid State Drives): USB drive
- Magnetic storage: HDD(Hard Disc Drive)
- Optical Storage: DVD/CD
Magnetic Storage
- A head reads & writes to spinning discs.
- An area that is magnetised represents a 1.
- An area that is not magnetised represents a 0.
Solid State Drive
- Represents bits by little pools of trapped electrons on a microchip.
- No flow(trapped) represents a 0.
- Electron flow represents a 1.
Optical storage
- Laser beam reads and writes data(Pits and land)
- Pit represents a 0
- Land represents a 1
Operating system (OS)
A program that controls and manages the hardware and all other software on a computer and provides an interface for users
Application software
Programs or apps deigned for end users.
Such as:
- Web browser
- Spreadsheet
- Game
Utility software
Programs that functionality to a computer system or improve its performance in some way.
Such as:
- Disk repair
- Compression
- Anti-malware
Why is robust software made
To produce software that is capable of handling the unexpected without crashing, not generating incorrect output, or not revealing sensitive data
Bad programming practices
- Not having a well-thought design
- Not following coding standards
- Using a temporary fix
- Writing unstructured code
- Not testing
Scheduling
- All processes are held in a queue
- Some processes are prioritised
- Processes are allocated time slides, length of time slices depends on priority. Processes are switched at the end of their time slice
- Unfinished processes are put to the back of the queue
- During the time slice, the process has exclusive use of the processor
Types of operators
- Relational
- Arithmetic
- Logical
Relational
<, >, !=, ==
Arithmetic
+, -, *, /
Logical
AND, OR, NOT
Write data in SSD
- Current applied to a transistor
- Forces electrons through a barrier, trapping them in pools
- Full pool (0), Empty pool (1)
Disk fragmentation
- Files are written to a disk in blocks
- Blocks can be dispersed through the disk
Disk defragmentation
- When file blocks are rearranged in the disk
- To place free space together / file blocks together
Audit trails
- Keeps track of who made what changes
- Allows to track back problems
- Enables program to be rolled back
- Help produce robust software
Code reviews
- Check that software adheres to agreed standards
- Find instances of inefficient code
- Identify potential vulnerabilities
- Done by programmer
Compiler
Translates the source code into a stand-alone machine code program that can be executed by the processor
Interpreter
Translates a high-level code line by line into machine code. It is needed each time the program is run
Cache
- Store frequently used instructions (act as a buffer)