Upload
gavhays
View
11.332
Download
1
Embed Size (px)
DESCRIPTION
Citation preview
Implementing Software Solutions
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
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.
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
Opcode/Operand
Opcode – Is the instruction i.e COPY
Operand – Has two distinct parts: Memeory Address Data
Hierarchy of Execution
Source Code
Machine Code
Opcode(Instruction)
Operand(Memory Address)
Operand(Data)
Visual Basic
Binary
Assembly Language
RAM
ALU
Fetch-Execute-Cycle
Control Unit
Decode
Execu
te
Fet
ch
Store
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.
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.
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.
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.
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.
Key Terms
Machine Code CPU Processor Flag Register ALU Accumulator Control Unit Program counter Buses