Components of a computer Flashcards
what is the CPU?
Central Processing Unit, aka. the processor, is the controlling processor of the computer which executes instructions
what are the 3 main elements of the CPU?
- ALU
- Control unit
- Registers
what is the ALU?
- Arithmetic Logic Unit
- performs arithemetic and logical operations on data - eg. normal arithmetic, shift operations, boolean logic operations by comparing 2 values
What is the control unit?
- controls and coordinates the activities of the CPU, directing the flow of data between the CPU and other devices - makes sure instructions execute correctly
- accepts next instruction, decodes it into several sequential steps (eg. fetch addresses/data from memory) manages execution + stores resulting data back into memory/registers
what are registers?
- they are special memory cells where a single item of data can be stored
- very high speed area of the CPU
- results of all arithmetic, boolean and shift operations are stored in a register - they have to be in one in order to be called upon
- typically up to 16 general purpose registers in the CPU
- increasingly being slowed down by the speed of light
what are some typical special registers?
- program counter (PC) - holds the address of the next instruction to be executed (next in sequence or when branched)
- Memory address register (MAR) - holds the address of the memory location currently in use - data to be fetched from/written in
- memory data Register (MDR) - temporarily stores data read from or written to memory (aka. memory buffer register)
- Current Instruction Register (CIR) - holds current instruction being executed (divided into opcode and operand)
- Accumulator - stores results of calculations processed by CPU, takes the place of general registers
what is a bus?
It is a set of parallel wires connecting 2 or more components of a computer to another. It typically consists of 8, 16, 32. or 64 lines
What are the 3 types of bus?
- data bus
- address bus
- control bus
what is a data bus?
It is a bi-directional path for moving data and instructions between processor components and memory
What is an address bus?
every word in memory has its own specific memory address. When data is to be saved to/loaded from memory, the address of the location it needs to be stored in/retrieved from must be sent along the address bus. It is uni-directional.
what is a word?
a fixed group of digits, usually 16, 32, or 64 bits, which is handled as a unit by the processor
what is a control bus?
- it is a bi-directional bus that makes sure that access to and use of data and address buses between different components of the system does not lead to conflict.
- It’s purpose is to transmit command, timing and specific status information between components - basically make sure everything is executed at the right time and order.
- example control line = Interrupt request, clock
what is the fetch-decode-execute cycle?
It is the sequence of operations involved in executing an instruction. It can be divided into 3 phases - fetch, decode and execute
describe the fetch decode execute cycle
- PC holds the address of the next operation
- copy contents of PC into MAR
- Increment PC
- Load instructions at MAR address into MDR
- Copy instructions from MDR to CIR
- Decode instructions in CIR (done by control unit) - break down into opcode and operand
- Execute instruction
What is opcode?
The part of an instruction that determines the type of instruction it is and what hardware to use
what is the operand?
the part of the instruction which holds either the address of data to be used in the operation; or actual data to be operated on.
What are some factors affecting processor performance?
- clock speed
- number of cores/duplicate processors linked together on a single chip
- amount and type of cache memory
How does clock speed affect a processor’s performance?
- lock speed is how many clock cycles a CPU can complete per second
- clock speed is measured in gigahertz (GHz)
- average processor clock speed is 2-4 GHz
- the greater the clock speed, the faster each cycle will be completed, which means more instructions can be executed per second which means instructions will be processed faster making a faster processor
What is a clock cycle?
A single electronic pulse of the CPU - the time it takes for the system clock to go from 0 to 1 to 0 again. The CPU cannot complete operations faster than the clock cycle.
How does the number of processors affect the performance of the CPU?
- dual-core = 2 processors linked together, quad-core = 4 processors linked together
- Theoretically - each processor can process a different instruction at the same time with its own FDE cycle so a quad-core processor would be 4 times more efficient than a single core processor
- not always the case - software may not be able to take full advantage of both processors
- but generally, the more cores, the more instructions running simultaneously which makes a faster processor
How does amount and type of memory affect the performance of a processor?
- when an instruction is fetched from main memory it can be stored in the cache so it can be fetched from there if it is needed soon after which is much faster than going back to main memory since it is further away from the CPU than cache
- as cache fills up, unused instructions/data is replaced with more recent ones
3 levels of cache:
L1 - extremely fast but small - 2-64KB
L2 - fairly fast and medium sized - 256KB-2MB
L3 - only on some CPUs
What is cache?
A small amount of very expensive, fast memory inside the CPU
What is pipelining?
- a technique used by some processors to improve performance
- computer architecture allows next instruction to be fetched at the same time as the processor is performing arithmetic and logical operations, holding them in a buffer close to the CPU until it can be performed
- this makes use of how the arithmetic part of the processor is idle when an instruction is being fetched
- divided into an instruction pipeline and an arithmetic pipeline
- quite common in PC processors - eg. Intel Pentium uses it to do up to 6 instructions simultaneously
What is an instruction pipeline?
it is the stages when an instruction is moved through the processor - fetched, buffered, executed