1) Opcode (Operation code)
- Specifies the operations that needs to be done.
- Example:
2) Source Operand Reference
- Any operation will need one or more operand/variables/inputs.
- Example:
- B and C are operands.
- Operands can be from the I/O devices such as keyboards, registers or main memory.
3) Next instruction Reference
- Tells the processor to fetch the next instruction once the current instruction is completed.
4) Result Operand Reference
- Where to store the result of the operation.
_______________________________________________________
Instruction Representation
- Instructions are represented by a sequence of bits.
- These bits are then divided into different fields/sections.
- Example:
Opcode
|
Operand
1
|
Operand 2
|
4 bit
|
6
bit
|
6 bit
|
- Opcodes are represented using abbreviations called mnemonics.
- Example: ADD, SUB, LOAD
- ADD A, B -- Get the value in address B to be added with the value in address A and store in address A.
____________________________________________________
Instruction Types
- To do arithmetic and logic operations
- Take data from memory and store in registers and vice versa.
- Take data from I/O devices and store in memory or registers and vice versa.
- Testing data and branching of instructions.
- Move data from devices to memory and vice versa.
_____________________________________________________
Number Of Addresses In An Instruction
- One way of describing a processor's architecture is in terms of the number of addresses contained in each instruction.
- The maximum number of addresses for an instruction is depends on what operation needs to be done. Different processors might have different addresses for different reasons.
- The implication of having lesser and more addresses in an instruction:-
Lesser Addresses
|
More Addresses
|
- Need lesser registers.
- Instruction looks much for simpler and less
complex.
- Need more lines of instruction for a complete
program thus making the program longer.
- Faster in terms of fetching and executing
instructions.
|
- Need more registers.
- Instructions become more complex and longer.
- Fewer lines of instructions are required thus
making the program shorter.
-Takes longer time to fetch and execute each instruction.
|
________________________________________________________
- Design of the instruction set is important and complex because it affects many parts of the computer system.
- Programmers use this instructions set to control the processor (tell the processor what to do).
- Designs issues to consider:-
- List of operations that can be done.
- List of opcodes and what each opcode can do.
- Type of data that can be operated on.
- Integers, floating point numbers, characters.
- Length of the instruction, how many bits?
- How many addresses required? 0? 1? 2? 3?
- Numbers of registers available for use.
- Which operations can be performed on which registers?
- Direct addressing? Immediate addressing?
________________________________________________________
- Machine instructions operate of data
- Categories of data:-
1) Addresses
- Considered as unsigned integers.
- Integers, binary, floating point, hexadecimal, octal.
- String/text and characters values are easily understood by humans, but not by a machine.
- Values of 1 or 0 to denote true or false values.
- Common naming convention is flag.
______________________________________________________
- Different machines use different opcodes. But there are many general ones that are used by majority of the processors.
- The categories of operations:-
1) Data transfer
- To more data from one location to another.
- Example: Move, store, load, set, push, pop
- Example: Add, sub, mul, div, increment, decrement
- Example: And, or, not, shift, rotate
- Example: When an interrupt happens, the program will jump to another section to handle the interrupt.
- Jump, return, skip, wait.
- Getting input from keyboard or to display results onto the monitor.
- Input (read), output (write)
- Example: To change format -- hex to binary
- Instructions reserved only for OS to use.
- Maybe to set registers to Read Only mode.
- Maybe to set only certain operations can access certain registers.
______________________________________________________
Done by -- Fatin Adira bt Isa :)
1121116023
_______________________________________________________