0% found this document useful (0 votes)
32 views18 pages

CH04 - Software

The document discusses different types of programming languages including high-level and low-level languages. It explains how high-level languages are more portable while low-level languages like machine code are not. It also covers translators that convert code between levels like assemblers, interpreters and compilers.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views18 pages

CH04 - Software

The document discusses different types of programming languages including high-level and low-level languages. It explains how high-level languages are more portable while low-level languages like machine code are not. It also covers translators that convert code between levels like assemblers, interpreters and compilers.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 18

CH04 – SOFTWARE

SOFTWARE
CHAPTER 4

CIE IGCSE LEVEL: COMPUTER SCIENCE /0478/


CH04 – SOFTWARE

Types of programming language


• When you are writing computer programs you will make use of specific
software that allows you to write, edit, test and run the programs you
write.
• Programming languages can be categorised as high-level and low-level.

CIE IGCSE LEVEL: COMPUTER SCIENCE /0478/


CH04 – SOFTWARE

High-level
• A high-level language uses human-language style words. These could be
English words that we recognise and use day-to-day. For example, if,
while, output, print, input; as people we understand these, but they are
also high-level language instructions.
• We will be learning to use a high-level language, for example, Python, Java and VB.NET.

CIE IGCSE LEVEL: COMPUTER SCIENCE /0478/


CH04 – SOFTWARE

• Here are some examples of high-level language statements:


• Python:
• print("This is a high-level language statement")
• VB.NET:
• Dim x as integer x = Console.readline()
• Java:
• num1 = 10; num2 = 5; num3 = num1 + num2;

• A program that is written in a high-level language is considered portable;


you can write a program on one computer, and run it on a different
computer.

CIE IGCSE LEVEL: COMPUTER SCIENCE /0478/


CH04 – SOFTWARE

Low-level
• There are two main types of low-level language, machine code and
assembly language. A computer executes machine code, this is in binary
(1s and 0s). If you write a program in a high-level language it needs to be
converted into machine code before it can executed.

CIE IGCSE LEVEL: COMPUTER SCIENCE /0478/


CH04 – SOFTWARE

• Different computers may have different machine code (for example,


depending on the manufacturer). This means that machine code is non
portable; you can write a program in machine code and it may not run on
a different computer.
• An example of machine code is: 01100110

CIE IGCSE LEVEL: COMPUTER SCIENCE /0478/


CH04 – SOFTWARE

• Assembly language is an in-between stage. It uses mnemonics to


represent code, for example, to store data in a memory location it may
use the mneumonic STO. This is a mid-way stage. Each high-level
language statement is converted into assembly language instructions,
which are then converted into machine code.

CIE IGCSE LEVEL: COMPUTER SCIENCE /0478/


CH04 – SOFTWARE

• Examples of assembly language are:


LDD count
ADD 1
STO count

• In assembly language, the program has to state which memory locations


are being used. In the previous example, LDD count, the count is the
memory location.

CIE IGCSE LEVEL: COMPUTER SCIENCE /0478/


CH04 – SOFTWARE

• One high-level language statement may need several assembly language


instructions. The previous three assembly language instructions are the
same as the single high-level language count = count + 1.

CIE IGCSE LEVEL: COMPUTER SCIENCE /0478/


CH04 – SOFTWARE

Choosing a language

debug - identify and remove errors from (computer hardware or software).

CIE IGCSE LEVEL: COMPUTER SCIENCE /0478/


CH04 – SOFTWARE

Translators
• High-level language programs, and assembly language programs, need to
be converted to machine code to be executed. This is done using a
translator.

CIE IGCSE LEVEL: COMPUTER SCIENCE /0478/


CH04 – SOFTWARE

Assembler
• If you have a program written in assembly language, then an assembler is
used to convert the instructions into machine code for the processor the
code is being run on.

CIE IGCSE LEVEL: COMPUTER SCIENCE /0478/


CH04 – SOFTWARE

Interpreters and compilers


• If you have written a program in a high-level language then you can use
an interpreter or a compiler to translate the instructions.

CIE IGCSE LEVEL: COMPUTER SCIENCE /0478/


CH04 – SOFTWARE

An interpreter:
• reads one line of the high-level language code
• checks that it is syntactically correct:
• if it is not, it stops and reports an error to the user
• If it is, it executes the statement and moves to the next.

• Interpreters are most useful when writing the program, because it will stop at
an error, allow you to correct it, and then continue executing from the same
position. Interpreters are not as useful for whole-system testing, or when the
program is complete. This is because all of the code needs to be interpreted
every time the program is run, even if there are no errors.

CIE IGCSE LEVEL: COMPUTER SCIENCE /0478/


CH04 – SOFTWARE

A compiler
• checks all the code, by going through one-line after the other. If there are any syntax
errors, they are all reported to the user and the program is not executed. If there are no
errors, then an executable file is created. An executable file uses intermediate or object
code derived from the high-level language code. The actual program code is not included
so if someone has the executable file, they cannot view or amend the original code. The
executable file can be run without having to re-translate the code.
• Compilers are useful when you have finished the program or need to test a working
element repeatedly. This is because the code does not need to be translated each time,
the executable file is run repeatedly.

CIE IGCSE LEVEL: COMPUTER SCIENCE /0478/


CH04 – SOFTWARE

CIE IGCSE LEVEL: COMPUTER SCIENCE /0478/


CH04 – SOFTWARE

CIE IGCSE LEVEL: COMPUTER SCIENCE /0478/


CH04 – SOFTWARE

CIE IGCSE LEVEL: COMPUTER SCIENCE /0478/

You might also like