Download presentation
Presentation is loading. Please wait.
1
Programming Languages
Friday, 18 January 2019 Mr C. Coetzee Programming Languages 4.3.1 4.3.2 4.3.3 4.3.4 4.3.5
2
4.3.1 State the fundamental operations of a computer
3
Fundamental operations
Add Compare Retrieve Store (data)
4
4.3.2 Distinguish between fundamental and compound operations of a computer
5
Fundamental vs Compound
A fundamental operation could be something like , multiply two numbers, store a number, move a number to another location etc. These are operations that do not require the processor to go through a large number of sub operations to reach a result. A compound operation is an operation that involves a number of stages/other operations. Think of it as a group of operations that combine together to form an operation.
6
4.3.3 Explain the essential features of a computer language
7
Natural vs Computer languages
Natural (Human) Computer (Java) Varying vocabulary ‘way’ Fixed vocabulary int, public, String Ambiguous He saw that gas can explode Unambiguous meaning String answer = “#yolo”; Grammar & syntax inconsistent Grammar & syntax consistent
8
4.3.4 Explain the need for higher level languages
9
Why high level? High level language = similar to human language (like English) Low level language = close to the binary code used to actually process the instruction. As human needs for computer systems have expanded, it is necessary to abstract from the basic operations of a computer. It would take far too long to write the type of systems needed today in machine code.
10
4.3.5 Outline the need for a translation process from a higher level language to machine executable code
11
Video
12
Key terms Compiler - If the translator translates a high level language into a lower level language (done in a batch) Interpreter - the translator translates a high level language into an intermediate code which will be immediately executed by the CPU (done line by line) Assembler - the translator translates assembly language to machine code (mnemonics to binary)
13
Levels of language
14
Virtual machine … is a piece of software designed to behave like hardware. You can think of it as simulating how the hardware of a computer works. With this kind of software you could emulate a smartphone (say an HTC wildfire for example) on your PC. This might be handy if you are writing software that will run on the phone and would allow you to complete testing before you actually install the software onto the actual real device.
15
Java virtual machine Java applications run on a virtual machine (the Java Virtual Machine or JVM). This virtual machine is installed on the computer (e.g. PC, Mac, Smart Phone, Ticket Machine) and allows the same java code to be run on many different types of hardware. Even though the hardware architecture and instruction sets of each of these devices is different the virtual machine is the same. The trick is that the virtual machine software needs to match the hardware it will be installed on, so you need to get the correct version of the virtual machine, but once you have it then you can run any java program. This is good for the java programmer as he does not have to write lots of different versions of the program he is writing, for each of the devices he wants it to run on. After the java program is written it can be deployed to any device that has the Java Virtual Machine installed on it.
16
Write once, run anywhere!
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.