Set 1 Flashcards

Checked by Matt. Covers everything above SA 1 on BPCompSci topic list

1
Q

What are the advantages of RPN?

A
  • Eliminates the need for brackets in sub-expressions
  • There is no need for order of precedence of operators (DON’T MENTION BIDMAS)
  • The expressions are in a form suitable for evaluation using a stack, as the expression can be evaluated from left to right
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is main memory?

A

Memory that is directly addressable by the processor

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

What is the system bus?

A
  • A set of parallel wires connecting independent components of a computer system
  • It is used to pass signals between the components.
  • These signals can represent data, address, or control information.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the stored program concept?

A

Two parts:
(a) A program must be resident in main memory to be executed.
(b) Machine code instructions are fetched and executed serially (one at a time) by the processor.

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

What are the two types of stored program concept?

A
  1. Von Neumann (where data and instructions are stored in main memory)
  2. Harvard Architecture (where instructions and data are stored separately, using separate buses)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Why is Harvard Architecture sometimes used in preference to Von Neumann?

A

Von Neumann:
- Competition for resources as all share same bus

Harvard:
- Instructions and writing/reading data can take place in parallel so can be faster
- Avoid bottleneck of single data/address bus
- Instruction and data memory can have different word lengths
- Avoids possibility of data being executed as code, which is one method that can be exploited by hackers

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

Where is Harvard Architecture used?

A

Embedded systems and digital signal processing systems

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

Describe the role of the control unit

A
  • To control operation of the fetch-execute cycle
  • It controls fetching (or loading or storing) operations
  • It determines the type of an instruction
  • To execute (some) instructions
  • To synchronise the operation of the processor
  • To send control signals and commands to other components
  • To control the transfer of data between registers
  • To handle interrupts
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Describe the fetch part of the fetch decode execute cycle

A

Fetch:
- Contents of Program Counter transferred to Memory Address Register
- Address bus used to transfer this address to main memory
- Read signal sent along control bus
- Transfer of main memory content uses the data bus
- Contents of addressed memory location loaded into the Memory Buffer Register
- Contents of memory buffer register and copied to the current instruction register
- Increment Program Counter (part of Fetch stage, but not directly involved in fetching an instruction)

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

Describe the decode part of the fetch decode execute cycle

A

Decode:
- Instruction to decode held by the Current Instruction Register
- The control unit decodes the instruction
- Instruction split into opcode and operand(s)

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

Describe the execute part of the fetch decode execute cycle

A

Execute:
- If necessary, data is fetched or stored
- The opcode identifies the type of operation to be performed by the processor
- The operation (identified by the opcode) is performed by the control unit.
- The ALU is used for calculation (or comparisons)
- The result (may be) stored in a register (or main memory)
- The status register is updated
- If a branch is required then the program counter is updated
- The control bus will transfer signals to other components to initiate or sequence actions

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

How would you subtract a binary number A from a binary number B?

A

Convert A into -A using two’s complement. Then use binary addition with -A and B.

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

Why use hexadecimal instead of binary?

A
  • Easier for humans to read/write/remember
  • More compact representation
  • Fewer digits required for the same value
  • Less screen space

(NOT BECAUSE IT TAKES LESS MEMORY SPACE. IT DOESN’T TAKE LESS STORAGE SPACE!)

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

What is the data bus used for? What is its direction?

A

The data bus is used to transfer data between components.

The data bus is bidirectional

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

What is the address bus used for? What is its direction?

A

The address bus is used to transfer memory addresses and I/O (input output) locations.

The address bus is unidirectional from the processor

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

What is the control bus used for? What is its direction?

A

The control bus is used to transport control signals between components.

The control bus is bidirectional

17
Q

Give three examples of control signals

A
  • Clock signals
  • Memory read
  • Memory write
18
Q

What are I/O controllers?

A

The circuits that connect the processor to an I/O device. (Providing the correct currents/voltages etc.). Processor cannot be directly connected to the I/O device

19
Q

What is the difference between volatile and non-volatile memory

A
  • Volatile memory maintains its data only while the device is powered.
  • Non-volatile memory retains stored information even after power is removed
20
Q

Give an example of non-volatile main memory

A

ROM (Read Only Memory)

21
Q

What is the instruction set?

A
  • The set of binary codes for the machine operations that a processor has been designed to perform.
  • It is specific to the processor
22
Q

What is the purpose of main memory?

A

Main Memory holds the instructions and data currently being used by the processes.

23
Q

What is the ALU?

A

The Arithmetic Logic Unit is the part of the CPU that is responsible for executing arithmetic operations (e.g. addition, subtraction, binary shifts) and logic comparisons (e.g. Or / And / Not)

24
Q

What is a register?

A

Extremely fast, very small, memory in the processor for temporary storage of binary values

25
Q

What does the program counter do?

A

Stores the address of the next instruction to be executed

26
Q

What does the MAR do?

A
  • Temporarily holds the address of the memory location that data will be read/written to
  • The MAR is the processor’s direct connection to the address bus for accessing main memory
  • Holds the address of the instruction in the fetch stage as it is fetched
27
Q

What does the MBR do?

A
  • Temporarily stores data read from or written to main memory
  • The MBR is the processor’s direct connection to the data bus for accessing main memory
  • Holds the instruction in the fetch stage before it is copied into the CIR
28
Q

What is the role of the CIR in the FDE cycle?

A
  • Stores the recently fetched instruction to be decoded by the control unit before it is executed
29
Q

What information is stored in the status register?

A
  • The status register contains many bits (binary flags) that are set (1) or cleared (0) depending on the result of an instruction
  • Each bit represents a boolean value, for example if an overflow error has occurred
30
Q

What is the purpose of general purpose registers?

A
  • Have no specific value stored
  • Usually used as temporary storage while performing arithmetic operations
  • Often store the operands of processor instructions
31
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
32
Q

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
33
Q

What is the significance of the leftmost bit in two’s complement?

A
  • The most significant bit (leftmost) is the sign bit, which represents a negative number when set to 1
  • The MSB also contributes to the value of the number
34
Q

What is 1111…111 in two’s complement binary?

A

-1

35
Q

Range of an 8-bit number represented as:
1. unsigned binary number
2. two’s complement number

A
  1. Unsigned: 0 to 255
  2. Two’s complement: -128 to 127
36
Q

An 8-bit two’s complement binary number can be between ___ and ___

A

-128 and 127

37
Q

How to turn a negative number into its positive version in two’s complement (and vice versa)?

A
  1. From the right, every bit up to and including the first 1 stays the same.
  2. Everything else gets flipped.

(This is the same as flipping every bit then adding 1)

38
Q

Where is Von Neumann architecture used?

A

General purpose computing systems