Topic 3 Computers

5.0(2)
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/34

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

35 Terms

1
New cards
Stored Program Concept
* Instructions and data stored in the **memory** of the computer
* Instructions retrieved from memory, executed in sequence
* By processor that carries out logical + arithmetic operations from instructions
2
New cards
The Von Neumann Architecture
* **Main memory** and **central processing unit** connected by **buses**
* Data and instructions are stored in the same memory
* Instructions can be treated as data and data can be treated as instructions
3
New cards
RAM
* Stores data and instructions relating to **running programs**
* **Volatile**
* Directly accessible by CPU
* Numeric address for each memory location
4
New cards
CPU

1. Control Unit
* Synchronizes components of the CPU, managing flow of data between these components and memory
2. Arithmetic Logic Unit
* Performs logical and arithmetical operations on data
3. Registers
* Small, fast memory units storing values CPU is working on, some specialized some generalized
5
New cards
Clock
* Electrical pulse syncs computer components (in Hz)
* Modern computers can achieve \~1 instruction per cycle using pipelining
6
New cards
Address bus
* Carries address of data/instruction to be read/written from CPU to memory **unidirectionally**
7
New cards
Data bus
* Carries data/instruction from memory to CPU (reading data/instruction)
* Or from CPU to memory (data write)
* Hence **bidirectional**
8
New cards
Control bus
Control information e.g.

* Read/write signals
* Status
* Interrupt signals
* **Bidirectional**
9
New cards
Fetch in FDE Cycle

1. Address of next instruction placed on address bus
2. Control Unit issues read signal to read the next instruction from memory → places this signal on the control bus
3. Instruction at the address in RAM is placed on the data bus
4. Instruction travels from RAM to the CPU along the data bus
10
New cards
Decode

1. Control unit decodes the fetched instruction so that it can be executed
11
New cards
Execute

1. Instruction is carried out
12
New cards
Primary memory
* Directly accessible by the CPU


* Stores boot (start-up) instructions (ROM) or data/instructions for running programs (RAM)
* Internal (inside the computer)
* Faster access
* Volatile (RAM) or non-volatile (ROM)
13
New cards
Secondary
* Not directly accessible by the CPU
* Internal or external
* Stores files/software relating to programs that are (generally) not currently running
* Slower access
* Non-volatile
* HDDs and SSDs
14
New cards
SSDs
* Secondary memory
* Faster read/write times
* No moving parts
* More expensive than HDD
* Lower capacity than HDD (e.g. 500 GB)
* Less power consumption
* Less heat generation
* Uses flash memory (transistors) (non-volatile)
* Current passed through each transistor can store charge to represent 0 or 1
* Limited number of read/write cycles so they slowly wear out after you've used them for a long time.
15
New cards
HDDs
* Secondary memory-
* Magnetic coating on surface can be changed to represent 1 or 0
* High capacity (e.g. 2 TB)
* Concentric tracks
* Slower access (higher latency) due to moving parts
* Higher power consumption due to moving parts
16
New cards
Optical disks
* Secondary memory
* Uses low-powered lasers to read and write data, causing different reflections interpreted as a 0 or 1
* High-powered lasers etch Pits and lands to represent 0 or 1 on a reflective surface
* Single spiral track (like a vinyl record)
* Low capacity compared to SSD and HDD (e.g. 5-50 GB)
17
New cards
Embedded Systems
* Designed for **one specific function**
* **Built-in** to **another machine**
* **Inputs** e.g. buttons, sensors
* **Outputs** e.g. screens, audio, actuators
* Has **microcontroller** with **CPU for** processing (and own memory)
* Flash memory (ROM) is **non-volatile** so stores data and instructions: ‘firmware’
* RAM is **volatile** and stores temporary input data from user and sensors
18
New cards
Internet of Things
* Physical objects equipped with sensors, processors and software that are able to connect to the internet and exchange data
* Concerns with security (e.g. vulnerability to hackers taking control/intercepting)
* Concerns with privacy (e.g. Extent of data collection and consent, ethical usage)
19
New cards
Operating System
* **Controls hardware** of a computer system and **how other programs use it**
* Has a **UI** for human user communication and use
* Composed of many **separate programs** with **different functions**
* Also has **utility programs** for management
20
New cards
Operating System Functions: File Management
* User permissions
* File management functions
* Organizing files into directories, folders, subfolders
21
New cards
Process Management
* Deciding when and which processes use the CPU through **scheduling**
* Hence can multitasking
* Make sure a process does not overwrite the memory address of another process
22
New cards
Peripheral management
* For devices that **are not part of the main computer system**
* **OS manages communication** between computer and peripheral using a **device driver (small program containing instructions)**
* Can allocate the device a **small area of memory**
* Can be **updated** to remove bugs or incorporate new types of hardware
23
New cards
Memory management
* OS **allocates** a separate address space to each running process
* OS **protects** memory so one process cannot access the memory of another
* Hence **several programs can run simultaneously**
24
New cards
Virtual Memory
* The address space allocated to each running process is **a virtual address**
* OS can swap **data/instructions** for a running process **from RAM** and store it **temporarily on the disk** even though the process is still running
* Because the OS stores a **table** which **maps** virtual to physical addresses
* When a process uses their virtual address to request data, the OS **looks up the physical address** using that table
* Since processes only see their virtual address, the physical address can be in **cache, RAM or the disk**
* This is done when the process has not been used for some time to **make room for a new process**.
* The process can be **swapped back into RAM** when it is needed.
* In this way the operating system can **run more programs** than it would be able to if it only used RAM to store process data.
25
New cards
User Interface
* The means by which users easily interact with the OS
* **Command Line Interface:** Typed commands so **more difficult to use** but **more precise control** and **less memory/CPU usage**
* **Graphical User Interface:** Windows, buttons etc. so **easier to use** but **less precise control** and **greater memory/CPU usage**
* The means by which users easily interact with the OS
* **Command Line Interface:** Typed commands so **more difficult to use** but **more precise control** and **less memory/CPU usage**
* **Graphical User Interface:** Windows, buttons etc. so **easier to use** but **less precise control** and **greater memory/CPU usage**
26
New cards
Authentication
* Mechanism for users to prove their identity
* e.g. **Username + password**, **biometrics**, **MFA**
27
New cards
Scheduling
* How the **OS decides** which processes can use **CPU**
* **OS Swaps processes** in and out and give each a certain amount of time (**time-slicing)**
* **Time-slicing** gives the process **exclusive use** of the CPU


