10101010 Represents different voltage levels High 5 Volts

  • Slides: 9
Download presentation

10101010 Represents different voltage levels High: 5 Volts Low: 0 Volts At this raw

10101010 Represents different voltage levels High: 5 Volts Low: 0 Volts At this raw level a digital computer is instructed to carry out instructions.

(The processor decodes and executes these instructions) 0001 0000 1111 ADD R 1, #15

(The processor decodes and executes these instructions) 0001 0000 1111 ADD R 1, #15 The machine code instructions can also be represented by assembly code mnemonics that is a more user friendly code.

(The processor decodes and executes these instructions) Compiled high level language programs are translated

(The processor decodes and executes these instructions) Compiled high level language programs are translated into machine code, so they are ready to be executed on a computer. The processor then decodes and executes the machine code instructions. Machine code instructions consist of a series of binary digits (bits) in two parts represented below: Opcode Operand Machine Code Instruction

(The processor decodes and executes these instructions) A machine code instruction is a series

(The processor decodes and executes these instructions) A machine code instruction is a series of operational codes and operand parts as shown below: Machine Code Instruction Operation Code Operand Part This is the basic machine code operation eg ADD Represents one item of data or the address of one item of data

(The processor decodes and executes these instructions) MC Instructions (16 bits) Mnemonics Explanation 0001

(The processor decodes and executes these instructions) MC Instructions (16 bits) Mnemonics Explanation 0001 0000 0011 LOAD #3 Place 3 into the accumulator 1000 0000 1101 STORE 13 Place a copy of the accumulator contents into the memory location with address 13 0001 0000 0110 LOAD #6 Place 6 into the accumulator 0100 0000 1101 ADD 13 Sum the contents of the accumulator and memory location 13; place the result into the accumulator 1000 0000 1110 STORE 14 Place a copy of the accumulator contents into the memory location with address 14.

(The processor decodes and executes these instructions) The machine code instructions are difficult for

(The processor decodes and executes these instructions) The machine code instructions are difficult for people to understand. Therefore, assembly code instructions have been developed to represent them.

(The processor decodes and executes these instructions) Op-code: 4 bits Basic Machine Code Operation

(The processor decodes and executes these instructions) Op-code: 4 bits Basic Machine Code Operation Explanation 0000 Load involving main memory Load the accumulator register with a value fetched from the main memory location specified in operand part of the instruction 0001 Load involving operand part Load the accumulator register with the value in the operand part of the instruction 0100 Add involving main memory Add to the content of the accumulator a value fetched from main memory location specified in the operand part of the instruction 0101 Add involving operand part Add to the contents part of the accumulator the value in the operand part of the instruction. 1000 Store involving main memory Store the contents of the accumulator in the main memory location specified in the operand part of the instruction.

(The processor decodes and executes these instructions) Machine code instructions can be represented in

(The processor decodes and executes these instructions) Machine code instructions can be represented in various ways: • 0000 1111 Can represent the value 255 or it can represent a main memory location.