Topic 3 Computers

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/49

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

50 Terms

1
New cards

Stored Programming Concept

A new computer architecture storing both data and program instructions alongside each other in a computer’s main memory.

→ This allows computers to be reprogrammed to carry out out different tasks

2
New cards

Von Neumann architecture

consists of a main memory and a CPU (central processing unit), interconnected by buses

3
New cards

Characteristics Main memory

  1. only holds the instructions that are currently in use by the CPU

  2. volatile: contents are lost when the power is switched off

  3. consists of a collection of storage locations, each with its own unique address (a storage location can hold a program instruction or a piece of data)

  4. referred as RAM(random access memory) because storage locations can be read from and written to in any order

  5. classed as primary storage because CPU has direct, fast access to it

4
New cards

5 Components of the CPU

1) Control Unit

2) Arithmetic logic unit

3) Registers

4) Clock

5) Buses

5
New cards

Control Unit (CU)

  • fetches program instructions from the main memory one at a time

  • decodes them

  • and directs the other components of the CPU to execute it

6
New cards

Arithmetic logic unit

performs arithmetic(mathematical) and logical operations on data

7
New cards

Registers

  • small, fast memory locations used to store program instructions, intermediate results and data within the CPU

  • can have general purpose or specific functions

8
New cards

Clock

  • Regulates the number of fetch-decode-execute cycles carried out per second. The faster the clock, the more cycles per second.

  • synchronises other components

9
New cards

Buses

3 types of buses work together to transfer program instructions and data between the main memory and the CPU

  • Address bus

  • control bus

  • data bus

10
New cards

Address bus

  • holds the address of the memory locations that the CPU will read from or write to

  • unidirectional (CPU → main memory)

11
New cards

Control bus

  • carries signals between the CPU and other components of the computer system so they know whether to read or to write

  • bidirectional

12
New cards

Data bus

transfers program instructions and data between the CPU and the main memory

13
New cards

Fetch-decode-execute cycle: Fetch

  • CPU puts memory address of the next instruction on the address bus,

  • CU sends read signal along control bus.

  • Program instructions and data are transferred from main memory along data bus to the CPU, stored in registers

14
New cards

Fetch-decode-execute cycle: Decode

The CU looks up the program instruction the CPU’s instruction set

15
New cards

Fetch-decode-execute cycle: Execute

The CU coordinates operations of other components in the CPU to execute the instruction, e.g. ALU

16
New cards

Why is primary storage needed?

Primary storage (such as RAM, computer’s main memory) provides the CPU with fast, direct access to program instructions and data that’s currently in use. It only contains its contents temporarily.

17
New cards

Why is secondary storage needed?

Secondary storage is needed because it is non-volatile and provides long-term storage for data and program instructions that are not currently in use.

18
New cards

Types of Secondary Storage

  • Magnetic Storage

  • Optic Storage

  • Solid-state Storage

19
New cards

Magnetic Storage

  • Consists of a stack of circular, metal platters that spin at a high speed

  • Both surfaces of platter are coated with a substance that can be magnetised

  • Each platter has its own read-write head

Write: An electromagnet in the read-write head magnetises surface into one of two polarities : north, south which represent 1 or 0 in binary

Read: An electromagnet in the read-write head detects the magnetic state of the surface of the platter

Examples: Hard disk drives, magnetic tape drive

Advantages:

  • relatively cheap

  • infinitely rewritable

  • high capacity

  • lasts a long time

  • FAST DATA ACCESS

Disadvantages :

  • contains moving parts so is easily damages when dropped or banged

  • noisy

20
New cards

Optical Storage (CD’s, DVD’s)

  • Write : Laser burns marks into the reflective surface of the disk, called pits. Pits are less reflective and represent 0. Lands are reflective and represent 1.

  • Read : Laser beam is shone onto the surface of the risk and light sensor detects if light is reflected.

Advantages:

  • small, portable

  • cheap

  • lasts a long time

Disadvantages:

  • easy to scratch

  • limited reusability

  • slow to access

21
New cards

Solid-state storage (SSDs, USB sticks, portable and mobile devices)

Write: Electrons are trapped into pools,

a full pool represents 0 and an empty pool represents 1

Read : A voltage is applied, if the pool is empty the transistor turns on and a 1 is read out. If the pool is full the transistor does not turn on and a 0 is read out.

Advantages:

  • reliable, no moving parts

  • very fast data access

  • low power consumption

  • quiet

Disadvantages:

expensive

limited number of read-write cycles

22
New cards

Embedded systems + Characteristics

A small computer that performs a specific task within a larger system.

1) they work in real-time, they respond immediately to requests

2) they have minimal user interface

3) They are responsive to their environment

4)They have limited memory

5) low power consumption

6)wireless connectivity

7)single purpose

23
New cards

Hardware components of an embedded system

24
New cards

Operating system

  • provides interface between the hardware and the software of the computer, also provides interface for the user

Main tasks:

  • User management

  • File management

  • Process management

  • Peripheral management

25
New cards

User management

  • Access control: The OS uses biometrics or password to authenticate users and control who can log on in shared computers

  • provides an user interface, enabling them to interact with the computer

  • GUI- Graphical user management, uses WIMP(windows, icons, menus, pointers)

  • CLI- only allows user to type in commands, lighter and more efficient, used by experts who want more control

  • File permissions (Read, write, execute, delete)

  • OS enforces the file permissions associated with each user.

26
New cards

Process management (processes are programs loaded into the CPU)

  • oversees the execution of instructions, allocates each of them a share of CPU time(since it can only execute one instruction at a time) and main memory

  • The OS uses a scheduling algorithm to do this

