paper 1 Flashcards
Fetch stage of the FDE cycle
- value of PC copied to MAR
- PC ticks over to next address
- MAR address cent to RAM via address bus and copy instruction sent from CU via Control unit
- Instruction copied to MDR via Data bus
- MDR copied to CIR
Decode stage
- content of CIR split into Opcode and Operand
- Opcode matched with instruction in instruction set
- if Operand not immediate the value of the address is fetched
Execute
Opcode executed on operand
Execute
Opcode executed on operand
pipelining
three separate instructions processed simultaneously, instruction one executed while instruction two is being decoded and instruction three is being fetched - reduces CPU idle time - can be broken down further to reduce idle time more
if predicts wrong branch the pipe must be flushed and benefits are lost as correct instruction is loaded
von neumann
original computer architecture has single CU, ALU, registers and memory units - memory shared by instructions and data as are the buses - uses stored program concept
harvard architecture
uses two memory storage units one for data and another for instructions, two copies of buses - more efficient, data and instructions fetched at the same time common in embedded system
contemporary architecture
combines Harvard and von neumann, main memory remains in von neumann format while cache is dived like with a Harvard system
CISC
systems using a larger instruction set (80-100), each instruction can be more complex so may take several clock cycles to complete one instruction.
+ easier to translate from high level to machine code
+ less ram required for less lines of code
+ specialized instructions used rarely
- larger due to increased storage for more instructions and more cooling required for increased power consumption
- decreased clock speed
- may require several clock cycles per instruction
-
RISC
a smaller instruction set (30-40) more simplistic - 1 instruction = 1 clock cycle
+ high level languages compiled to more efficient code
+ 1 clock cycle per instruction
+ smaller - reduced power and storage
+ decoding instructions more simple
+ cheaper - less components
- performance depends on skill of programmer
- longer compile time and longer machine code
- more effort for programmers
scheduling
function of operating system dividing CPU time between jobs - can be done pre-emptivly (stopping jobs during execution to giver others processor time) or non pre-emptivly (once a job is started it is not stopped until completed)
- round robin - pre-emptive - each job given a set amount of time, first come first serve, after time used it is moved to the back of the queue if not complete + all jobs seen to - inefficient split meaning all jobs take a long time - does not account for priority
- First come first server - non pre-emtive - as jobs arrive they are processed to completion + strait forward to implement - vulnerable to malware if loaded before AV - does not account for priority
- shortest job first - non pre-emptive - jobs are ordered in ascending order in terms of length, suited to batch systems to reduce wait time - can starve longer processes - requires processor power to calculate job length +completes lots of jobs quickly
- shortest time remaining - the fastest job to be completed at a given point in time is seen to first - can starve longer processes - requires processing power to calculate queue
- Multilevel feed back queue - divides schedule into multiple queue’s depending on the priority of tasks - only once top queue is empty to is the next queue seen to - another scheduling algorithm is implemented on each level - requires extra processing power - inherits pros and cons of algorithm used at each level + takes into account priority
translators
a program which converts high level code to machine code
compiler
translates all code in one go, carries out all checks and reports errors before execution - whole program must be recompiled if change is made - compiled code is specific to the processor and operating system it is compiled on - can be ran without a translator present - creates executable separate to source code
interpreter
translates code line by line during execution - stop and produce error when found - slower as code is translated each time it is ran - useful for testing and debugging - interpreter required to run - more portable
assembler
translates assembly to machine code - platform specific - instructions dependent on specific processor - 1 assembly line = 1 machine line