levo

Fundamentals of Computer Organisation and Architecture

The processor instruction set

  • 2 things to know
  • Paper 2

Overview

Recall questions on opcode and operand, why an instruction set is processor specific, and decoding a given byte into its operation and its operand.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Process

In the simple model used here, how is the addressing mode indicated?

Process

An 8-bit instruction has a 4-bit opcode and a 4-bit operand; the operation bits 011 mean ADD, and a final opcode bit of 0 selects immediate addressing while 1 selects direct. Interpret the byte 0111 0101, and say how it differs from 0110 0101.

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    What is meant by a processor instruction set?

    Model answer

    The instruction set is the complete set of machine code instructions that a particular processor is built to recognise and execute, together with the binary format of each one and the addressing modes each supports. It is the full list of everything the hardware knows how to do, and every program that runs on that processor is ultimately made of nothing but instructions from this set.

  2. 2

    Why is an instruction set described as processor specific, and what follows from that?

    Model answer

    Because the set of operations, the binary patterns that stand for them, the number and width of the registers and the instruction format are all fixed by the physical design of that processor's circuitry, and different manufacturers and different families make different choices. It follows that a machine code program written for one processor family will not run on another, that assembly language is not portable, and that a compiler must be written to target a specific instruction set. It is also why high-level languages exist: source code can be recompiled for any processor, while machine code cannot be moved.

  3. 3

    What are the two parts of a machine code instruction?

    Model answer

    The opcode and one or more operands. The opcode says which operation is to be carried out. The operand supplies what it is to be carried out on, and may be a value, a memory address or a register.

  4. 4

    What can an operand be?

    Model answer

    A value, a memory address, or a register. Which of these it is depends on the addressing mode indicated by the opcode: in immediate addressing the operand is the value itself, and in direct addressing it is the address of the value, where the address may refer to a main memory location or to a register.

  5. 5

    In the simple model used here, how is the addressing mode indicated?

    Model answer

    There is no separate field for it. The bits set aside for the opcode carry the addressing mode as well as the operation, so one opcode settles two things at once: which machine operation is to be performed, and how the operand that follows is to be interpreted. Adding a constant and adding the contents of a memory location are therefore two distinct opcodes with two distinct bit patterns, even though the arithmetic is identical — one means 'add, immediate', the other 'add, direct'. Decoding the opcode is thus all the processor needs in order to know both what to do and where to find the data to do it to.

  6. 6

    An instruction is 8 bits long. Four bits are allocated to the opcode, of which 3 bits give the basic machine operation and 1 bit gives the addressing mode, and 4 bits are allocated to the operand. How many different opcodes are possible?

    Model answer

    Sixteen. The opcode field is 4 bits wide, and 2 to the power 4 is 16, so 16 different opcodes can be distinguished. Those 16 are made up of 2 to the power 3, that is 8, basic machine operations, each available in 2 addressing modes.

Other ways to work this

The same content, four other ways.

What is inside Levo

Six ways to work the same material.

1Closed book
2Open book
3Closed book

The 3-step method, run for you

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

Fundamentals of Programming
Fundamentals of Data Structures
Fundamentals of Algorithms
Theory of Computation

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

A driver is .
softwarehardwarestorage

Blank Blitz makes facts automatic

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

AThe integer 5 is 0101.
B0.75 is 1/2 + 1/4.
CThe fraction bits are 1100.

Build It gets the exam shape right

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

Head means the first single element of a non-empty list.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Fundamentals of Computer Organisation and Architecture, on a schedule.

Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.