Translators and facilities of language Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

How does an idea get from our brain to the CPU

A

Idea
Algorithm
Program language
Assembly language
Machine language
CPU

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Machine code (Very Low Level Language)

A

. The CPU can only understand one type of code: Machine Code​

. Made up of Coded Instructions and Data​

. Each piece of machine code is stored as a binary number and then decoded and executed by the CPU’s logic circuits.​

. This means that writing programs in ‘Machine Code’ is difficult for a human to do.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Assembly Language (Low Level Language)

A

This language has a small set of commands which represent certain pieces of machine code​

​This helped programmers as they didn’t have to remember sets of binary code, instead they learnt commands.​

EG: Instead of memorizing what 1011 or 1001 meant, they just had to remember commands like ADD and SUB​

These commands are known as Mnemonics (simple memory aids).​

​Assembly language is still quite difficult to learn and use and this is why High Level Languages were produced.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

High Level Languages (Python, Java, C++)

A

High level code (aka ‘source code’) is far more easy to write and therefore for humans to understand.​

Its purpose is to be easier to write AND STILL be easily translated into machine code so that it can be processed by the CPU.​

To help it be translated, it makes use of:​
KEY WORDS​​ and SYNTAX​

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Translators

A

Translators are programs that convert high level language commands
into a set of machine code commands
so that the CPU can process the data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do translators work

A

Take the whole code and convert it into machine code before running it (known as compiling).​

​Take the code one instruction at a time, translate and run the instruction, before translating the next instruction (known as interpreting).​

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the three types of translator

A

Complier
Interpreter
Assembler

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Complier

A

Converts the whole code into one file (often a .exe file).​

​The file can then be run on any computer without the translator needing to be present.

Can take a long time to compile source code as the translator will often have to convert the instructions into various sets of machine code as different CPUs will understand instructions​

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Interpreter

A

Converts the source code into machine code 1 line at a time. ​
Program therefore runs very slowly.​

​Main reason why an interpreter is used is at the testing / development stage.​

Programmers can quickly identify errors and fix them.​

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Assembler

A

This type of translator is used for Assembly Language (not High Level Languages).​

It converts mnemonic assembly language instructions into machine code.​

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Integrated Development Environment (IDE)​

A

An Integrated Development Environment (IDE) is a software package.​

It provides the tools for a computer programmer to develop a software.​

It allows programmers to write their high level code, test it and translate it.​

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What do IDE’s consist of

A

Source Code Editor – allowing the writing and editing of code​

Interpreter – allows source code to be translated into machine code one line at a time for testing​

Automation Tools – automate tasks such as finishing off key words and indenting on your behalf​

Debugger – identifies logic and syntax errors and shows where they are.​

Compiler – converts entire source code into machine code so it can be run as its own individual program file.​

Auto-Documentation – stores lists of variables, modules, functions calls etc which are documented for other programmers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly