1.1.1 structure and function of processor Flashcards
architecture, fde, performance of cpu, pipelining, von neumann vs harvard
what is the role of the cpu?
processes data by executing program instructions
what is the role of the alu?
performing arithemetic calculations and logical operations
what are the specific operations that the alu is responsible for?
addition, subtraction, multiplication, division
logical operations
comparison between values
shifting binary patterns to left or right
what is the role of the cu?
controls and manages the execution of instructions, the sequence of operations, directs the flow of data with control signals, decodes every instruction that the cpu will execute
what is the role of the clock?
generating regular clock pulses by emitting a signal that is used to synchronise the operations of the processor components
how do clock pulses work?
the clock generates regular clock pulses by emitting a signal that continuously oscillates between a low (0) and a high (1) state
what is a clock period?
the time taken between 2 sequential rising edges of a signal state (it corresponds to one clock cycle)
what is a rising edge?
a change from a low (0) state to a high (1) state of clock signals
what is a falling state?
a change from a high (1) state to a low (0) state of clock signals
what is clock rate / clock freq / clock speed?
number of clock cycles that can be completed in 1 second (measured in Hz) it is the inverse of the clock period
what is a register?
locations of computer memory within the processor that provide extremely fast access
what is a general-purpose register?
a register to temporarily store and access the results of operations
what is a special-purpose register?
processor-based registers that are used for a specific purpose
what is the role of the pc?
holds the address of the next instruction to be executed by the processor
what is the role of the cir?
holds the current instruction that the cpu is executing
what is the role of the status register (sr)?
used to store information about the result of the last instruction that the alu executed
how does the sr work?
each bit within the status register acts as a flag to indicate if an error or exception has occurred within the process or to enable or disable interrupts to be raised
what is an interrupt?
an event outside the program process that requires the attention of the cpu
what is the role of the mar?
temporarily hold the address of the memory location that the cpu needs to access, either to read from or to write to
what is the role of the mdr / mbr?
temporarily holds the data that are read from or written to main memory
what is the role of the acc?
stores the result of any calculation processed by the alu
what is the difference between general-purpose registers and the acc?
the acc holds any RESULT, the general purpose holds them temporarily while calculations are in the process of being completed
what has to happen before the fde cycle can take place?
the program instructions need to be in machine code and the program instructions have been loaded into RAM
what happens at the end of the fde?
the cpu checks the status register to see if an error, exception or interrupt needs to be handled
what is an exception?
an unexpected behaviour that occurs during execution
what are all components connected to?
the cu
what happens in the fetch stage?
- the contents of the pc are copied into the mar
- the address of the next instruction to be executed is placed on the address bus
- the cu instructs a memory read operation to allow the contents of the memory location to be transferred into the cpu
- the instruction that is stored at that address is transferred using the data bus from ram to cpu and is saved in the mdr
- simultaneously the pc is incremented by 1
- the contents of the mdr are copied into the cir
what happens in the decode stage?
- the cu decodes the instruction that is kept in the cir
this involves splitting the instruction into operand and opcode
what happens in the execute stage?
- the instruction is executed (the sequence of operations depends on the type of instruction being executed.
generally what is the impact of clock speed on the cpu?
greater the clock speed, the faster instructions are carried out
how many state changes per second can a cpu with clock speed 3.6GHz complete theoretically?
3.6 billion
how many clock cycles does a single instruction take?
typically more than 1
what is overclocking?
making a cpu perform more instructions per second than recommended by the manufacturer
what is the consequence of overclocking?
could cause the cpu to overheat
what does multicore mean?
the computer has more than one processing unit / core
generally what is the impact of cores on the cpu?
the more cores, the more instructions it can execute at the same time
what is parallel processing?
dividing a computation into subtasks so they can be processed in parallel by each core simultaneously
why does parallel processing speed up the process?
if the instruction can’t be split, then the system would have to queue the parts of an instruction being fed into a particular core, slowing completion
what is the impact of having a process with a strictly-enforced sequence?
it may not be possible to run it in parallel until the queued processes have been completed
what is the role of cache?
used to store the instructions and data which are most frequently used
what is cache?
a fast and relatively small capacity set of locations that sit close to the processor
why is cache used?
when an instruction (or set of) is frequently used during an operation, it is costly for a cpu to fetch them from ram over and over again
which is more expensive: cache or ram?
cache! it also cannot be easily upgraded or replaced
how many levels do most computer systems have of cache?
3 (some now have 4)
what is level 1 cache?
part of the circuitry of each core, smallest and fastest
what is level 2 cache?
shared by cores, part of the core in the same way as l1, slower and larger than l1
what is level 3 cache?
on / near the cpu on the motherboard, slower and larger than l2
what is level 4 cache?
roughly same place as l3, in newer systems
generally what is the impact of more cache?
larger the cache, more instructions that can be queued and carried out
why is the placement of cache important?
having on the circuitry of each core reduces the time it takes for instructions/data to pass through the registers
generally what is the impact of having more number of cache levels?
greater number of cache levels, the more efficient the system - inc in speed and memory means that more data is held nearer to the cpu
what is pipelining used for?
improving cpu performance
what needs to occur to apply pipelining on a task?
task needs to be broken down into subtasks that can be handled independently
how is pipelining used in the fde cycle?
1 is being fetched
2 is being fetched 1 is being decoded
3 is being fetched 2 is being decoded 1 is being executed
how does the fde cycle avoid overwriting data whilst pipelining?
they have distinct stages which are repeated for each instruction, between each stage there are registers keeping immediate results and a clock signal that synchronises flow
where is von neumann architecture used?
many modern-day computer systems
what does the von neumann architecture consist of?
cpu
memory unit that can communicate directly with the cpu
connections for input/output devices
secondary storage
how is data transferred between the memory and cpu in von neumann architecture?
the same address/data bus
where is harvard architecture used?
dsp systems, embedded systems
how is harvard architecture different to von neumann architecture?
harvard keeps instructions/data in separate memories
how is data transferred between the memory and cpu in harvard architecture?
separate data and address buses - cpu is connected to the instruction memory using a dedicated set of address and data buses, and is connected to the data memory using a different set of address and data buses
what does harvard architecture consist of?
cpu
data memory
instruction memory
connections for input/output devices
secondary storage
what are the advantages of harvard?
separate memory units/data so they can be accessed simultaneously, minimising the issue of keeping the cpu waiting (increasing cpu performance)
instruction/data memories can be different sizes, word lengths and can be implemented using a different type of technology so each memory can be adapted to meet the needs of a particular system
instruction memory can be implemented as rom protected the programs from changes by hacking
what are the advantages of von neumann?
less physical space is required
cheaper to use
has a more flexible use of the main memory, which allows the cpu to run a variety of programs that aren’t known in advance