Set 2 Flashcards

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

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, in detail, the steps taken by the processor to service an interrupt.

A
  1. The processor receives the interrupt
  2. The processor completes the fetch-decode-execute cycle of the instruction that it was running when it received the interrupt
  3. The current contents of the processor registers (including the program counter) are saved to memory. This is called the volatile environment
  4. The origin of the interrupt is identified so that the appropriate ISR (Interrupt Service Routine) is called
  5. All other lower-priority interrupts are put on hold to allow the ISR to finish running
  6. The program counter is updated with the address of the first instruction of the ISR
  7. The ISR completes its execution
  8. The volatile environment is reloaded with the values that were saved to memory
  9. The lower-priority interrupts that were put on hold are re-enabled
  10. The program counter is set to point to the address of the next instruction that needs to be executed in the program that the processor was running when it received the interrupt
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
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 A. Increase number of cores
  • Replace the processor with one which has more cache memory // increase the amount of cache memory // add cache memory
  • Increase clock speed of processor // replace the processor with one which runs at a faster clock speed NE. faster processor
  • Use a parallel processor architecture // use more processors which can work in parallel
  • 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 // main memory // primary memory with a faster access time
  • Replace the motherboard with one which has buses which run at a faster clock speed A. increase bus clock speed
  • Replace the motherboard with one which has more lines in data bus A. increase number of lines in data bus
  • A. Replace HDDs with SSDs // replace HDDS with HDDs that can read data at a faster rate // replace SSDS with SSDs that can read data at a faster rate
  • A. Use the Harvard architecture instead of the von Neumann architecture
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
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
5
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
6
Q

How many kibibytes are in a mebibyte?

A

1024 bibibytes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
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
8
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 sometimes used as parity bit instead
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
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
10
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
11
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
12
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
13
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
14
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
15
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
16
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
17
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
18
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
19
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

20
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 and response time is increased
21
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
22
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
23
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
24
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
25
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
26
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
27
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
28
Q

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

A
  • Return address
  • Parameters
  • Local variables
29
Q

What is a parameter

A

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

It only while the subroutine is executing.

30
Q

What is a local variable?

A

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

It only while the subroutine is executing.

31
Q

What is a global variable?

A

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