Computer Science Flashcards

1
Q

What does the address bus do?

A

Carries a memory address of an instruction in the main memory to be read and carried back to the CPU

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

What does the control bus do?

A

Directs and monitors components in the computer by sends signals from the CPU such as read/ write signals to the RAM.

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

What does the ALU do?

A

Arithmetic operations, logical comparisons, boolean logic and logical shifts. Include examples of each

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

How is an instruction split up?

A

Opcode: what needs to be done (add)
Operand: what it is being done to (data)

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

What happens in fetch part of the cycle

A

Next instruction copied from PC to MAR

CU loads it onto the address bus and sends a read signal through the control bus

Instruction sent from RAM to MDR by data bus

Copied to CIR

PC incremented by 1

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

What happens in the decode part of the cycle?

A

CU checks that the instruction is recognised, reads it and prepares the CPU for execute

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

What happens in the execute part of the cycle?

A

Uses the ALU to manipulate data and might store in the accumulator
May write to RAM, load more data from RAM etc

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

What does the clock do?

A

Constantly ticks by varying power to the CPU to synchronise actions in the CPU. Higher clock speed means more instructions per second

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

What does multicore mean?

A

Multiple processing units on a single Cpu chip that can process instructions separately at the same time.

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

What is pipelining?

A

When cores are assigned fetch, decode and execute. Each instruction is passed through each core for each stage of the FDE cycle

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

What is the difference between SRAM and DRAM?

A

Static RAM is more expensive and faster found in cache

Dynamic RAM is used in main memory and needs a constant refresh signal to keep capacitors charged

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

What characterises a Von Neumann computer?

A

Data and software stored together sharing bus
CU, ALU, registers
Way to input and output information

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

What characterises harvard architecture?

A

Separate memory for data and instructions
Data and instructions can be fetched at the same time with separate busses
More physical space needed
More expensive
Harder to handle two blocks of RAM

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

CISC vs RISC

A
Larger vs smaller instruction set
More vs fewer transistors required
More vs less heat
More vs less like 1 to 1 with machine code
Many vs one cycle per instruction
Worse vs better for pipelining
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What causes the CPU to flush the pipe?

A

When the CPU doesn’t precict a branch in code, the pipe is flushed to process the new instruction

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

What is SIMD processing?

A

Single instruction multiple data.
When data is arranged into an array or matrix and multiple ALUs perform the same or similar tasks on each of them. Cannot be done on sequential programs.

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

What is MIMD?

A

Multiple instruction multiple data.
A job scheduler assigns each processing core part of a task to do. It isn’t always possible to split every problem into as many parts as there are cores.

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

Storage device vs storage media

A

Storage device:
Writes data (DVD writer)
Storage media:
Stores data (DVD)

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

Attributes of magnetic storage:

A

Magnetic particles store data and read/write heads float over spinning platters. High capacity, low cost per gb, random access, good longevity.
Not that portable, moving parts, slow, loss of data in strong magnetic fields

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

Attributes of optical storage:

A

Laser burns puts into a disc and another laser reads it.
reflected/ scattered light represents 1s and 0s.
Cheap, good capacity for intended use, portable. Expensive for high capacity, slow read/ write easily scratched, no random access, cannot write over data.

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

Attributes of flash storage:

A

Electronic switches hold electric charge. Fast, high capacity, portable and durable, silent. Expensive, wears out after lots of use.

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

What is virtual storage?

A

When many storage devices are put together and a virtual storage controller makes them appear as one location. Used for high capacity requirements.

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

Purpose of an OS

A

Scheduling
Manages memory- loads programs, reuses memory and creates VRAM
Manages peripherals- handles I/O reqs, drivers
Utility programs
Security- logins, access to other user’s files
Provides a UI

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

What does the kernel do?

A
Loads/unloads programs from RAM
Scheduling tasks for the CPU
Memory management
Handles files in/ out of secondary storage
Data security
File management
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What are device drivers

A

system software that allows devices to interact with the OS. Separate driver per component. Different driver for each OS.

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

