Set 2 Flashcards

Checked by Matt. Covers content between SA1 and SA2 in the BPCompSci topic list

You may prefer our related Brainscape-certified flashcards:
1
Q

Describe what an interrupt is and explain the purpose of interrupts.

A

A signal is sent to the processor (from a hardware device or program)
So that a device or source that needs the immediate attention of the processor can be dealt with.

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

Describe how the hardware of a computer could be improved so that programs can be executed more quickly.

A
  • Replace the processor with one which has more cores
  • Replace the processor with one which has more cache memory
  • Increase clock speed of processor
  • Use a parallel processor architecture
  • Use a processor with a bigger word size
  • Use a processor that makes (better) use of pipelining
  • Install more RAM // main memory // primary memory
  • Use RAM with a faster access time
  • Replace the motherboard with one which has buses which run at a faster clock speed
  • Replace the motherboard with one which has more lines in data bus
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How many bytes are in a kilo/mega/giga byte?

A

1 thousand/1 million/1 billion or 1000/1,000,000/1,000,000,000

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

How many bytes are in a kibibtye?

A

1024 bytes

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

How many kibibytes are in a mebibyte?

A

1024 kibibytes

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

List the prefixes starting kibi…

A
  • kibi
  • mebi
  • gibi
  • tebi
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How many bits does ASCII use? How many characters can it represent?

A
  • ASCII uses 7 bits to represent characters (hence max 128 characters)
  • However, 8 bits are used to store each character (preceding 0)
  • The leading 0 is sometimes used as parity bit instead
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does ASCII work?

A
  • Each of the characters is assigned a numeric character code
  • Which is represented and stored in the computer as binary
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the downside of ASCII?

A

ASCII is not sufficient to represent all of the languages and scripts used around the world

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

Why is unicode needed?

A
  1. ASCII can’t represent all languages and scripts
  2. ASCII can’t represent all possible symbols
  3. The World Wide Web made it important to have a universal international coding system
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which is the most common unicode encoding standard used?

A

UTF-8

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

What are the first 128 codes in unicode the same as?

A

The first 128 codes in ASCII

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

What is clock speed?

A

The frequency at which the system clock ticks

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

What is word length?

A

Word Length is the number of bits in a word

(A word is the fixed size unit of data. It affects register size, address size and other aspects of the computer)

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

What is the address bus width?

A
  • The number of bits that can be used to form an address of a memory location
  • Or the number of parallel wires allocated to the address bus
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the data bus width?

A
  • The number of bits that can be transferred to or from memory in one operation
  • Or the number of parallel wires allocated to the data bus
17
Q

How is fetch time affected if the data bus isn’t big enough for a piece of data?

A
  • the piece of data will be split into multiple parts
  • meaning fetch time will be multiplied
18
Q

What is cache memory? What does it contain?

A

Cache memory is a relatively small capacity of very fast memory that sits on or close to the processor.

Cache memory contains:
1. Copies of data from frequently used memory locations
2. Pre-fetched instructions
3. Data to be written to main memory

19
Q

How does increasing cache memory size affect processor performance?

A
  1. Increasing cache size means more instructions and data can be stored in cache
  2. So main memory needs to be accessed less frequently
  3. Cache memory is faster to access than main memory
  4. So throughput is increased and response time is reduced
20
Q

How does increasing the number of cores affect processor performance?

A
  • Multiple tasks can be run at the same time
  • A single task can be split over multiple processors
    • Many programs are now written to optimise the use of parallel processing
  • This increases throughput
  • However, increasing the number of cores greatly increasing complexity
21
Q

4 reasons secondary storage is needed

A
  • Main memory is volatile, so secondary storage needed to store files that are needed multiple times
  • Secondary storage can be used to store larger files, as it usually has a much higher capacity than main memory
  • Secondary storage can be used for virtual memory
  • Main memory is expensive
22
Q

What is the effect of increasing data bus width?

A
  • more bits can be transferred between main memory and the processor in one operation
  • so fewer read/write operations are needed
  • so there are fewer delays when retrieving data
23
Q

What is the effect of increasing address bus width?

A
  1. The processor can access a larger number of memory locations
  2. so the CPU doesn’t have to access secondary storage as often
  3. which reduces the reliance on virtual memory
  4. Increased scalability and increased throughput
24
Q

What is the effect (and downside) of increasing word length?

A
  • Longer word length means registers can store more bits, so the processor can process more bits in one go
  • Also, complicated value splitting is required if the operand size is larger than the word length
  • however if word length is increased, more memory is wasted when storing small values
25
Q

What is the effect (and drawbacks) of increasing clock speed?

A
  • Higher clock speed means more instructions can be executed per unit time
    however
  • All machine code instructions take a certain amount of time to execute anyway
  • Heat dissipation becomes more of an issue as clock speed increases
26
Q

Give 4 advantages of Harvard architecture

A
  • Instruction and data can be accessed simultaneously
  • Instruction and data memory can have different word lengths
  • Different technologies can be used to implement instruction and data memory
  • For systems with a predetermined use, instruction memory can be implemented as ROM which protects the programs from hacking
27
Q

What three pieces of information are stored in a stack frame for a subroutine call

A
  • Return address
  • Parameters
  • Local variables
28
Q

What is a parameter

A

A subroutine variable initialised with an input value (argument) when the subroutine is called.

It only exists while the subroutine is executing.

29
Q

What is a local variable?

A

A variable that is declared in a subroutine. It is only accessible within that subroutine.

It only exists while the subroutine is executing.

30
Q

What is a global variable?

A

A variable that is accessible by all subroutines (within a class)

31
Q

What is an array?
How are items accessed in an array?

A
  • A collection of items with a fixed size
  • Arrays use index numbers to access individuals elements of the array
32
Q

What is the volatile environment?

A

A snapshot of the information needed to execute a process from its current instruction. This contains the special purpose and general purpose registers including the PC.

33
Q

Explain why the volatile environment must be saved before an interrupt is serviced.

A

So that the currently running process can be returned to
As the code that deals with the interrupt will overwrite register values

34
Q

What is variable shadowing?

A

When a global and local variable exist within the same class with the same identifier.
A logic error can occur where you make changes to the variable within a subroutine. You might expect this to change the value of the global variable, when in fact it is only the local variable that is affected.

35
Q

What is the difference between a local and global variable

A
  • Local variables have more limited scope
  • Global variables exist throughout the entire program
  • Local variables only exist in a part/block/subroutine of the program
  • Local variables can only be accessed in a part/block/subroutine of the program
  • Global variables can be accessed from any part of the program
36
Q

Why is it considered to be good practice to use local variables

A
  • Modularisation of a program
  • Allows reuse of subroutines
  • Less chance of side-effects