27
New cards

Round Robin

  • Each process gets time slices. The process with higher priority gets more time slices.

  • The processes wait in a queue. The process at the front of the line gets to use the CPU next

  • During its time slice, a process has exclusive use of the CPU

  • If it’s still unfinished, it goes to the back of the queue waiting for its next turn

28
New cards

Peripheral management

peripheral = additional piece of hardware such as printer, keyboard, mouse,…

  • The OS uses device drivers to communicate with the peripherals. The device drivers are installed on a computer’s hard drive and must be kept up to date to keep the peripherals functioning.

29
New cards

Memory management

Process that’s loaded into main memory from 2ndary storage gets allocated a block of addresses called pages.

When a computer’s memory becomes full, the OS uses a paging algorithm to move inactive processes out of main memory into an area of the hard drive called virtual memory. This frees up space.

30
New cards

File management

OS manages and tracks files stored on a computer’s hard drive. Files are stored in a hierarchical tree structure. The top node is the root directory (a directory is a folder containing other items). The nodes further down are either sub-directories or files.

31
New cards

2 types of important softwares

  • utility software

  • robust software

32
New cards

Utility softwares

  • data compression software

  • disk defragmentation software

  • backup software

  • file repair software

  • anti-malware software

33
New cards

Data compression software

  • Repackages (lossless compression) or removes (lossy compression) some of the file’s data to reduce its size.

  • This frees up space in the secondary storage and makes the files quicker to be transferred across networks.

34
New cards

Disk defragmentation software

  • happens only in magnetic storage due to moving parts

  • rearranges individual file blocks into sequential order which speeds up access to files on a magnetic hard drive

35
New cards

Backup software

  • Backup of files are made at regular intervals and stored in a different location to the current working environment, possibly the cloud.

  • This keeps a copy of the file so the most recent backup can be restored when a file gets lost or damaged.

36
New cards

File repair software

  • Scans the damaged file and extracts as much data as possible and stores it in a new usable file.

  • It aims to recover data from and repair files that has been corrupted by a cyberattack or computer malfunction.

37
New cards

Anti-malware software

  • Protects computer systems from damage caused by malware, such as viruses, worms, and spyware

  • Some use a data base of malware signatures(patterns) to detect malware and quaratines or eventually deletes it if it’s the case.

  • Some use heruristic analysis to detect suspiscious behaviour, such as a program that remains in memory after it has finished executing.

38
New cards

Robust software

A program that is able to handle unexpected actions without crashing or producing incorrect output, free from vulnerabilities that can be exploited by criminals

39
New cards

Code vulnerabilities

Hidden weaknesses in a program/code that could pose security threats and be exploited by criminals to cause damage and gain access to confidential information.

40
New cards

Things programmers can do to make their program robust:

  • Good programming practices

  • Carry out regular code review

  • Keep an audit trail

(Bad programming practices include: insufficient planning, insufficient testing, poorly structured code, quick fix rather than well-considered solutions, …)

41
New cards

Code reviews

  • Check that software adheres to agreed standards

  • to find any instances of inefficient code

  • Find any instances of bad programming practices

  • identify potential vulnerabilities

carried out by other programmers or a specialised software

42
New cards

Audit trails

  • helps improve accoutability by keeping track who made what changes during what process.

  • when a problem is discovered, it can tracked back to its source ad rolled back to a version before the flaw was introduced

43
New cards

Characteristics of low-level languages

  • one line is one instruction only

  • they are machine-specific, so they can manipulate the hardware directly- but this also means they are platform dependent and cannot be run on a computer with a different type of CPU

  • interact directly with the hardware, enabling the memory to be used efficiently

  • Machine code / Assembly language

  • Example: device drivers and embedded systems

44
New cards

Machine code

  • written in binary so it can be directly processed by the CPU without translation

  • extremely hard to debug and to write

45
New cards

Assembly code

  • uses short, memorable keywords called mnemonics to represent the instructions, making it easier for humans to understand

  • must be translated to machine code before they can be executed by the CPU

46
New cards

High-level langauges

Java and Python etc.

  • use keywords in english, easier to write and debug

  • problem-oriented, allow programmers to focus on logic

  • has libraries with pre-set funtions

  • must be translated before it can be executed by a CPU

  • not platform dependent, can be used on computers with a different type of CPU

  • used in softwares

47
New cards

Compilers

  • takes in the source code as a whole and translates it into object code in one go

  • produces an executable file that hides the source code, protecting the original code from competitors

  • the program runs more quickly when it’s executed because it is already translated into machine code

  • translation is only done once as a separate process

  • Errors are reported at the end of the translation

  • changing the program requires going back to the the source code and recompiling the code to execute it

  • machine-dependent, cannot be run on computers with a different type of CPU

48
New cards

Interpreters

  • translates and runs the program one line at a time

  • as the source code is translated line by line while execution is happening, the program runs more slowly

  • stops translating and reports the error as soon as one is encountered, (so the programmer know where exactly the error is)

  • code is not platform-specific and can be run on any computers with a suitable interpreter

  • the program can be easily edited as it alwys exists as source code, but this exposes the source code to competitors

49
New cards

Assemblers

translate mnemonics of Assembly languageto machine code. There is one assembly language instruction for each machine-code instruction

50
New cards

Differences between Interpreter and Compiler

  • A compiler translates the whole source program in one go before execution and produces an executable file, while an interpreter translates and executes the program line by line.

  • Errors are reported at the end after a compiler has finished translating, whereas errors are reported by the interpreter as soon as they are encountered. The interpreter will stop translating.