A451: Instructions Flashcards

1
Q

What are the three parts of an ‘instruction code’?

A
  • Number bit
  • Operand
  • Op-code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Explain what is meant by ‘machine code’ or ‘machine language’.

A

Machine code or machine language is a system of instructions and data executed directly by the central processing unit of a computer

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

State the format in which the instructions are coded.

A

The instructions are encoded in binary.

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

What is the name given to the range of instructions that can be executed?

A

The instruction set.

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

State whether there is a common set of instructions or if each set is unique for each processor or family of processors.

A

The instructions are unique for each processor type.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
  • Each machine code instruction consists of two fields.

- State the names of each of these fields and the information that they contain.

A
  • The two fields are the opcode and the operand.
  • The opcode specifies the operation that is to be performed, e.g. add numbers or store data
    in a register.
  • The operand stores the data that is to be used or the register in which it can be found or
    has to be stored.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Explain what mnemonics are and why they are used by programmers.

A

A mnemonic is a word that is used to represent an opcode, as it is difficult for programmers
to remember all of the opcodes in binary format and use them accurately when coding
algorithms.

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

0000 STO

A

Store data at memory location indicated by the operand.

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

0001 LOAD

A

Load the number located in the operand.

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

0010 LOAD

A

Load the number found at the memory location indicated by the operand.

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

0100 ADD

A

Add the number located in the operand.

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

1000 ADD

A

Add the number found at the memory location indicated by the operand.

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

Load the number 13.

A

Opcode Operand

0001 0001101

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

Load the number found at memory location 6

A

Opcode Operand

0010 00000110

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

Add the number 113.

A

Opcode Operand

0100 01110001

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

Load the number 10, add the number 21 and store the result at memory location 30.

A

Opcode Operand
0001 00001010
0100 00010101
0000 00011110

17
Q

State the data that would be found at memory location 30.

A

000011111

18
Q

Explain what is meant by an opcode? (2)

A

An opcode is the portion of amachine language instruction (1) that specifies the operation to be performed by a microprocessor. (1)

19
Q

Explain what is meant by an operand? (2)

A

The operand contains either the data that has to used in an operation (1) or a memory address where data can be found or stored. (1)

20
Q

How is the information contained in opcodes and operands coded?

A

In binary format.

21
Q

State the name for the words that programmers use to represent opcodes.

A

Mnemonics.

22
Q

Explain how instructions are coded as bit patterns?

A
  • Programming instructions are compiled into binary to turn on the correct parts of the CPU circuitry
23
Q

Describe CPU?

A

The CPU is a complex combination of circuits to provide logic.

24
Q

How do logical operations work?

A

Each logical operation is given a binary code. Example 1000 Add.

25
Q

Explain how the computer distinguishes between instructions and data

A
  • Data is separated in memory into different spaces, becasue of the fact that data is inseparable from the binary for the instruction