levo

Fundamentals of Computer Organisation and Architecture

The processor instruction set

  • 2 things to know
  • Paper 2
Start revising · £5/month

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.

Everything in your subscription

Runs, plus a mode for every other kind of session.

1Flash
2Imposter
3Fade
4Brain dump

Learn every subtopic in runs of four questions

Facts flash and fade, a wrong word hides in some of them, and a brain dump decides which questions are locked in.

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

Cram the night before, weakest topic first

A quick scan finds your weakest topics. Recall each fact you missed three times in a row.

A driver is .
softwarehardwarestorage

Blank Blitz consolidates the facts

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

✓What it iscovered
~Why it happenspartly there
How long it lastsnot there yet

Explain It tests your understanding

Explain a concept in your own words and see which of its points you covered.

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

Test It catches misconceptions

Spot the fault in a statement. The faults are the mistakes students make most often.

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.

Learn it in runs of four questions, each ending on a brain dump against the clock. Every question you lock in comes back the next day, then at longer gaps, each time just before you would forget it.

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