Utility program examples

A
File manager
Antivirus
Disk defragmentation
Encryption software
File compression
Installers
Clipboard manager
System monitor
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What are segments and why are they used?

A

Segments store each process in the CPU so they don’t write over each other. They don’t have the same size and are not next to each other.

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

How are segments split up?

A

Stack segment: stores addresses of instructions being interrupted by subroutines
Free memory: memory that is left free to allow the segment to expand
Data segment: space for variables to be stored
Code segment: stores all the instructions of a process

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

How does pagination work?

A

When VRAM is in use, memory is split up into FIXED UNITS next to each other.
The memory manager numbers them and records them in a page table.
When something needs to be fetched, the least used page is moved into VRAM and if its part of a segment, the pages holding the rest of the segment are moved too.
Free space is renumbered and marked as free.

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

What is a memory leak?

A

When poorly written programs don’t clear data from memory and or mark it as free

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

What is polling?

A

An alternative to interrupts, the CPU regularly checks if events/ peripherals need attention

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

What happens with an interrupt?

A

If the interrupt is of higher priority, the CPU runs the interrupt service routine after copying existing values in the registers to the stack.

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

What is a multitasking OS?

A

Allows many applications to run concurrently. Good for general purpose machines

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

What is a multi-user OS?

A

Allows many workstations to access a single powerful computer through a network. The OS keeps users secure from each other and shares CPU time. Example: self checkout machines.

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

What is a real-time OS?

A

Handles inputs within a guarenteed time. Reliable and consistent timings. Used in production lines, hospitals etc.

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

What is an embedded OS?

A

Designed for the specific function of the embedded system

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

What is a batch OS?

A

Does the same job for many inputs, different program for input, process and output. No user interaction necessary after setup.

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

What happens when a computer powers on?

A

Power supply stablilises
PSU tells CPU to execute hardware reset instruction in BIOS
Instruction jumps to start up program
POSTs
Checks for storage, GPUs and the OS
Finds the boot loader, holding the OS which runs the boot file

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

What is bytecode?

A

Code translated from source code before being interpreted into machine code by a VM. Allows programs to run on any PC.

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

What are applications?

A

Programs that don’t run in the background and provide a UI.

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

What is the difference between custom and bespoke software?

A

Custom software is when software is altered to fit the client’s needs whereas bespoke software is built from scratch, possible requiring experts from the client’s company to help develop it.

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

What happens in lexical analysis?

A

Identifies lexemes stored in the lexicon
Finds identifiers and adds them to the lexicon
White space and comments are removed
Lexemes are converted to binary tokens and are stored in the token table.

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

What happens in syntactical analysis?

A

Syntax analysis makes sure code follows the grammar rules of the language.
Semantic analysis makes sure that all declarations are semantically correct ie a string isn’t declared as an integer.
Mistakes are summarised in the compiler report

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

What happens in code generation?

A

Converts tokens into machine code stored in an object file, allocated memory addresses, records relative addresses of where code might jump to.
Optimisation: removes redundant code to maximise time/ memory efficiency

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

What are modules?

A

Different parts of a program that can be worked on by seperate programmers and are made into seperate object files.

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

what do static and dynamic linkers do?

A

Makes an executable file from object files and libraries (that may not be installed on the user’s machine). Static linkers create a new file with everything in it; dynamic linkers references external files so the loader retrieves it in runtime.

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

What do loaders do?

A

Make segments in memory and loads the program into them.

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

How to convert a positive to negative and a negative to positive in two’s compliment?

A

Pos to neg: flip bits and add 1

Neg to pos: minus 1 and flip bits

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

How do you do a signed right shift?

A

Numbers move right of the decimal point.

If the MSB is a 0, pad with 0s, if it’s a 1, pad with 1s

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

What is thinking ahead?

A

Identifying inputs and outputs
Deciding on data types
Researching information prior
Thinking about how to make program efficient before writing

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

What is thinking logically?

A

Identifying points where a decision has to be made

52
Q

What is thinking procedurally?

