Roles and components of the Processor Flashcards

1
Q

What is Machine Code?

A

Machine code instructions are written in binary code that the processor can interpret and execute

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

What are instruction sets?

A

The instruction set is the set of the machine code instructions that a particular type of processor can understand and execute.

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

What operations do instruction sets contain?

A
  • Arithmetic operations (ADD, SUB)
  • Data transfer operation (MOV, OUT)
  • Logical operations (AND, OR)
  • Jump operations (JMP, JZ – jump if zero)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How many bits are an Opcode?

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

How many bits are an operand?

A

12 bits

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

What is an op-code?

A

Op-code instructions are the part of a machine code instruction that represents a basic machine operation.

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

What is an operand?

A

Operand is value or memory address that forms part of a machine code instruction.

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

How are Instructions and data are located in memory?

A

Instructions and data are located in memory by using addressing modes

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

What is immediate addressing?

A
  • Immediate addressing means that the data in the operand is fixed; in other words, it is immediately available for use.
  • Typical example: ADD 12 – this instruction could be used to add 12 to the accumulator.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is an advantage of immediate addressing?

A

This is a very fast addressing mode since the data is readily available, rather than needing to obtain a data value from a memory address.

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

What is Direct Addressing?

A
  • Direct addressing, or absolute addressing, means that the code is directly referred to a memory location.
  • Example: ADD (1302) – this instruction adds the contents of memory location (1302) to the accumulator.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is an disadvantage of direct addressing?

A

The disadvantage of using code that directly refers to memory addresses is that the code cannot be relocated; therefore, it is typically used on single-program systems, such as a car engine fuel control system

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

What is assembly language?

A

Assembly language is used to make machine code instructions more understandable by using mnemonic codes

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

What is ARM?

A

ARM is a load-store architecture meaning that memory can only be accessed by:
* Loading from memory into a register
* Storing the result back into memory

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

Explain this example:
LDR r1, #12
ADD r2, r1, #5
SUB r3, r2, #3
STR r3, 1203

A

Immediate address loads the data without reference to an address
# indicates that the operand is a number
1. Loads the number 12 into the register r1
2. Adds the number 5 to value in r1 and stores result in r2 (making 17)
3. Subtracts the number 3 from value in r2 and stores result in r3 (making 14)
4. Stores the contents of the register r3 (14) into memory address 1203

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

Explain this Direct addressing example:
LDR r1, 12
ADD r2, r1, 13
SUB r3, r2, 14
STR r3, 150

A

In this case the operand is a memory address
1. Loads data in memory address 12 (4) into r1
2. Adds the data in memory address 13 (5) to r1 and stores result in r2 (making 9)
3. Subtracts the data in memory address 14 (3) from the r2 and stores result in r3 (making 6)
4. Stores the result in r3, which is 4 + 5 – 3 = 6 into memory address 150

17
Q

What is compare used for?

A

Compare is used to compare two values; the result is normally used as a setup for a conditional jump

18
Q

Explain this compare example?
CMP r1, #23
CMP r1, 23
CMP r1, r2

A
  • compares r1 with the number 23 (immediate addressing).
  • compares r1 with the number stored in memory address 23 (direct addressing)
  • compares r1 with register r2
19
Q

What is branching?

A

Branching is used for conditional statements or unconditional statements

20
Q

What is a label?

A

A label is a sequence of characters that identities a location in computer source code.

21
Q

What is unconditional branching?

A

Unconditional branching is a command where a section of code is jumped over, with no conditional testing

22
Q

What is conditional branching?

A

Conditional branching is a command where a section of code is jumped over based on a conditional test

23
Q

What is a logic bitwise operator?

A

Logical bitwise operator is where a logical operation is carried out on each column of two operands

24
Q

Whhat does in bitwise operations, the ‘#’ symbol mean?

A

In bitwise operations, the ‘#’ symbol in the instructions below indicates that the operand is a number and so is an example of immediate addressing

25
Q

What is a logic shift?

A

Logical shift is a bitwise operation where all the bits of an operand are shifted left or right. After the shift operation is completed the vacant-bit positions are filled with zeros.

26
Q

What are the rules of logic shift?

A

Logical shifts can be useful as efficient ways of performing multiplication or division of unsigned integers by powers of two.
* Shifting left by n bits has the effect of multiplying it by 2n.
* Shifting right by n bits has the effect of dividing it by 2n.

27
Q

What is a Halt?

A

Halt simply terminates the program operation