Revision day two - logic design, single cycle, multi cycle, MIPS and C Flashcards
Data path
performs the data operations as commanded by the program instructions
control
controls the data path, memory and I/O according to program instructions
disadvantages of single cycle
speed - the cycle time is the Time for the most complex instruction but the average instruction needs less time
cost - functional units cannot be resused within one instructions execution
execution time
instruction count x number of cycles per instruction x cycle time
fetch step
instruction is fetched from memory
increment pc to the next instruction (pc +4)
instruction decode
retrieve the appropriate values from register files
decode the instruction
create control signals that will accompany the execution
calculate the target address - sign extend the immediate, shift left by 2 (word align) and add to (pc +4)
R-format instruction
- perform arithmetic and store output in ALUOut
- write result to correct register
Store instruction
- calculate address - 16 bit offset (sign extended) + first register source operand
- write to memory
Branch instructions
- compare operands using ALU subtraction
if 0 - address target is changed to one calculated in step two
else pc register will remain at PC+4
RISC
reduced instruction set computer
CISC
complex instruction set computer
instruction set architecture
the language of the computer
features of CISC
very few registers
very little memory
features of RISC
more memory + faster clock frequency
fixed length and fixed format instructions (for easy, fast decoding)
big endian
the msbyte of the data is placed at the location with the lowest address
little endian
the least significant byte of the data is placed at the byte with the lowest address
how can a word be stored in memory
- unaligned - placed anywhere
- aligned - at an address which is a multiple of the word size
memory regions and management in c
heap - dynamically allocated memory (managed by the programmer)
stack - for function / method calls (managed by compiler)
static - for data that lives during the whole lifetime of the program (initialised when the process starts