Presentation is loading. Please wait.

Presentation is loading. Please wait.

The CPU The Central Presentation Unit Language Levels Fetch execute cycle Processor speed.

Similar presentations


Presentation on theme: "The CPU The Central Presentation Unit Language Levels Fetch execute cycle Processor speed."— Presentation transcript:

1 The CPU The Central Presentation Unit Language Levels Fetch execute cycle Processor speed

2 Language Generations: Evolution of Programming Languages

3 First Generation The first generation of languages was very difficult to understand and also to code This 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.

4 1 st Generation traits 1. This generation was very fast as the computer would not need to translate the language but would understand it right away 2. It allows limited calculations such as simple arithmetic, logical operators, incrimination or decrementation and shift operations only 3. It cannot be run on another machine, unless it is identical

5 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 binary

6 Examples of Opcodes Machine CodeAssemblyDescription 0000ENDStops the program 0001ADDAdds contents of memory location to accumulator 0010SUBSubtracts contents of memory location from accumulator 0011MULTMultiplies contents of memory location to accumulator 0100DIVDivides contents of memory location into accumulator 0101LDACopy contents of memory locations into the accumulator 0110STOCopy contents of the accumulator into the memory location 0111INInput from Input Unit to memory location 1000OUTOutput contents of memory location to Output Unit 1001JMPTransfer Control to Instruction in Named Location 1010JNZJump if contents of Accumulator is not Zero

7 Third Generation / High-level Language The third generation of languages was a very big improvement from the second generation This generation incorporated the use of English-like statements Since this language is coded in English-like statements a compiler or an interpreter is needed to translate the language to binary

8 Compiler Vs. Interpreter The Compiler Translates 3 rd Generation languages The code is translated all at once Errors shown at the end of the translation Fast translation The Interpreter Translates 3 rd Generation languages The code is translated line by line Errors are shown after each line is translated Much slower translation

9 Examples of the 3 rd 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

10 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 drop

11 Fifth Generation Lastly we have the fifth generation languages, which are the closest to the human language This generation is used in artificial intelligence

12

13 The Fetch Execute Cycle The Fetch Execute Cycle Actions that a (CPU) performs to execute instruction

14 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

15 Abbreviations CU = Control Unit PC = Program Counter IR = Instruction Register ALU = Arithmetic Logic Unit ACC = Accumilator

16 The Fetch Execute Cycle 1. The CPU sends the value of the PC on the address bus. 2. The CPU fetches the instruction from main memory along the data bus into the IR 3. The data in the IR is decoded by the CU 4. The 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) 5. If there is another instruction the PC is incremented by 1and the cycle is repeated. If not the instruction set ends

17 Start PC = Address of 1 st Instruction Fetch Instruction from location found at PC Store 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 Counter

18 Assembly Code(Using the FEC) This allows the user to input 2 numbers and display their total OpcodeOperandDescription IN100Get input from keyboard and store it in location 100 IN101Get input from keyboard and store it in location 101 LDA100Copy contents of location 100 to the accumulator ADD101 Add the number found in location 101 to the accumulator STO102Copy the number in the accumulator to location 102 OUT102Display the contents of 102 to an output device

19 STEPPCIRACC100101102OUT 11 21IN 100 31 5 42 5 52IN 101 5 62 510 73 5 83LDA 100 510 93LDA 1005 510 455 114ADD 1015510 124ADD 10115510 13515510 145STO 10215510 155STO 1021551015 166STO 1021551015 1761551015 186OUT 1021551015

20 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 buses ◦ the amount of cache

21 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)


Download ppt "The CPU The Central Presentation Unit Language Levels Fetch execute cycle Processor speed."

Similar presentations


Ads by Google