Chapter 3: Instruction Set Architecture Flashcards

1
Q

Word size (data word)

A
  • 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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What determines how big the instructions need to be?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the Operand?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How is main memory accessed?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How can instructions be shortened?

A

Instructions can be dramatically shortened if a load/store architecture is used instead.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does the load/store (REGISTER-REGISTER) architecture entail?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

load/store architecture commands?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Alternative to Load/store architecture

A

A further alternative is the register-memory architecture in which instructions access both register and memory locations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How can a further reduction in length of instructions be achieved?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Instructions required for ALU operations?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

During ALU operations how can modifiers be used in instructions?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How are instructions required for non-ALU operations?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the stack?

A

The stack is a special block of memory that is especially reserved for saving data that will be used later.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

The principle that the stack operates on?

A

It works on a FirstIn-Last-Out principle; it comes out in the reverse order to that with which it was added.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How is the stack pointer used?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What happens when a new piece of data is pushed onto the stack?

A

When an instruction pushes data from a register onto a stack it decrements the stack pointer by one word address and then copies the data to the memory location specified by the stack pointer.

17
Q

How is data pulled off the stack?

A

. Reading data uses the reverse process – copy the data at the address given by the stack pointer, and then increment the stack pointer. This is called pulling or popping data off the stack. (Note it is also possible to invert the direction of expansion.)