System Bus, CPU, Fetch-Execute Cycle

0.0(0)
studied byStudied by 1 person
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/16

flashcard set

Earn XP

Description and Tags

Lecture 2

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

17 Terms

1
New cards
Explain the CPU
- Fetches very basic instructions from main memory and executes.
- AMD, Intel, Apple etc have different instruction sets.
- No standard set or format but operations across different CPUs are similar.
- CPU internal activity is synched by a fast clock that is measured in hertz (megahertz, gigahertz)
2
New cards
Explain the System Bus
- Only one component can use the bus at one time.
- Collection of wires allowing communication between components on the motherboard.
- Sender places item, receiver takes it off.
- Modern computers have multiple interconnected system buses.
3
New cards
What are the different lines in the Bus?
o Address lines - specify a memory address to be accessed.
o Data lines - carry the data to be transferred.
o Control lines - tell receiver what to do with the data.
4
New cards
Explain I/O Devices
- Devices include expansion cards (graphics etc) that plug into the motherboard.
5
New cards
How does the CPU know when a device is ready to receive/transmit and when it has completed?
o Polling - periodically check the device status, however, requires CPU to stop what it's doing, hence, wastes time.
o Interrupts - device sends a signal to the CPU when its ready, this invokes an interrupt handler within the OS, then the interrupt is then received/redirected and decides when the CPU will handle it.
6
New cards
What has to happen before data can be processed?
- Data must be converted into binary format and loaded into internal memory before processed.
7
New cards
What is RAM and ROM?
- RAM - Random Access Memory, read and write, volatile, main computer memory.
- ROM - Read Only Memory, non-volatile, stores system boot code.
8
New cards
What is used to determine how memory can be manipulated?
- Bit length of the system determines how much memory can be moved/manipulated by the CPU.
- Desktops, laptops, phones typically 64-bit.
- Embedded microprocessors typically 8-bit or 16-bit.
9
New cards
What is in the CPU?
-Control Unit
-Arithmetic Logic Unit
-Registers
-Instruction Pointer
-Instruction Register
-Memory Management Unit (includes Memory Address Register and Memory Buffer Register)
10
New cards
Explain the Contorl Unit, ALU and Registers
- Control Unit - complex piece of logic that governs CPU, supplies ALU with data and tells it what to do.
- ALU - Arithmetic logic unit, performs bit manipulations and numeric operations.
- Registers - internal data stores, faster than storing in RAM, individual names with either general or specific use. Hold data temporarily while operations are carried out by ALU.
11
New cards
Explain IP, IR and Memory Management Unit
- IP - instruction pointer, holds address of NEXT instruction in memory.
- IR - instruction register, holds instruction CURRENTLY being executed.
- MAR & MBR - memory address register and memory buffer register, used by CPU to interface with main memory.
12
New cards
What are the steps of the Fetch-Execute Cycle?
Step 1:

* Copy address in IP into MAR.
* Issue read request to MMU.

Step 2: Increment IP to point to the next instruction.

Step 3:

* Current instruction arrives from memory into MBR.
* Copy instruction into IR.

Step 4: Decode IR to work out what the instruction is.

Step 5: Fetch any operands (extra data).

Step 6: Carry out the instruction (via ALU etc).

Step 7: Return to step 1.
13
New cards
What are the CPU instruction sets?
- Transfer - moving data to and from memory and registers.
- Arithmetic - simple maths operations (add, subtract etc).
- Logic - bit manipulation (AND, OR, NOT, shift, rotate etc).
- Test - comparing data values and setting flag status.
- Control - jumps and subroutine calls.
- Misc - miscellaneous helper operations.
14
New cards
How does the CPU understand instructions?
Each instruction has an opcode that the CPU understands.
- Example - the number 5 might mean add.
- When the CPU sees 5 stored in the instruction register, it knows to perform addition.
15
New cards
How does the CPU get further data?
CPU gets further data from registers or main memory (via MMU requests); this is known as operands.
Many instructions have several opcodes due to operands being encoded in different ways.

* Adding together the content of two registers.
* Adding the numeric value to a register.
* Adding data from a memory location to a register.

The CPU has to do something slightly different to get the data to be added, so each opcode tells it exactly what to do and which operand to use.
16
New cards
What are the different Addressing modes?
The mode part of the instruction tells the CPU where the operands are located.
- Immediate - operand value is encoded directly into the instruction (ie. a number).
- Register - operand value is stored in a register.
- Direct - value is in main memory, so the instruction encodes its address.
- Register Indirect - instruction specifies a register that holds the address of the operand in main memory.
Implicit mode is used when the instruction doesn't need an operand because it always does the same thing.
- Example - always manipulates or uses the same register.
17
New cards
How does the CPU get instructions?
A complier turns high level code into a sequence of bytes that represent the opcodes and operands in the instruction sets for the CPU.
Simple instructions need fewer bytes.