230 likes | 496 Views
The CPU. 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 was very difficult to understand and also to code
E N D
The CPU The Central Presentation Unit Language Levels Fetch execute cycle Processor speed
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.
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 only • It cannot be run on another machine, unless it is identical
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
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
Compiler Vs. Interpreter The Compiler • Translates 3rd Generation languages • The code is translated all at once • Errors shown at the end of the translation • Fast translation The Interpreter • Translates 3rd Generation languages • The code is translated line by line • Errors are shown after each line is translated • Much slower translation
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
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
Fifth Generation • Lastly we have the fifth generation languages, which are the closest to the human language • This generation is used in artificial intelligence
The Fetch Execute CycleActions that a (CPU) performs to execute instruction
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
Abbreviations • CU = Control Unit • PC = Program Counter • IR = Instruction Register • ALU = Arithmetic Logic Unit • ACC = Accumilator
The Fetch Execute Cycle • The CPU sends the value of the PC on the address bus. • The CPU fetches the instruction from main memoryalong the data bus into the IR • The data in the IR is decoded by the CU • 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) • If there is another instruction the PC is incremented by 1and the cycle is repeated. If not the instruction set ends
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. Start PC = Address of 1st Instruction Fetch Instruction from location found at PC Abbreviation: PC – Program Counter Store a copy of fetched Instruction into IR No PC = PC + 1 End of Program? Yes Execute Instruction End
Assembly Code(Using the FEC) • This allows the user to input 2 numbers and display their total
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
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)