• Home
    Stuff

    Welcome to our page, Madam Amni! :)

    Done by; Iman Sofea, Fatin Adira, Beh Soo Yuan, Hidayah, Dorothea & Nadiah Nazira.
Chapter 3 -- Instruction Sets: Characteristics & Functions (Part A)

______________________________________________________

Instruction Set

  • Instruction set is a collection of commands that the processor can understand and execute.
  • It can be in the form of binary or assemble codes.
  • The elements of a machine instruction are :- 


1) Opcode (Operation code)

- Specifies the operations that needs to be done.
- Example: 

  • ADD, SUB, MUL

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



1) Data Processing
- To do arithmetic and logic operations

2) Data Storage
- 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.

3) Control
- Testing data and branching of instructions.
- Examples : JUMP, LOOP

4) Data movements
- 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.
________________________________________________________


Instruction Set Design

  • 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:-



1) Operation Repertoire
- List of operations that can be done.
- List of opcodes and what each opcode can do.

2) Data type
- Type of data that can be operated on.
- Integers, floating point numbers, characters.

3) Instruction format
- Length of the instruction, how many bits?
- How many addresses required? 0? 1? 2? 3?

4) Registers
- Numbers of registers available for use.
- Which operations can be performed on which registers?

5) Addressing mode
- Direct addressing? Immediate addressing?

________________________________________________________


Types of Operands

  • Machine instructions operate of data
  • Categories of data:-
1) Addresses
- Considered as unsigned integers.

2) Numbers
- Integers, binary, floating point, hexadecimal, octal.

3) Characters
- String/text and characters values are easily understood by humans, but not by a machine.

4) Logical
- Values of 1 or 0 to denote true or false values.
- Common naming convention is flag.


______________________________________________________


Types of Operations

  • 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

2) Arithmetic
- To do calculations
- Example: Add, sub, mul, div, increment, decrement

3) Logical
- Example: And, or, not, shift, rotate

4) Transfer of Control
- Example: When an interrupt happens, the program will jump to another section to handle the interrupt.
- Jump, return, skip, wait.

5) I/O
- Getting input from keyboard or to display results onto the monitor.
- Input (read), output (write)

6) Conversion
- Example: To change format -- hex to binary

7) System control
- 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.


______________________________________________________

.THE END.




Done by -- Fatin Adira bt Isa :)
1121116023


_______________________________________________________




Wednesday 1 May 2013 08:10 / 0 commentator(s) | Just click and you'll see. | Scroll up to top