Computer Systems 1 Flashcards

1
Q

Define the term ROM.

A

ROM stands for read-only memory which is a permanent storage of memory located on the motherboard of a computer. ROM contains the very first instructions when the computer is first switched on, and is involved in the computer’s bootstrap. ROM is non-volatile therefore memory is not lost once the computer is switched off.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Define the term RAM.

A

RAM stands for random-access memory which is a temporary storage of instructions and data. RAM is used in order to hold data and instructions that are currently being executed by the processor. RAM is volatile therefore memory is lost once the computer is switched off. RAM is a form of primary memory, therefore accessing memory from RAM is much faster than accessing memory from the hard disk.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

List 10 uses of GPUs.

A
  • Render graphics.
  • Run simple, repetitive calculations.
  • Oil exploration.
  • Weather modelling.
  • Architecture and design modelling.
  • Machine learning.
  • Linear algebra.
  • Statistical analysis.
  • Stock option predictions.
  • Gravitational field theory.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

List 4 characteristics of high performance CPUs.

A
  • A high performance CPU can contain multiple cores where each core can fetch, decode and execute its own instructions.
  • A high performance CPU can have a fast clock speed.
  • A high performance CPU can have the ability to use pipelining.
  • A high performance CPU can have a large cache.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Explain the term paging.

A

Paging is a form of memory management where memory is divided into fixed size pages. Pages are physical divisions and they are made to fit sections of memory. Programs are split into fixed, equal sizes in order to fit into available pages in memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Explain the term segmentation.

A

Segmentation is a form of memory management where memory is divided into segments of variable size. Segments are logical divisions where programs are divided into complete sections. Segmentation places sections of programs into available free spaces in memory, leaving small areas of free space.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Why would segmentation be recommended over paging?

A

Paging takes no account of the contents of the program and splits the program into fixed sizes. Therefore it is possible for it to separate the instructions inside of a looping conditioning place them into different pages which wouldn’t be efficient. It is better to keep those instructions together in memory which is why segmentation can be considered a better choice.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Explain two advantages of memory management.

A
  • Memory management allows programs to run despite insufficient memory.
  • Pages and segments are stored on the hard disk and are transferred into memory when needed.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Explain the purpose of a multi-tasking operating system.

A

A multi-tasking operating system allows the user to have more than one application or program running at the same time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Explain the purpose of a multi-user operating system.

A

A multi-user operating system allows more than one person to use a computer at the same time. The computer will manage the user’s various permissions and access rights when they log on. The server operating system software will handle the requests of multiple people using different computers on a network at the same time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Explain the purpose of a distributed operating system.

A

A distributed operating system combines the processing power of multiple computers across a network for a single task. The operating system controls and coordinates the computers, presenting them to the user as if they were a single system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Explain the purpose of an embedded operating system.

A

An embedded operating system is a computer system that exists in a number of commonly used devices.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Explain the purpose of a real-time operating system.

A

A real-time operating system is used in safety-critical environments where processes are guaranteed to execute within a known time frame.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

List 3 advantages of a client-server model.

A
  • It is easy to manage file security in one location.
  • It is easy to back up shared data in one location.
  • It is easy to install software updates to all computers in one location.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

List 3 disadvantages of a client-server model.

A
  • It can be expensive to set up and maintain.
  • IT specialists are required for maintenance which can be expensive.
  • Users will lose access if the server fails, therefore the server is a central point of failure.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

List 3 advantages of a peer-to-peer model.

A
  • It is very easy to set up and maintain.
  • Specialist staff aren’t required for installation and maintenance.
  • It is cheaper to set up than a client-server model, since there are no expensive hardware involved.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

List 3 disadvantages of a peer-to-peer model.

A
  • The network is less secure.
  • Users will need to manage their own backups.
  • It can be difficult to maintain a well-ordered file store.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Define the term firewall.

A

A firewall is a piece of hardware or software, or both, configured to monitor, filter and block traffic travelling to and from a network.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

List 3 purposes of a firewall.

A
  • A firewall may prevent unauthorised traffic from outside a LAN.
  • A firewall may prevent users in a LAN from accessing parts of the internet prohibited by the company they work for.
  • A firewall can also inspect data travelling across it to see if it looks suspicious, therefore protecting the company’s data and intellectual property.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Define the term linked list.

A

A linked list is a dynamic data structure constructed from nodes and pointers. Each node consists of data and a pointer, and the pointer gives the location of the next node. A linked list provides a foundation upon which other data structures can be built, such as stacks, queues, graphs and trees.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Explain how to remove an item from a linked list.

A

