P2 T2 L9 The Processor Instruction Set Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Explain the Instruction set

3 points

A
  1. Computer processors have different ways of expressing instructions
  2. An instruction set describes the commands a processor can perform
  3. Different types of processors have their own instruction sets but they may perform similar or identical operations
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

State the types of instruction

6 types

A

An instruction may have the following types of instruction:

  1. Data transfer such as LOAD, STORE, MOVE
  2. Arithmetic operations such as ADD, SUBTRACT
  3. Comparison operations to compare two values
  4. Logical operations such as AND, OR, NOT
  5. Branch – conditional and unconditional
  6. Shift operations – shift bits left or right in a register
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is machine code?

3 points

A
  1. The instruction set defines all the instructions and how they are represented
  2. Instructions are combinations of binary 1s and 0s; the number of bits used depends on the word length of the processor
  3. This is known as machine code and is the only language the processor can understand
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Explain the components of an instruction

3 points

A
  1. An instruction typically includes two parts:
  2. Operation code (opcode) which includes:
    – the actual command the processor needs to carry out, eg. ADD, SUB, etc.
    –the addressing mode which specifies whether the operand is the actual data, the memory address where the data is held, or a register
  3. Operand(s) – one or more items of data (which can be values, memory addresses or registers) that are to be used in the instruction
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

The number of bits allocated to the _______ and _______ will vary according to the processor used.

A

opcode

operand

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

What is the operation code made up of?

2 parts in order

A
  1. Basic machine operation (First part of opcode, usually largest, e.g. 101101)
  2. Addressing mode (Second part of opcode, usually smallest, e.g. 00)

e.g.
|……………………….Operation code………………………..| Operand(s) |
| Basic machine operation | Addressing mode |
| 101101……………………………….| 00…………………………| 00001100….|
NOTE: “…….” are there because of brainscape not liking multiple spaces

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
Explain operands
(2 points)
A
  1. The operand contains a reference to the data that is to be used in the instruction
  2. This data may be either:
    - An actual value that can be used as presented
    - The address in memory where the data to be used is held
    - The register within the CPU where the data is held

e.g.
|……………………….Operation code………………………..| Operand(s) |
| Basic machine operation | Addressing mode |
| 101101……………………………….| 00…………………………| 00001100….|
NOTE: “…….” are there because of brainscape not liking multiple spaces

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

Explain addressing modes

2 points

A
  1. The addressing mode (typically 2 bits, e.g. 00) defines how the machine language instruction identifies the operand of each instruction.
  2. The data referenced in the operand may be either:
    - An actual value that can be used as presented
    - The address in memory where the data to be used is held
    - The register where the data is held

e.g.
|……………………….Operation code………………………..| Operand(s) |
| Basic machine operation | Addressing mode |
| 101101……………………………….| 00…………………………| 00001100….|
NOTE: “…….” are there because of brainscape not liking multiple spaces

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

(type of addressing mode)

Explain Immediate addressing (2 points)

A

|……………………….Operation code………………………..| Operand(s) |
| Basic machine operation | Addressing mode |
| 101101……………………………….| 00…………………………| 00001100….|
NOTE: “…….” are there because of brainscape not liking multiple spaces

  1. Immediate addressing is when the addressing mode (in this case it is 00) specifies that the data is a value (12 in this case), not an address.
  2. So the operand is the actual value to be used in the instruction.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

(type of addressing mode)

Explain Direct addressing (4 points)

A
  1. Direct addressing is when the addressing mode (e.g. 01) specifies that the data is an address, not a value.
  2. So the operand is the address of the location in the memory of the data to be used.

|……………………….Operation code………………………..| Operand(s) |
| Basic machine operation | Addressing mode |
| 101101……………………………….| 01………………………….| 00001100….|
NOTE: “…….” are there because of brainscape not liking multiple spaces

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

Machine code uses ____ ______ instructions.

Assembly language uses ___________ for instructions, for example LDA, ADD and MOV.

Both of these (machine code & assembly language) are ____ level languages.

Assembly language is much easier for programmers to code, but still much harder than a _____ _______ language such as Python or Delphi.

A

pure binary

mnemonics

low

high level

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

The format of instructions is determined by the processor ____________ set. This defines what the __________ code instructions mean and how the processor should execute them.

Instructions are made up of two parts: ____________, (which includes the addressing mode) and ____________.

The address mode determines how data used by the instruction can be found. _____________ addressing means the operand is the actual value to be used in the instruction.

_____________ addressing indicates that operand is the address of the data to be used.

A

instruction

machine

opcode

operand

immediate

direct

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