+============================+ |Instruction set Architecture| +============================+ - expands as Instruction Set Architecture. - Interface between software and hardware. - ISA specifies -- Operations -- Different storage locations like register, memory and more. -- Different ways to access these storage locations(addressing modes). Microarchitecture takes the ISA and implements on the machine. The implementation of ISA is referred to as microarchitecture. ISA is visible while microarchitecture is not. ISA does not change with changes in microarchitecture as computers evolve(unless manufacturers explicitly decide to do so). This is for portability or backward compatibility. Vertical Stack of Computer Architecture --------------------------------------- Application Compiler Assembler ISA Micro architecture Gates and Wires Transistors Machine Model - Von Neuman Model Consists of: - Stored Program - Data/Memory - Processing Unit - Program Counter(PC) - Atomic Instruction Execution Instruction Format 1.Length: Can be fixed length or variable length. - Fixed Length -- Easy/simple to Decode -- Requires more instructions since limited execution information can be conveyed using a particular instruction. - Variable Length -- Complex to decode -- Has higher code density 2. Types: Classification can be : -Type of Instructions. -- Jump, add etc. -Types of Operands -- Memory -- Immediate (Constants) -- Registers MIPS(RISC) instruction format is - 32 bits - Classification(types) : Three formats -- R(register), I(Immediate), J(Jump) format. 1) R - format +--------+--------+--------+-------+------------+------------+ |opcode | Rs | Rt | Rd | shamt | func | +--------+--------+--------+-------+------------+------------+ CB 2) I - Format +--------+--------+--------+----------------------------+ |opcode | Rs | Rd | offset | +--------+--------+--------+----------------------------+ 3) J - Format +-------------------------------------------------------+ |opcode | addr. | +-------------------------------------------------------+ Operations provided by ISA: -Arithmetic -Loads/Stores -Logic -Branches -Conditionals -System Calls -Push/Pop -Memory Management(rep mov) - Uncommon More operations supported by an ISA does not make it better. ISAs should be designed for common case and not made complex with huge number of operations. More operations make microarchitecture more complex and difficult to implement. The compiler also needs to maintain and decode these operations correctly making it more complicated. Depending on how many memory operands are there in an arithmetic instructions, an architecture is classified as: 1) Register-Register Architecture: In this architecture, all operands are from registers 2) Register-Memory Architecture: In this architecture, at most one operand can be from memory and the other operands are from registers. 3) Memory-Memory Architecture: Here all the operands can be from memory. Operand Model ------------- -Memory only -Accumulator -Stack -Registers -- General Purpose Registers -- Load Store(MIPS) Data Types ---------- -integers -char -floating point -vectors -packed integers. Also refer to class slides.