A

Understanding how a program will work before writing it. Example: a flow chart

53
Q

What is thinking concurrently?

A

Maximising efficiency by thinking about what parts of the program that can run simultaneously.

54
Q

What are the phases of the waterfall cycle?

A
Define requirements
Analysis
Design
Implement
Test
Install
Maintain
55
Q

What are the phases of Rapid Application Development

A

Each stage only gets added to the project with the client go ahead with the focus on a short time frame.

Requirements specification
Pilot prototype: not intended to be developed further but sees if something is feasible
Modelling prototype: tests if something fits the customer. Can be a throwaway or evolutionary.
Customer evaluation: feedback taken and criteria updated. Steps are repeated.

56
Q

Waterfall vs RAD

A

Low Vs high customer time commitment
Low vs high risk assessment
Simple vs complex to understand from outside
Each stage is vs isn’t approved by the client
Both not suited to large scale projects
Formal vs informal
Requirements must vs don’t have to be clear
Extensive vs relaxed documentation

57
Q

what are the jobs of the control unit?

A
  • Controlling and coordinating the activities of the CPU
  • Managing the flow of data between the CPU and other devices
  • Accepting the next instruction
  • Decoding instructions
  • Storing the resulting data back in memory
58
Q

what is ROM?

A

non-volatile read-only memory that stores the bootstrap

59
Q

what are some examples of scheduling techniques?

A
round robin
first come, first served
shortest job first
multi level feedback queue
shortest time remaining
60
Q

what is system software?

A

software that doesn’t provide a UI and runs in the background interacting with hardware and applications. An example of this is a device driver

61
Q

what is spiral development?

A

-Analysing system requirements
- Pinpointing and mitigating risks
- Development, testing and
implementation
- Evaluating to inform the next iteration

only suited to large scale, risky projects due to the expense of risk assessors

62
Q

what is agile development?

A
  • initial development with limited features
  • client feedback
  • extra build phase(s) to add more features
63
Q

what is extreme programming?

A

A form of agile programming, produces very useable code
-criteria agreed and test defined
-two programmers work on first iteration (one
programs the other critiques and they periodically
swap)
-code is tested
-client feedback, update criteria and programmers split it up into manageable tasks

64
Q

what are the modes of addressing?

A

immediate: operand is the data used
direct: operand is the address pointing to the data
indirect: operand is the address of the address of the data (such as interrupt tables)
indexed: operand is a constant added to the value in the index register to find address (used for data structures)

65
Q

what are the advantages of OOP?

A

-code reusable
-classes can be reused across projects
-encapsulation protects code
-can provide a more thorough design with less
vulnerabilities
-modularity makes code easy to maintain/ fix
-code can be abstracted from other programmers working on the project

66
Q

what are the advantages of procedural programming?

A
  • easy to learn
  • more efficient for problems with low code reusability
  • better for small programs
67
Q

where is the decimal point in a normalised floating point number?

A

between the first and second digits

68
Q

what is an XOR mask?

A

1 is only produced from 1 0 and 0 1

69
Q

what is the difference between a 1D array and a list?

A

lists can store multiple types of data and don’t store items contiguously in memory (dynamic)

70
Q

what is a linked list?

A

a dynamic, mutable list made of nodes containing data and pointers

71
Q

what are graphs made of?

A

vertices/ nodes and edges/arcs

72
Q

what are trees made of?

A

roots connected by branches to other nodes. children with no nodes are called leaves.

73
Q

what are the two types of collision handling in hash tables?

A

linear probing: moving to next available slot

chaining: making a linked list with overflow space

74
Q

what do you need to remember when converting a floating point binary number with negative mantissa and exponent into binary?

A

always do a SIGNED right shift (pad with the same number as the MSB)

75
Q

what format do floating point binary numbers come in?

A

mantissa will be normalised (with a decimal point)

exponent will be a whole twos complement number

76
Q

how are the sizes of pages and segments determined? (OCR answer)

A

pages are FIXED UNITS

segments are logical size ACCORDING TO ITS CONTENTS

