13
Implementing Software Solutions The Role of the CPU

The Role Of The Cpu

  • Upload
    gavhays

  • View
    11.332

  • Download
    1

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: The Role Of The Cpu

Implementing Software Solutions

The Role of the CPU

Page 2: The Role Of The Cpu

Syllabus

The role of the CPU in the operation of software Machine code and CPU operation:

Instruction format Use of registers and accumulators Use of program counters and the fetch execute cycle Addresses called routines Linking, including use of DLL’s

Page 3: The Role Of The Cpu

Why Does the CPU Do?

Controls the transfer of data and instructions. All the CPU does is run programs by fetching

instructions from RAM, evaluating them, and executing them in sequence.

Known as the FETCH-EXECUTE-CYCLE Responsible for detecting errors.

Page 4: The Role Of The Cpu

Machine Code

It is the selected language of computer systems known as Binary.

It is translated by the CPU. Each instruction (Binary Sequence) has TWO

parts:

1001 101011011 1110

OPCODE OPERAND

Page 5: The Role Of The Cpu

Opcode/Operand

Opcode – Is the instruction i.e COPY

Operand – Has two distinct parts: Memeory Address Data

Page 6: The Role Of The Cpu

Hierarchy of Execution

Source Code

Machine Code

Opcode(Instruction)

Operand(Memory Address)

Operand(Data)

Visual Basic

Binary

Assembly Language

Page 7: The Role Of The Cpu

RAM

ALU

Fetch-Execute-Cycle

Control Unit

Decode

Execu

te

Fet

ch

Store

Page 8: The Role Of The Cpu

Fetch-Execute-Cycle

1. Fetch (Where to Go?) The next instruction is retrieved from

primary storage.

2. Decode (What to do?) The control unit decodes the instruction into

an opcode (Instruction) and operand (Data). Sent to the ALU.

Page 9: The Role Of The Cpu

Fetch-Execute-Cycle

3. Execute (Carry out Instruction) The ALU performs the instruction.

4. Store (Copy Results) The control unit places the result of the

execution in a register.

Page 10: The Role Of The Cpu

Activity 1

InstructionsLOAD 113 from mem469 and STORE in accumulator.Load 214 from mem490 and STORE in accumulator.ADD accumulator contents.STORE accumulator in mem476.

Outline the steps with the fetch-execute cycle and their respective processes required in processing the above instructions.

Page 11: The Role Of The Cpu

Linking including Use of DLLs

During execution the mainline of a program can call on subprograms to perform specific tasks. These include:

Subprograms written by the developer. Subprograms included in the development structure of

the programming language. These subprograms form part of a library and can be called upon without writing a specific subprogram. i.e. Randomize function.

Subprograms built into the operating system. i.e. save or print commands.

Page 12: The Role Of The Cpu

Linking including Use of DLLs

Linker – Is part of the translation program that handles call and return processes from the mainline to subprograms.

DLLs – (Dynamic Link Libraries) are common files used in modern programming to reduce the need for multiple subprograms. DLLs can be called from many application and programs can use the same DLL.

Page 13: The Role Of The Cpu

Key Terms

Machine Code CPU Processor Flag Register ALU Accumulator Control Unit Program counter Buses