Year 11 · Computer Science · Autumn 1

Software · Lesson 4 of 5

IDEs

Practical4.2 Types of programming language, translators and IDEs

Year 11 · Computer Science · Software · Lesson 4 of 5

You will learn to

  • Identify each IDE feature in the editor we use in class.
  • Describe the IDE features: code editor, run-time environment, translator, error diagnostics, auto-completion, auto-correction and prettyprint.
  • Explain how one IDE feature helps a programmer, in a past-paper answer.

Year 11 · Computer Science · Software · Lesson 4 of 5

Success criteria

You have got it when you can say:

  • I can point to each IDE feature on the screen and name it.
  • I can describe three IDE features using the syllabus words.
  • I can answer a past-paper IDE question and mark it with the scheme.

Year 11 · Computer Science · Software · Lesson 4 of 5

Retrieval starter

Questions from before. Write your answers, then show them.

  1. Last lesson

    Which of these is system software?

    A A gameB A word processorC The operating system

    C. The operating system

  2. Earlier this unit

    An IDE provides…

    A Only the keyboardB The operating systemC An editor, a run button and a debugger

    C. An editor, a run button and a debugger

  3. Last year

    Which of these is lossy?

    A ZIPB PNGC JPEG

    C. JPEG

Year 11 · Computer Science · Software · Lesson 4 of 5

Key words (1 of 4)

System software
Software that runs and manages the computer, such as the operating system and utilities.
Device driver
A small program that lets the OS communicate with one particular device.
High-level language
A programming language close to English, which works on many types of processor.
Low-level language
A language close to machine code, written for one type of processor.

Year 11 · Computer Science · Software · Lesson 4 of 5

Key words (2 of 4)

Machine code
Binary instructions that the processor can run directly.
Assembly language
A low-level language that uses mnemonics; each line matches one machine code instruction.
Mnemonic
A short, easy-to-remember code for a machine instruction, such as LDA or ADD.
Assembler
A translator that turns assembly language into machine code.

Year 11 · Computer Science · Software · Lesson 4 of 5

Key words (3 of 4)

Compiler
A translator that turns the whole high-level program into machine code at once and creates an executable file.
Interpreter
A translator that translates and runs a high-level program one line at a time.
Executable file
A file of machine code that can run on its own, without the source code or translator.

Year 11 · Computer Science · Software · Lesson 4 of 5

Key words (4 of 4)

IDE
Integrated development environment: one program with the tools to write, translate, run and debug code.

The explanation · step 1 of 7 · part 1 of 3

High-level and low-level languages

The processor only understands machine code: binary instructions such as `10110000 01100001`.

A low-level language is close to machine code. It is written for one type of processor. Machine code and assembly language are low-level.

A high-level language is close to English and maths. Python, Java and Visual Basic are high-level. One line of high-level code becomes many machine code instructions.

The explanation · step 1 of 7 · part 2 of 3

High-level and low-level languages (continued)

High-level languageLow-level language
Easy to read, write and debug?Yes: uses English-like wordsNo: hard to read and follow
Runs on different processors?Yes: portable (machine-independent)No: written for one processor (machine-dependent)
Control of hardwareLittle direct controlDirect control of memory and registers
Speed and memoryMay be slower and use more memoryCan be very fast and compact
Needs translating?Yes, by a compiler or interpreterAssembly needs an assembler; machine code needs nothing
Typical useMost apps, websites, gamesDevice drivers, embedded systems, very fast code

The explanation · step 1 of 7 · part 3 of 3

High-level and low-level languages (continued)

?Why?

High-level languages save programmers time and reduce mistakes. Low-level languages are used when every byte and every microsecond matters, for example in a washing machine's chip.

!Watch out

"Low-level" does not mean "worse". It means "close to the hardware".

The explanation · step 2 of 7 · part 1 of 3

Assembly language and mnemonics

Assembly language is a low-level language. Each instruction matches one machine code instruction.

Instead of binary, it uses short codes called mnemonics. A mnemonic is a few letters that are easy to remember, such as `LDA` for "load" or `ADD` for "add".