1. Round-robin: **Queue** system, fair policy
2. First come first serve: **Reduce total waiting time**
3. Priority scheduling: **Highest priority** use first
28
New cards
Utilities
* File repair: Detect and correct errors in files (if possible).


* Backup: Creates a copy of files so that they can be restored if the original file is lost or damaged
* Data compression: Creates a new version of files using **fewer bits** than the original.
* Compression **saves disk space**, but it **takes time** to compress and decompress files.
* Files **need to be decompressed** before they can be used again.
* Disk defragmentation: Over time, data on disks becomes split up into on different parts of the disk. This slows the system down. A defragmentation utility reorganizes programs so all their parts are **next to each other**.
* Anti-malware: Detect, and quarantine or remove malware threats.
29
New cards
Robust Software
* Handle unexpected input without crashing
* Does not reveal sensitive information, even when something goes wrong.
30
New cards
Methods of Developing robust software
Audit trails

* Keep track of all changes made and who made them
* More **accountability**
* Can **roll back** to working version before an error

Code reviews

* Peer review
* **More experienced** programmer checks for **bad practices, security vulnerabilities, inefficient code** and **adherence to requirements**
* Time consuming, labour intensive
* Automated review
* Special program, cheap
* May not spot some times of problems
31
New cards
Consequences of security vulnerabilities
Criminals exploit vulnerabilities to:

* Damage or **destroy data** or computer systems


* Gain access to **sensitive information** such as passwords or credit card numbers
32
New cards
High-level Languages
* Like human language → **Easier to understand**
* Need compilation or interpretation before execution
* **More portable**, runs on different architectures
* Have **libraries** for common tasks e.g. UIs, buttons
* **Less control** as one instruction can be several machine instructions
* Good for **general tasks** when:
* Efficiency and precision less important
* **Standard libraries are required**
* Low level would be complex for e.g. UIs
33
New cards
Low-level languages
* Assembly/machine code
* No translation needed
* Each instruction is a machine instruction
* **Runs faster, uses less memory**
* Always needs **many lines of code**
* **Very difficult to understand**
* **Not portable**, code written for only one architecture
* Good for **real-time systems** when:
* Need efficiency and precision
* **Controlling hardware, device drivers**
34
New cards
Compilation
* Translated:
* **In one go**
* **Before** the program runs
* **Once**
* Produces a **new (.exe) file**
* Runs **faster**
* Needs to be **recompiled if:**
* Run on different OS
* Program is changed → less portable
35
New cards
Interpretation
* Translated:
* **Line by line**
* **Every time it is run**
* **While** the program runs
* **No new file**
* Runs **slower**
* Can run on different OS if have interpreter → **more portable**