KS3 Revision Notes - 06 Translators.pptx - Teach Computer...

This preview shows page 1 - 6 out of 16 pages.

teachcomputerscience.com Translators Teach Computer Science KS3 Computing
teachcomputerscience.com Revision notes 1.
teachcomputerscience.com Introduction A computer is equipped with various components for a variety of jobs. Programs are used to instruct a computer about a task that has to be done. Programs are also used to prioritise tasks and give step- by-step instructions to a computer. Hence, a computer program can be defined as a set of instructions that enables a computer to perform a specific task. Programs can be written in high-level or low- level languages, according to the requirements of the user. Figure 1 shows the organisation of these programming languages. In this article, high-level languages, low-level languages and tools involved in the execution of a program are explained. Figure 1: Programming languages Binary code Machine code Assembly languages High-level languages Understandable by machine Understandable by human
teachcomputerscience.com High-level languages High-level languages enable a programmer to write programs for a computer without knowledge of the hardware and instruction sets of that computer. This type of language offers the advantage of being portable and, thus, can be used on different types of systems. Java, C++ and Python are a few examples of high-level languages. Learning a high-level language enables the user to apply similar programming concepts to other high-level languages. The following figure illustrates a typical high-level language code and its advantages. Code written in high-level programming language is called source code. Figure 2: High-level language Difference = number1 - number2; A typical statement in high-level language Easy to understand Written in short time Errors can be debugged at development stage Programs can be maintained while in use ADVANTAGES
teachcomputerscience.com Low-level languages Low-level languages are related to the hardware architecture and its instruction set. There are two types of low-level languages: Machine code, binary instructions that are understandable by the computer, and assembly language that needs to be converted to machine code. Assembly language Assembly language is used by programmers to make use of special hardware. The instructions used are dependent upon the type of machine. The code does not take up much space of primary memory and performs its task quickly. Code in assembly language to add two numbers is given below.

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture