Instruction Set Architectures (ISAs) Flashcards
What is stored program computers?
Instructions are represented in binary, just like data
Instructions are stored in memory
Programs can operate on programs (such as compilers and linkers)
We make sure that applications are binary compatible to allow compiled programs to work on different computers (Compile on one machine and run on another) - this is also a key argument for standardizing ISAs
What is a instruction set?
The set of instructions a computer can execute.
Different computers have different instruction sets, but often have many in common
How is the RISC-V ISA instruction setup?
A fixed small number of instruction types
Each instruction have an opcode in the same location
format is regular across instruction types - different parts of the instruction (register bits (rd), funct bits) are in the same place for many of the instruction types.
What is a motivation for having simple instruction sets?
Compilers work better on simple instructions, as they are easier to map to applications than complex instructions
How does ISA design use the principle of “common case”
First figure out what the common case is.
Then make sure that the common case is well expressed with the ISA.
Make sure there are ways to express less common cases as well
What are the 4 types of ISAs?
Stack
Accumulator
Register (register-memory)
Register (load-store)
Every type can execute the same task, for example an add operation, but they will do this using different instructions.
What is the most common type of ISA since the 80s?
load-and-store (register)
What are some advantages with load-and-store ISAs?
Accessing registers is much faster than accessing memory.
They allow to seperate computation from memory (using register) which increase efficiency.
Using registers also decrease the amount of dependencies you have. Compared to the stack-type you would be dependent on the stack, which is in memory. And in the accumulator type you would need to serialize access to the accumulator.
What are a trade off with having a lot of registers availble?
The instruction needs to be longer because you need more bits to represent the address of the registers.
What is an advantage with having more registers?
More registers make compiler register allocation more effecient.
Name some ISAs that uses the load-store architecture?
ARM, MIPS, PowerPC, SPARC, RISC-v
Maximum number of operands for these are 3, and they allow no memory addresses (non of the operands can be memory addresses)
Name some ISAs that uses the register-memory architecture
IBM 360/370, Intel 80x86, Motorola 68000
These architectures allows for 2 operands and to apply 1 memory addresses
Name some ISAs using the memory-memory architecture
VAX has to formats of the architecture.
One allows for 2 operands where 2 can be memory addresses.
The other version allows for 3 operands where 3 can be memory addresses
What are some advantages with the register-register ISA architecture?
Simple
fixed length instruction encoding
Easy to generate code
Instructions take a similar number of clock cycles to execute
What are some disadvantages with the register-register ISA architecture?
Higher instruction count than architectures with memory references in instructions, because of book-keeping in regards to handling memory.
Bigger programs (instruction count + low instruction density), this can affect I-cache.
What are some advantages with the register-memory ISA architecture?
Can access data without loading it first.
Instruction format is easy to encode and give better instruction density.
What are some disadvantages with the register-memory ISA architecture?
When the architecture only allows for two operands, one of these can be overwritten during binary operations.
Memory addresses must be encoded in instruction formats, which reduces the number of bits that are available for registers.
Clock cycles per instruction varies based on where the operand is located.
What are some advantages with the memory-memory ISA architecture?
Most compact, both in terms of instruction space and register use.
Doesn’t waste registers for temporaries.
What are some dis-advantages with the memory-memory ISA architecture?
Large variation in instruction size, especially for three-operand instructions.
Large variation in work per instruction - memory access creates bottle necks
What operations does an ISA need to be able to perform?
Arithmetic
Data transfer
Control
System
Floating point
Decimal
String
Graphics
What does arithmetic instructions do?
Integer arithmetic and logal operations (add, subtract, or, and)
What does data transfer instructions do?
Load-store, move instructions (on computers with memory addressing)
What does control instructions do?
branch, jump, call and return, traps
What does System instructions do?
Operating system calls, managing virtual memory