Chapter 3: Instruction Set Architecture Flashcards
Word size (data word)
- The word size is the size of a standard ALU operation and usually also the size of an instruction.
- The PIC uses Harvard architecture so the data word is 8 bits and the instruction length is 14 bits.
What determines how big the instructions need to be?
The number of instructions available within an architecture is typically between 30 and 200. Therefore, the opcode needs to have this number of unique combinations. So the opcode needs to be at least 5 and up to 8 bits long. In fact more are often used in order to simplify the decoding process.
What is the Operand?
The operand refers to the input arguments of the operation.
For a simple addition operation, two numbers are added together to give a result : A=B+C. The numbers B & C need to be accessed from memory and the result, A, needs to be written back to memory.
How is main memory accessed?
accessing the main memory itself involves using the large binary addresses associated with that memory. Architectures that perform operations this way are called memory-memory architectures.
How can instructions be shortened?
Instructions can be dramatically shortened if a load/store architecture is used instead.
What does the load/store (REGISTER-REGISTER) architecture entail?
In this architecture, data is firstly loaded from memory into registers. The instruction only then needs to specify which of the small number of registers to use as inputs, and another register to receive the result.
This is called a register-register architecture.
load/store architecture commands?
Load/store architectures require separate commands to move data between the main memory and the registers. These will typically look like:
Load – Set a register to the value at a given address Store – Set the value at a given memory address to the contents of a given register
Alternative to Load/store architecture
A further alternative is the register-memory architecture in which instructions access both register and memory locations
How can a further reduction in length of instructions be achieved?
Further reduction in the length of the instruction can be achieved by using one of the source registers also as the destination register. This means that the input data is overwritten during the operation. The PIC forces one source to be the working register, W, also known as the accumulator.
Instructions required for ALU operations?
Standard ALU operations (Arithmetic, Logic, Shift/Rotate) have their own instructions. 2 or more operands needed but this may be reduced by source/destination sharing.
During ALU operations how can modifiers be used in instructions?
Modifiers are often used to specify whether to use the carry bit or not. The PIC uses a modifier to determine which input is overwritten by the output (file register or W).
How are instructions required for non-ALU operations?
ALU instructions are no use on their own. We also need to be able to move data to and from memory, since the registers are too small to store all the data likely to be required.
As memory and I/O are connected to the Bus, we can use the same set of operations to solve both of these needs.
What is the stack?
The stack is a special block of memory that is especially reserved for saving data that will be used later.
The principle that the stack operates on?
It works on a FirstIn-Last-Out principle; it comes out in the reverse order to that with which it was added.
How is the stack pointer used?
This is a special register containing a data memory address, i.e. it ‘points’ to a memory location. It always points to the top of the stack. Therefore it keeps changing as data is added to or taken from the stack.