A level Computer Science Chapter 4 Flashcards

(58 cards)

1
Q

Explain how data is fetched, decoded, and executed using von Neumann?

A
  • Program Counter contains the address of the next instruction to be executed.
    -This address is copied into the Memory Address Register (MAR) so that the processor knows which memory location is required.
    -The control unit sends a read signal to main memory.
    -The instruction at that address is transferred from memory to the Memory Data Register (MDR).
    -The instruction in the MDR is copied to the Current Instruction Register (CIR).
    -The Program Counter is incremented to point to the next instruction.
    -The control unit decodes the instruction in the CIR.
    -The instruction is split into opcode (what operation to perform) and operand(s) (data or addresses).
    -Any required addresses are prepared, and additional data may be fetched from memory.
    -The operation specified by the opcode is carried out by the ALU or other parts of the CPU.
    -Data is processed using registers such as the Accumulator.
    -Results may be stored in a register or written back to main memory.
    -The Status Register is updated to reflect the outcome of the operation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

List all components in the Von Neumann Architecutre.

A
  • Buses
  • Registers
  • CPU
  • CU
  • ALU
  • IAS
  • System clock
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are general purpose registers?

A

-Hold temporary data when performing operations
- Used for any purpose
- Can be used by most instructions
-Do not have a specific function

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

What are special-purpose registers, and give an example.

A

PC, MAR, MDR
- Hold status of a program
- Specialised for specific use
- Can only be used by certain instructions

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

What does the program counter do?

A
  • holds the address of the next instruction to be loaded
    -is incremented once an instruction has been carried out
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does the memory address register do?

A

-stored address from memory location currently being read from or written to (where data is being fetched from)

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

What does Memory Data Register do?

A

Memory Data Register
- holds the data fetched from the RAM via the data bus from the location that the MAR
- data is copied to CIR which stores the data

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

What is the index register?

A
  • stores a value that is added to an address to give another address
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the function of the MDR

A
  • holds data from MDR
  • holds instruction currently being decoded/executed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the status register

A
  • stores flags - from results of logic and arithmetic operations // interrupt flags
    contains bits - can be individually set or cleared depending on operation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does the control unit do?

A

CU
-synchronises actions of other components in the CPU based on pulses of system clock

-sends/receives control signals along the control bus
-manages the execution of instructions - decodes an instructions opcode during FE cycle
-controls communication between components of CPU
- types of signals it transfers: interrupt, timing, read & write

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

What is the ALU responsible for/what does it do?

A

-Performs arithmetic operations (addition, subtraction, etc.)
-Performs logical operations (AND, OR, NOT, comparisons)
- Uses data from registers
-stores results back into a register (often the accumulator)

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

What does the accumulator do?

A

Stores temporarily the result of the calculation from the ALU

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

What is the purpose of the system clock

A

Generates regular timing signals
Synchronises all CPU operations
Controls the speed of instruction execution
Higher clock speed → more cycles per second

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

What is Immediate Access Store

A

Another term for main memory (RAM)
Stores data and instructions currently in use
Directly accessible by the CPU
Faster than secondary storage

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

What is the role of the adress bus.

A

Carries memory addresses
One-way bus (CPU → memory / I/O devices)
Width determines maximum addressable memory

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

What is the role of the control bus

A

Control bus
Carries control signals
Signals include read, write, clock, interrupt
Coordinates actions between components

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

What is the role of the data bus.

A

Data bus
Carries data and instructions
Two-way (bidirectional)
Width affects how much data can be transferred at once

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

What are the factors that affect the speed of the CPU

A
  • Clock speed – higher speed allows more instructions per second
  • Number of cores – enables parallel processing
  • Cache size – reduces access to slower RAM
  • RAM size and speed – affects how quickly data can be accessed
  • Bus width – wider buses transfer more data per cycle
  • CPU architecture – efficiency of instruction processing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is the system clock

A
  • synchronises computer operations by creating time signals
    -allows operations to be processed in the correct order / sequence
  • keeps track of date and time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is immediate access store

A
  • holds all the data/programs currently in use
    -volatile memory
    -has fast access times
    -Also know as RAM
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