77
Q

what do you do after ending the test?

A

redo all of the binary section

78
Q

what is breadth first traversal?

A

left to right, top to bottom like reading a book.

79
Q

what is the difference between a list, an array and a tuple?

A
  • a list is dynamic, mutable, non- contiguous and can store multiple data types
  • an array is static, mutable, contiguous and cannot store multiple data types
  • a tuple is static and immutable and can store multiple data types
80
Q

when asked for an lmc instruction, what do you write?

A

only the opcode (ADD / BRA) not the operand with it

81
Q

what is a utility program?

A

a program with one purpose that is used for the upkeep of the system

82
Q

what is an application?

A

a program that performs generic tasks for the user

83
Q

how do you write a long answer comparison question?

A

AO1: use obvious facts such as the different ways the options function
AO2: include positives and negatives of each that are a result of what was said in AO1
AO3: recommend and explain which one is suited to the given situation and what the other is suited to instead

84
Q

what is a distributed OS?

A

multiple computers/ resources working as one to work on the same problem.

85
Q

what is the pseudocode syntax for a for loop?

A

for i = 0 to n

next i

86
Q

why might a branch instruction pose a problem to pipelining?

A
  • one of two instructions may follow (only decided at execution)
  • the wrong next instruction may be fetched and decoded
87
Q

what is an interrupt?

A

a signal that gets sent to the CPU indicating that a device/process needs attention

88
Q

what are the two types of lossless compression?

A

Run length encoding: repeated values replaced with value and number consecutive appearances
Dictionary encoding: frequent sequences replaced with index that corresponds to sequence in dictionary

89
Q

how does asymmetric encryption work?

A

encrypting with private/ public key can only be decrypted with the other key. encrypt with receiver’s public key so they decrypt with their private key. to prove it was sent from you, encrypt with your private key also so it can be decrypted with your public key.

90
Q

what is an entity, record, attribute and field

A

entities are rows, a record is a specific row.

attributes are column, fields are specific boxes

91
Q

what do flat files look like?

A

record1(Attribute1, Attribute2, Attribute3, …)
record2(Attribute1, Attribute2, Attribute3, …)
record3(Attribute1, Attribute2, Attribute3, …)

92
Q

what is a secondary key?

A

an attribute that makes searching for records easier such as patient surname

93
Q

what are the 3 types of normalisation?

A

1NF: unique primary key, atomic (attributes cant be broken down), unique attribute names
2NF: must be in 1NF, each field must depend on all of the primary key even if the key is compound
3NF: must be in 2NF, all non-key attributes must not depend on other non-key attributes

94
Q

what ways are there of data capture?

A

manual input, magnetic ink character recognition (MICR used for cheques), optical mark recognition (OMR), optical character recognition (OCR)

95
Q

what is the general SQL structure of a search?

A

SELECT [attributes]
FROM [table]
WHERE [attribute] BETWEEN #value1# and #value2# ORDER BY [attribute] [asc/desc]

96
Q

what is an example of join SQL?

A

SELECT table1.attribute1, table2.attribute1, table1.attribute 2
FROM Movie
JOIN table2
ON table1.newattribute = table2.attribute1

97
Q

what is an example of create SQL?

A
CREATE TABLE TableName 
( 
Attribute1 [type] NOT NULL, PRIMARY KEY, 
Attribute2 [type] NOT NULL, 
… 
)
98
Q

how is alter used SQL?

A

adds/ deletes/ change data type of columns

ALTER TABLE TableName
ADD [attribute] [data type] /
DROP COLUMN [attribute] /
MODIFY COLUMN [attribute] [new data type]

99
Q

how is insert used SQL?

A

makes a new record
INSERT INTO (column1, column2, …)
VALUES (value1, value2, …)

100
Q

what is an example of update SQL?

A

UPDATE TableName
SET column1 = value1, column2 = value2 …
Where columnX = value

101
Q

how is delete used SQL?

A

DELETE FROM TableName

WHERE columnX = value

102
Q