In order to remove [name], you first need to check if the linked list is empty. If there is no start node, then output and report an error. The start node is [name1] and the linked list is not empty. The first item [name1] is not the item to be deleted, so the start pointer stays pointing at the first node.
You proceed through the linked list from [name1], comparing each subsequent item until the item to be deleted is found. [name] is found at the [position_node], so the previous node’s pointer [name2] is updated to bypass [name] and point to the next node [name4]. [name] is now ignored and now the linked list follows the order [name1], [name2], [name3].

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Explain how to add an item to a linked list.

A

In order to add [name], you first need to check if there is free memory for a new node to hold [name]. If there is no free space, then output and report an error. The new node [name] is created and is placed into the next free space. You then need to check if the linked list is empty. The linked list is not empty so [name] doesn’t become the first node. You then need to check if the new node should be placed before the first node. [name] comes after [name1] so you proceed through the linked list from [name1], comparing each subsequent item, until the position where [name] will be added is found, after [name4]. The last node [name4] remains in its original position and now points to the new node [name], and the new node’s pointer [name] now points to null since it doesn’t point to another item.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

List 6 uses of link lists.

A
  • Linked lists can be used by operating systems managing a processor to store process block in a ready state.
  • Linked lists can be used for image applications to switch between previous and next images.
  • Linked lists can be used for music applications when a listener stores tracks in a playlist.
  • Linked lists can be used for web browsers to navigate between previous and recently visited web pages.
  • Linked lists can be used for hash table collision resolutions as an overflow.
  • Linked lists can be used to maintain a file allocation table of linked clusters on secondary storage.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

List 2 uses of hash tables.

A
  • Hash tables can be used by file systems, linking a file name to the path of the file.
  • Hash tables can be used for identifying the keywords in a programming language during compilation.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Explain the reason why a hash table may be better suited than a linked list.

A

Hash tables can be used in situations where items in a large data set need to be found and accessed quickly. Hash tables have a constant time complexity O(1) whereas linked lists have a linear time complexity O(n). This is because a linked list requires every node to be checked until the desired item is found, whereas a hash table enables direct access to the location of the item. Therefore, a linked list will take longer to search through as more nodes are added, whereas the time it takes to search through a hash table won’t change as more nodes are added.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

List 4 purposes of file compression.

A
  • Reduce the size of files.
  • Reduce download times.
  • Reduce storage requirements.
  • Make best use of bandwidth when transmitting data, therefore data usage for the person on the receiving end is less expensive.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

List 2 uses of lossless compression.

A
  • Lossless compression is used for text documents.
  • Lossless compression is used for executable programs.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

Explain why lossless compression may be better suited than lossy compression.

A

Text documents and executable programs must not lose any of the original data during compression, therefore lossless compression is needed in order to restore the file in its entirety. If lossy compression was used, some of the original data and information will be lost, therefore making the uncompressed file unreadable for the user.

29
Q

An organisation looks at using either run-length encoding or dictionary encoding to compress their text files. Discuss the two compression methods and justify which you would recommend, using the examples.

A

Dictionary encoding is a method of compression that is best suited for the compression of text-based documents. During dictionary encoding, a dictionary is created to record every data item or entry in the file, along with an indexed reference, unique code or symbol. In this example, [first_word] could be assigned the index 1, [second_word] could be assigned the index 2, and so on. Repeats of the same data item will not be assigned a new index. The space character will also be taken into account, and given an index. The compressed file will only consist of the dictionary index, and the sequence of occurrences needed to recreate the original file. The space character will appear after every data item in the sequence of occurrences, for example the sentence [sentence] could represent: 1, 8, 2, 8, 3, 8, 4, 8, 5; with 8 representing the space character. When the file is uncompressed, the dictionary is used to replace the sequence with the original text. This method of compression significantly reduces the number of bits stored in memory by replacing each word that consists of many 8-bit characters with a number that represents just one 8-bit.

On the other hand, run-length encoding is a method of compression that is best suited for the compression of bitmap images. This method would not be suitable for this organisation since run-length encoding works best at representing many contiguous elements of the same symbol, and it stores this information in frequency pairs: the symbol with the number of occurrences in the file, for example, AAABBBBBBCC could be represented as 3A6B2C, showing that there are 3 A symbols, 6 B symbols, and 2 C symbols in a row. A text file will have very few contiguous characters of the same type which is evident in this example. There are only the contiguous letters [letters] and [letters] which can be represented as [number_letter][number_letter]. Only when a file has many contiguous symbols of the same type, will this method of compression significantly reduce the number of bits stored in memory.

