The Central Presentation Unit Language Levels Fetch execute cycle Processor speed Language G enerations Evolution of Programming Languages First Generation The first generation of languages ID: 568734
Download Presentation The PPT/PDF document "The CPU" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
The CPU
The Central Presentation Unit Language Levels Fetch execute cycle Processor speedSlide2
Language G
enerations:Evolution of Programming Languages Slide3
First Generation
The first generation of languages was very difficult to understand and also to codeThis language was based on machine code language, hence the programmer would need to use binary to create a program For this particular generation, punched tape was used, where a hole would represent a 1 and no-hole meant a 0.Slide4
1st Generation traits
This generation was very fast as the computer would not need to translate the language but would understand it right away It allows limited calculations such as simple arithmetic, logical operators, incrimination or decrementation and shift operations onlyIt cannot be run on another machine, unless it is identicalSlide5
Second Generation / Assembly Language
The second generation language, was also based on machine code, This language was much easier as it used mnemonics (opcodes and operands)Programming was much easier because the programmer does not have to remember a list of binary digits Since this code is not in machine code an assembler is used to convert the code to binarySlide6
Examples of Opcodes
Machine CodeAssembly
Description0000ENDStops the program0001
ADDAdds contents of memory location to accumulator0010SUBSubtracts contents of memory location from accumulator
0011
MULT
Multiplies contents of memory location to accumulator
0100
DIV
Divides contents of memory location into accumulator
0101
LDA
Copy contents of memory locations into the accumulator
0110
STO
Copy contents of the accumulator into the memory location
0111
IN
Input from Input Unit to memory location
1000
OUT
Output contents of memory location to Output Unit
1001
JMP
Transfer Control to Instruction in Named Location
1010
JNZ
Jump if contents of Accumulator is not ZeroSlide7
Third Generation / High-level Language
The third generation of languages was a very big improvement from the second generationThis generation incorporated the use of English-like statementsSince this language is coded in English-like statements a compiler or an interpreter is needed to translate the language to binary Slide8
Compiler Vs. Interpreter
The Compiler Translates 3rd Generation languagesThe code is translated all at onceErrors shown at the end of the translationFast translation The InterpreterTranslates 3rd Generation
languagesThe code is translated line by lineErrors are shown after each line is translated Much slower translation Slide9
Examples of the 3rd Generations
FORTRAN - mathematics formulas, scientific problems, engineering problems COBOL – business oriented BASIC – very easy to understand, ideal to learn programming PASCAL – mostly used for teaching purposes C – used to write operating systems, database management system, scientific applications LISP – artificial intelligence LOGO – teach children problem-solving and programming skills C ++ - An improved C, very popular and powerful
JAVA – Very popular and powerful, also cross-platform Slide10
Fourth Generation
The fourth generation language is much closer to the human language and is very fast to code A typical example of the ease of use of 4th generation languages is the creation of a GUI.To create a GUI in JAVA would be quite difficult because of the code required for each component, with 4GL creating it would be simply drag and dropSlide11
Fifth Generation
Lastly we have the fifth generation languages, which are the closest to the human languageThis generation is used in artificial intelligenceSlide12Slide13
The Fetch Execute Cycle
Actions that a (CPU) performs to execute instructionSlide14
What is the Fetch Execute Cycle?
The Fetch execute cycle is also sometimes know as the Fetch-decode-execute cycle This cycle explains what goes on within the CPU when an instruction is being processed Slide15
Abbreviations
CU = Control UnitPC = Program CounterIR = Instruction Register ALU = Arithmetic Logic Unit ACC = Accumilator Slide16
The Fetch Execute Cycle
The CPU sends the value of the PC on the address bus. The CPU fetches the instruction from main memory along the data bus into the IRThe data in the IR
is decoded by the CUThe decoded information is sent to the relevant function units of the CPU (such as reading values from registers, passing them to the ALU, writing them to a certain register)If there is another instruction the PC is incremented by 1and the cycle is repeated. If not the instruction set ends Slide17
Start
PC = Address of 1
st InstructionFetch Instruction from location found at PCStore a copy of fetched Instruction into IR PC = PC + 1 Execute Instruction
End of Program?End
No
Yes
Note: When executing the instruction the following takes place:
Get data required from main memory
Place it in Data Registers
Activate correct circuits to work out instruction
Transfer results back to main memory.
Abbreviation:
PC – Program CounterSlide18
Assembly Code(Using the FEC)
This allows the user to input 2 numbers and display their total Opcode
OperandDescriptionIN100
Get input from keyboard and store it in location 100IN101Get input from keyboard and store it in location 101LDA
100
Copy contents of location 100 to the accumulator
ADD
101
Add the number found in location 101 to the accumulator
STO
102
Copy the number in the accumulator to location 102
OUT
102
Display the contents of 102 to an output deviceSlide19
STEP
PCIR
ACC100101102OUT11
21IN 100 31IN 100 5
4
2
5
5
2
IN 101
5
6
2
IN 101
5
10
7
3
5
10
8
3
LDA 100
5
10
9
3
LDA 100
5
5
10
10
4
5
5
10
11
4
ADD 101
5
5
10
12
4
ADD 101
15
5
10
13
5
15
5
10
14
5
STO 102
15
5
10
15
5
STO 102
15
5
10
15
16
6
STO 102
15
5
10
15
17
6
15
5
10
15
18
6
OUT 102
15
5
10
15
15Slide20
Processor Speed
The clock rate measures the number of instructions done by the CPU per second, this is measured in hertz.When comparing the speeds of entire computers you need to look at the clock rate of the RAM, the width in bits of the CPU's busesthe amount of cacheSlide21
Clock Speed History
The original IBM PC,(1981),had a clock rate of 4.77 MHz (4,770,000 cycles/second)In 1995, Intel's Pentium chip ran at 100 MHz (100 million cycles/second)In 2002, an Intel Pentium 4 model has a clock rate of 3 GHz (three billion cycles/second)