what is referential integrity?

A

data that is depended apon elsewhere cannot be deleted so that references are always linked to data that exists

103
Q

how can databases be secured?

A

transactional processing: single operations on data only
record locking: two people cannot access the same record at the same time (can create deadlock though)
ACID
redundancy: storing duplicates of important data in different physical locations

104
Q

what does ACID stand for and what does it mean?

A

Atomicity:
A transaction must only be processed in its entirety
Consistency:
A transaction must maintain referential integrity
Isolation:
Simultaneous executions of transactions should lead to the same result as if they were executed separately
Durability:
Once a transaction has been executed it will remain so regardless of the circumstances surrounding it, such as in the event of a power cut

105
Q

what is a protocol?

A

a set of rules defining how to communicate over a network

106
Q

what are the 5 protocols you need to know

A

Hypertext Transfer Protocol (HTTP): webpage rendering
Transmission Control/ Internet Protocol (TCP/IP): routes
packets through networks
Post Office Protocol (POP3): downloads emails on client
computer
Internet Message Access Protocol (IMAP): downloads emails on server so it’s synched between devices
File Transfer Protocol (FTP): for transferring files over
the internet

107
Q

what is the application layer?

A

holds network protocols such as HTTP, FTP etc

108
Q

what is the transport layer?

A

establishes a connection between sender and receiver and they agree on settings such as packet size

109
Q

what is the internet layer?

A

assigns to and from address and routes packets across the network

110
Q

what is the link layer?

A

adds receiver MAC address. also contains network hardware standards and facilitates transmission of binary over any media

111
Q

what are the two methods of transmitting data across the internet?

A

packet switching: each packet travels a the most efficient route
circuit switching: direct link set up and data is sent both ways AT THE SAME RATE

112
Q

what does a firewall do?

A

its made of two NICs that pass packets between each other, comparing them against set rules of the network.

113
Q

what is a proxy and what does it do?

A

it sends and receives data for the user, creating anonymity and caches data, speeding up network traffic.
also admins can restrict access.

114
Q

what is the negation law?

A

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

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

115
Q

what is the distribution law?

A

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

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

116
Q

what is the association law?

A

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

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

117
Q

what are the 4 laws in this specification?

A

Data Protection Act: protection of personal data
Computer Misuse Act: no accessing or modifying material with or without intent to commit further crime.
Copyright, Design and Patents Act: protects all media
Regulation of Investigatory Powers Act: companies have to give data to authorities when asked

118
Q

what is the difference between morals and ethics?

A

morals is a personal code of conduct, ethics are community values that affect groups of people

119
Q

how does automated decision making affect us?

A

social media recommendations, stock market bots, driverless cars

120
Q

what is recursion and its advantages/ disadvantages?

in adv info

A

code calls itself during runtime and until stopping condition is met. fewer lines of code so less prone to errors but can fill up stack with parameters, local variables and return addresses.

121
Q

what are attributes of an IDE?

A

-variable watch: monitors how contents of variables change during runtime
-breakpoint: code runs until condition is met or line is reached determined by user
-debugging tools: shows what line error came from
autocompletion of words, indentation, syntax highlighting, automatic bracket completion and displays what subroutines have called each other

122
Q

what is problem recognition?

A

identifies inputs/outputs and data stored

strengths and weaknesses of current solution

123
Q

what is problem decomposition?

A

breaking a problem down into smaller problems that are easier to solve separately. divide and conquer is makes time to solve logarithmic but also is recursive so has drawbacks related to that

124
Q

what is abstraction?

A

Representational abstraction removes unnecessary details.

Abstraction by generalisation groups similar parts together to reuse code and program them together

125
Q

what are the 6 problem solving strategies?

A

backtracking: returns back when path doesn’t work (recursion)
data mining: finds patterns/ trends from large amounts of data
heurists: finding a good enough solution to save time
performance modelling: uses mathematical methods to judge the capabilities of a solution when testing would be dangerous
pipelining: development and workings of the solution
visualisation: data visuals make trends stick out