With both being lossless compression techniques, both run-length and dictionary encoding utilise a method of encoding data that allows a file to be recreated in its original quality. However, run-length encoding would not be suitable at all for this organisation since they aren’t dealing with images, let alone bitmap images, but text files with few repeating contiguous characters. Therefore it will have very little if no effect when the file is compressed and uncompressed.
Dictionary encoding would be a very suitable method for this company since they are looking to compress text files.

30
Q

Explain dictionary encoding.

A

Dictionary encoding is a method of compression that is best suited for the compression of text-based documents. During dictionary encoding, a dictionary is created to record every data item or entry in the file, along with an indexed reference or unique code. In this example, [first_word] could be assigned the index 1, [second_word] could be assigned the index 2, and so on. Repeats of the same data item will not be assigned a new index. The space character will also be taken into account, and given an index. The compressed file will only consist of the dictionary index, and the sequence of occurrences needed to recreate the original file. The space character will appear after every data item in the sequence of occurrences, for example the sentence [sentence] could represent : 1, 8, 2, 8, 3, 8, 4, 8, 5; with 8 representing the space character. When the file is uncompressed, the dictionary is used to replace the sequence with the original text. This method of compression significantly reduces the number of bits stored in memory by replacing each word that consists of many 8-bit characters with a number that represents just one 8-bit.

31
Q

Explain run-length encoding.

A

Run-length encoding is a method of compression that works best at compressing files in which there are many contiguous elements of the same symbol. Run-length encoding stores this information in frequency pairs: the symbol with the number of occurrences in the file, for example, AAABBBBBBCC could be represented as 3A6B2C, showing that there are 3 A symbols, 6 B symbols, and 2 C symbols in a row. This method of compression significantly reduces the number of bits stored in memory by replacing a group of contiguous symbols of the same type with its symbol and a single number.

32
Q

Explain run-length encoding with a bitmap image.

A

In order to recreate the image using lossless compression, every pixel will need to be recreated. Bitmap images consist of discrete pixels and are much easier to compress than real images due to the fact that they have many contiguous pixels of the same colour. With two colours, the image can be encoded with a colour depth of one bit. Since there are many repeating sequences of 0s and 1s, the information can be stored in frequency or data pairs. This method of compression significantly reduces the number of bits stored in memory by replacing a group of contiguous pixels of the same colour with a single number.

33
Q

Express De Morgan’s law.

A

¬(A∨B) ≡ ¬A∧¬B
¬(A∧B) ≡ ¬A∨¬B

34
Q

Express the double negation law.

A

¬(¬A) ≡ A

35
Q

Express the distribution law.

A

A∨(B∧C) ≡ (A∨B)∧(A∨C)
A∧(B∨C) ≡ (A∧B)∨(A∧C)

36
Q

Express the commutation law.

A

A∧B ≡ B∧A
A∨B ≡ B∨A

37
Q

Express the association law.

A

(A∨B)∨C ≡ A∨(B∨C) ≡ A∨B∨C
(A∧B)∧C ≡ A∧(B∧C) ≡ A∧B∧C

38
Q

Express the absorption law.

A

A∨(A∧B) ≡ A
A∧(A∨B) ≡ A

39
Q

Express the identity law.

A

X∨0 ≡ X
X∧1 ≡ X

40
Q

Express the annulment law.

A

X∨1 ≡ 1
X∧0 ≡ 0

41
Q

Express the idempotent law.

A

X∨X ≡ X
X∧X ≡ X

42
Q

Express the complement law.

A

X∨¬X ≡ 1
X∧¬X ≡ 0

43
Q

State the purpose of encryption.

A

The purpose of encryption is to make the original message (file, password, code) impossible to crack without having the key.

44
Q

Describe one method that can be used by a film studio to prevent companies from showing its latest film before release date.

A

One method could be to encrypt the film, and then send the key out to each company on the release date, to ensure that the contents of the film cannot be viewed before this date.

45
Q

Explain what the command DAT in a program written using the Little Man Computer instruction set does.

A

The command DAT stores a value [value] in a memory location [memory_location] which is given a label [name].

46
Q

Give one instruction from the Little Man Computer instruction set that, when a program is executed, changes the value in the accumulator.

A
  • LDA
  • ADD
  • SUB
  • INP
47
Q

Give one instruction from the Little Man Computer instruction set that, when a program is executed, changes the value in the program counter.

A
  • BRZ
  • BRP
  • BRA
48
Q

Give one instruction from the Little Man Computer instruction set that, when a program is executed, copies the contents of the accumulator to memory.

A
  • STA
49
Q