Assembly lets the programmer work directly with memory addresses and the accumulator (ACC) register.

The explanation · step 2 of 7 · part 2 of 3

Assembly language and mnemonics (continued)

LDA 20    // copy the number at memory address 20 into the ACC
ADD 21    // add the number at address 21 to the ACC
STO 22    // store the ACC into address 22
END       // stop

If address 20 holds 7 and address 21 holds 5:
after LDA 20  ACC = 7
after ADD 21  ACC = 12
after STO 22  address 22 holds 12
# The same job in one high-level line
c = a + b

The explanation · step 2 of 7 · part 3 of 3

Assembly language and mnemonics (continued)

?Why?

Assembly is easier for humans than binary but still gives full control of the processor. That is why it is used for device drivers and small embedded systems.

!Watch out

The exact mnemonics change between processor types. In the exam, you will not need to learn a set; you need to know what a mnemonic is.

The explanation · step 3 of 7 · part 1 of 2

The assembler

The processor cannot run assembly language directly. It must be translated into machine code first.

An assembler is the translator for assembly language. It turns each mnemonic into its matching binary instruction.

Because one assembly line equals one machine code instruction, assembling is a simple one-to-one translation.

The explanation · step 3 of 7 · part 2 of 2

The assembler (continued)

e.g.Example
LDA 20 → assembler → 0001 0100 (made-up example code) ADD 21 → assembler → 0011 0101 The binary values depend on the processor's instruction set.
?Why?

Each processor has its own instruction set, so each needs its own assembler.

The explanation · step 4 of 7 · part 1 of 3

Translators for high-level languages: the compiler

A translator turns source code (the code a person writes) into machine code. There are three types: assembler, compiler and interpreter.

A compiler translates the whole program in one go, before it runs.

If there are errors, it lists all of them at the end in an error report. The program will not run until every error is fixed.

The explanation · step 4 of 7 · part 2 of 3

Translators for high-level languages: the compiler (continued)

When there are no errors, it produces an executable file (for example a `.exe`). This file can run again and again without the compiler and without the source code.

e.g.Example
A games studio finishes a game. They compile it once into an executable. Players download and run the executable. Players never see the source code, and they do not need a compiler.

The explanation · step 4 of 7 · part 3 of 3

Translators for high-level languages: the compiler (continued)

?Why?

Translation happens once, so the finished program runs fast. Keeping the source code hidden also protects the company's work from being copied.

The explanation · 3 more steps

More on the lesson page

The lesson page has the rest of the explanation, step by step:

  • Translators for high-level languages: the interpreter
  • Compiler or interpreter? Compare them
  • The IDE: a programmer's toolbox

Open the lesson page

Year 11 · Computer Science · Software · Lesson 4 of 5

Quick quiz · 1 of 3

The bootloader…

  1. A Translates Python
  2. B Loads the operating system from storage into RAM at start-up
  3. C Prints documents

B. Loads the operating system from storage into RAM at start-up

It lives in ROM and runs first when the power comes on.

Year 11 · Computer Science · Software · Lesson 4 of 5

Quick quiz · 2 of 3

An interrupt is…

  1. A A loop that never ends
  2. B A type of virus
  3. C A signal that makes the CPU pause and deal with something

C. A signal that makes the CPU pause and deal with something

A key press or a printer out of paper. The CPU saves its place, handles it, carries on.

Year 11 · Computer Science · Software · Lesson 4 of 5

Quick quiz · 3 of 3

A compiler…

  1. A Translates one line at a time, every run
  2. B Only checks spelling
  3. C Translates the whole program once into machine code

C. Translates the whole program once into machine code

It produces an executable file. Errors are reported at the end.

Year 11 · Computer Science · Software · Lesson 4 of 5

Exit ticket

Answer on paper before you go. Then check.

  1. An interpreter stops…

    A Only after translating everythingB At the first error it meetsC Never

    B. At the first error it meets It translates and runs line by line, so it stops where the error is.

  2. Which is a low-level language?

    A Assembly languageB JavaC Python

    A. Assembly language Assembly is close to the chip. An assembler turns it into machine code.