Instruction Set Architecture Flashcards
Address Space
Number of Drawers
Addressability
number of bits per drawer
drawer width
Decoder
Takes instruction apart (in case of LC 4, 16bit) and determines necessary control signals.
Translates instruction.
A Combinational logic block that computes control signals
ISA
Instruction Set Architecture
Programmer-visible components and operations
- Everything needed to create a program for CPU
- Serves as ‘contract’ between programmer and CPU designer
- Different implementations of the same ISA are ‘binary compatible’
ISA vs Microstructure
The ISA specifies the “interface” between the programs and the underlying computer hardware that must carry out the work for them. i.e. the ISA tells us what you can do with the computer, what operations it can perform, what data types, addressing modes etc. one can use with the particular computer.
Whereas the microstructure refers to the actual implementation, i.e. how this “interface” and the associated functionalities have been implemented under the hood.
3 things specified by ISA / Basic components of ISA
- Instruction set: defined by its set of opcodes, data types (acceptable representations of information such that ISA has opcodes that can operate on
that representation -> ISA supports that data type), and addressing modes (mechanisms for specifying where the operands are located. Usually in memory, in a register or as part of the instruction) - Memory: how many locations, how many bits stored per location
- Registers: how many, what size, how are they used
OpCode
the portion of a machine language instruction that specifies the operation to be performed
Processor Status Word Register (PSR)
16bit register where the lower 3 bits store the NZP bits. The PSR[15] stores the privilege level that the CPU is currently operating in.
Program memory
where we store our instructions
3 parts of NZP
- NZP tester (3bits out)
■ Tests the output of the ALU for negative, zero, or positive - NZP register (3bits out, stored in the Processor Status-Word Register, bits [2:0])
■ Stores results of NZP tester (negative, zero, or positive)
■ NZP.WE = 1 for any instruction that writes to RegFile or PSR[15] - TEST (1 bit out) if condition is satisfied
■ Top input: I[11:9] (3bit user condition)
● Example: >= 0, <=0, etc.
■ Bottom input: the output of NZP (previous ALU’s value’s negative, zero, or positive)
Binary Compatible
You can take same instructions, with same bits. You run it on 2 different CPUs, and while they might do things differently under the hood, the implementation is such that they will yield same result.
Golden Rules of Branch Unit
Branch Unit = sets next PC value
- Every instruction updates PC to PC+1 unless otherwise noted
- NZP.WE = 1 for ANY instruction that writes to RegFile or PSR[15]
- We have never ‘X’ for WE control signals
Only instructions that can modify the privilege bit in PSR
TRAP and RTI
LC 4 Memory
Adress Space = 2^16; 16bit address line
Addressability = 16bit
Memory partitioned into program and data memory
LC 4 Registers
Register File: General Purpose Regisets - 8 registers, each 16-bit wide Program Counter: 16bit Processor Status-Word Register: 16 bit - contains NZP condition codes -Not directly accessible, but used and affected by instructions