Give one instruction from the Little Man Computer instruction set that, when a program is executed, ends the program.

A
  • HLT
50
Q

Give one instruction from the Little Man Computer instruction set that, when a program is executed, produces a result.

A
  • OUT
51
Q

Explain how, using bit shift, the unsigned binary number 00101100 can be divided by 4.

A

The unsigned binary number [number] can be divided by 4, if you perform a logical binary right shift of 2 bits. The binary number will become [new_number], after shifting two places to the right.

52
Q

Explain how, using bit shift, the unsigned binary number 00101100 can be multiplied by 2.

A

The unsigned binary number [number] can be multiplied by 2, if you perform a logical binary left shift of 1 bit. The binary number will become [new_number], after shifting one place to the left.

53
Q

Define the term primary key.

A

A primary key is a field within a database table that guarantees a unique identifier for each record, such as the primary key [primary_key].

54
Q

Define the term foreign key.

A

A foreign key is a field that relationally links to another table and becomes that table’s primary key.

55
Q

Define the term hashing.

A

Hashing is a one-way transformation of a string of characters into a fixed-length value or key that represents the original input string.

56
Q

Define the term hash.

A

A hash represents a string of characters that has been transformed into a fixed-length value or key by applying an algorithm or numeric process that cannot be reversed.

57
Q

Explain one advantage of storing a password as a hash.

A

By storing a password as a hash, it is impossible to get back to the original value even if you have access to the original hashing algorithm. This process is irreversible, therefore any hacker who has access to the password file, will only be able to see hashed values and cannot obtain any actual passwords.

58
Q

List 3 uses of hashing.

A
  • Hashing can be used for quick searching, insertion and deletion of data from data structures.
  • Hashing can be used to validate credentials such as passwords.
  • Hashing can be used in file systems for quick searching and for validating file copies.
59
Q

Write an SQL statement that outputs the population of Albania from a database called world. Fields to consider: population, name.

A

SELECT population
FROM world
WHERE name = “Albania”

60
Q

Write an SQL statement that outputs the name, continent, area, population, gdp and capital of Algeria from a database called world. All fields: name, continent, area, population, gdp, capital; from the database are used.

A

SELECT name, continent, area, population, gdp, capital
FROM world
WHERE name = “Algeria”

/OR/

SELECT *
FROM world
WHERE name = “Algeria”

61
Q

Write an SQL statement that outputs the name and continent of all countries with a population greater than 10000000 that begin with the letter A in ascending alphabetical order from a database called world. Fields to consider: population, name, continent.

A

SELECT name, continent
FROM world
WHERE name LIKE “A%”
AND population > 10000000
ORDER BY name ASC

62
Q

Write an SQL statement that outputs the name and continent of all countries that begin with the letter A and the countries that begin with the letter B in ascending alphabetical order from a database called world. Fields to consider: name, continent.

A

SELECT name, continent
FROM world
WHERE name LIKE “A%”
OR name LIKE “B%”
ORDER BY name ASC

63
Q

Write an SQL statement that outputs the name of a country from a database called world that has a higher population than the population of Algeria.
Fields to consider: name, population.

A

SELECT name
FROM world
WHERE population >

<indent_here>
(SELECT population
FROM world
WHERE name = "Algeria")
</indent_here>

64
Q

Write an SQL statement that inputs a new record into a database called world with the following information.
- name: Oz
- population: 1000000
- capital: Emerald City

A

INPUT INTO world (name, population, capital)
VALUES (“Oz”, “Emerald City”, 1000000)

65
Q

Write an SQL statement that deletes all records from a database called world with a population greater than 10000000.
Fields to consider: population.

A

DELETE FROM world
WHERE population > 10000000

66
Q

Write an SQL statement that updates the country with the capital Emerald City from a database called world to change its population to 2000000 and its name to Wonderland.
Fields to consider: population, name, capital.

A

UPDATE world
SET name = “Wonderland”, population = 2000000
WHERE capital = “Emerald City”

67
Q

Write an SQL statement that outputs the surname and tutor room of a student from a tutor group called 10B, given that surname is a field from a database called student_table and tutor room is a field from a linked database called tutor_group. The field tutor_group is both a primary and foreign key.
Fields to consider: surname, tutor room, tutor group.

A

SELECT student_table.surname, tutor_group.tutor room
FROM student_table
JOIN tutor_group
ON student_table.tutor group = tutor_group.tutor group
WHERE student_table.tutor group = “10B”

68
Q

Write an SQL statement that deletes the table student_table from a linked database called tutor_group.

A

DELETE TABLE student_table