How is data transferred between components

A
  • Components (CPU, memory, I/O devices) are connected by buses
  • Data transfer happens using three buses together
    -CPU places the address of the required memory location into the Memory Address Register (MAR)
    -Address is sent along the address bus to main memory
    -Control Unit sends a read or write signal along the control bus
    If reading:
    Memory places the data/instruction onto the data bus
    -Data travels to the CPU
    -Data is stored in the Memory Data Register (MDR)
    If writing:
    -Data is placed into the MDR
    -Data is sent along the data bus to memory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

How does the number of cores increase processing

A

-Each core processes one instruction per clock pulse
-more cores mean that more sequences of instructions can be carries out simultaneously
-multiple instructions can be executed per clock pulse
- decreased time taken to complete a task)

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

Why may more cores not increase processing speeds

A
  • software may not be designed for multiple cores - one core will be left idle
    -memory access speed wont match speed of cores - causes delay
  • may be other differences - e.g. amount of Ram
24
How does increasing cache size affect processing
-higher capacity means it can store a higher amount of frequently used instructions for fast access -fast access memory (close to CPU) -stores frequently used instructions/data -more cache means more instructions can be transferred faster - less swapping between RAM and cache - prevents CPU idling while waiting for data
25
What is the purpose of a port
purpose - to provide a connection to peripherals & provide interface between computer and other devices
26
Explain the features of a usb
-Used to connect a wide range of peripherals Examples: keyboard, mouse, printer, flash drive, webcam -Carries data and power through a single cable -Supports plug-and-play -Allows hot-swapping (devices connected while powered on) -Transfers data serially
27
Explain featurs of High Definition Multimedia Interface (HDMI)
Used to connect audio and video devices Examples: monitor, TV, projector Transfers digital video and digital audio Supports high-resolution video Carries audio and video in one cable
28
What is Video Graphics Array
-Video Graphics Array (VGA -Used mainly for connecting monitors -Transfers analogue video signals -Does not carry audio -Older standard compared to HDMI -Lower image quality than digital connections
29
Stages of FDE cycle
Next address to be fetched is stored in the PC This address is copied into MAR, using address bus Instruction located in that address is copied from main memory to MDR, using data bus Instruction is copied from MDR to CIR Instruction is decoded by CIR (into opcode and operand) Processor executes instruction Address in PC is incremented
30
What is an interrupt
An interrupt is a signal sent to the CPU that temporarily stops the current program so the processor can deal with something more urgent. It lets the CPU respond to events as they happen, rather than constantly checking for them
31
What are possible causes of a hardware interrupt
Hardware interrupts - A key is pressed on the keyboard - A mouse is moved or clicked - A printer or other I/O device signals it is ready - A timer reaches a set value
32
When are interrupts used?
Interrupts are used whenever the CPU needs to respond quickly to events, including: - Input from keyboards and mice - Output devices being ready to receive data - Timers for scheduling tasks - Handling errors and exceptions in software - Allowing multitasking in operating systems
33
What is the interrupt service routine?
When an interrupt occurs, the CPU temporarily pauses the current program and executes a special program called the Interrupt Service Routine (ISR): - ISR contains the instructions needed to deal with the interrupt - After the ISR finishes, the CPU resumes the original program exactly where it left off
34
What are some causes software interrupts
- A program requests a service from the operating system -Stack overflow - Errors like divide by zero or invalid memory access
35
How does an interrupt work, flagged, the steps/routine etc.
- Interrupt flag raised in interrupt register - Register checked for at start/end of FE cycle (before it begins/after execution stage) - Type and source of interrupt identified - Priority is checked against the current process - if lower, FE cycle continues, if higher... - Contents of registers are stored in/moved to a stack - Address of Appropriate ISR called to handle the interrupt (loaded to PC) - Once ISR finishes, check for further interrupts (if found, repeat cycle) - Otherwise load data/contents from stack into registers and continue with previous process
36
What is machine code?
Machine code is the binary code that the CPU can directly execute. It is made of 1s and 0s representing instructions and data.
37
What is assembly language?
Assembly language is a human-readable version of machine code. It uses mnemonics (like ADD, MOV, JMP) instead of binary numbers. Each assembly instruction corresponds to exactly one machine code instruction, but is easier for humans to understand.
38
How does a 2 pass assembler work?
two-pass assembler processes a program in two passes over the source code: Pass 1 – Symbol Table Creation - Reads the source code line by line - Assigns addresses to labels and variables - removes comments and white space - reads assembly language program one line at a time - checks the opcode is in the instruction set - adds labels to svmbol table - Stores them in a symbol table for use in pass 2 Pass 2 – Code Translation - Converts assembly instructions to machine code - Replaces labels and addresses using the symbol table - Produces the final object code (binary)
39
What does MOV A, #5 mean.
A gets 5 directly
40
What does MOV A, 1000 mean.
copy data from memory address 1000 into A
41
What does MOV A, (R1) mean?
R1 contains the address of the data that needs to be moved into A
42
What does MOV A, 2000(R1) mean?
copy memory data from 2000 and R1 into A
43
One pass vs 2 pass assembler?
In one pass, the assembler would sometimes see labels after they are used, and it wouldn’t know what memory address to put in the machine code. Two passes solve this: first figure out all addresses, then generate the code correctly. Analogy: Imagine writing a treasure map: first, you mark all landmarks, then you draw the paths between them. You can’t draw a path to a landmark you haven’t placed yet.
44
What is opcode?
The opcode is the part of an instruction that tells the CPU what to do. It specifies the operation — for example, add, subtract, move data, jump, compare, etc. Every machine code instruction has an opcode.
45
What is Operand?
The operand is the part of the instruction that tells the CPU what data to work on.
46
Cake mixture is mixed in a large pot. A conveyor belt moves the cake tins beneath the pot. The conveyor belt stops and a set quantity of the cake mixture fills the cake tin. The conveyor belt then moves and another cake tin is positioned beneath the pot.¢ Explain how the control system will ensure the correct amount of mixture is placed in the cake tins.
When the infra-red/pressure sensor detects the tin is in the correct place A message is sent to the microprocessor which ... sends a signal to an actuator to stop the conveyor belt ... and sends a signal to another actuator to release the cake mixture A pressure sensor continuously records the weight of the cake mixture in the tin ...and sends the readings to the microprocessor The microprocessor compares the readings with a pre-set value When the weight of the cake mixture in the tin matches the desired weight ... the microprocessor sends a signal to the actuator to stop releasing the mixture ...and sends a signal to another actuator to move the convever belt
47
How to set register to zero using the AND Opcode.
AND 0
48
Make sure to do practice questions on assembly language
https://drive.google.com/file/d/1MH2RZM0n6w7kWJWN4DraNSRL8XLwn47B/view
49
The role of the MAR
Stores the next address to be fetched give by the Program Counter (PC) The data at this address is then fetched
50
What is the role of the MDR?
Stores the data from the address pointed to by the MAR The data in it is copied to the Current Instruction Register (CIR)
51
List special registers
Program Counter Current instruction register
52
What is immediate addressing and give an example
Immediate Addressing The operand is the actual data No memory access needed to get the value Fast, but data size is limited Example: MOV A, #5 What happens: The value 5 is placed directly into register A
53
What is Direct adressing
The operand contains the memory address of the data CPU accesses that address directly Example: MOV A, 1000 What happens: CPU goes to memory address 1000 The value stored there is copied into register A
54
What is indirect adressing?
The adress to be used is at the given adress. Example: MOV A, (1000) What happens: Go to memory address 1000 Read the address stored there (e.g. 2500) Go to memory address 2500 Copy the value stored there into register A
55
What is indexed adressing?
Final address = operand address + contents of index register Commonly used for arrays and loops Example: MOV A, 2000(X) What happens: If X = 4 CPU accesses memory address 2004 Value stored at that location is copied into A
56
What is relative adressing
Address used = current instruction address + offset Offset is given by the operand Used with branch/jump instructions Supports relocatable code Example: JMP +5 What happens: CPU jumps 5 memory locations ahead from the current instruction
57