2.5.1 Flashcards

1
Q

what are the types of languages?

A

-machine code
-low level language (assembly code)
-high level language (source code)

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

describe machine code

A

-consists of strings of 1s and 0s
-instruction run inside the CPU for a particular processor that will understand and be able to process

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

describe low level language (assembly code)

A

-made up of a predetermined set of commands that can be read by a person (ADD), each commands translates directly to a machine code number
-these commands are mnemonics used by people to easily understand computer instructions

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

mnemonics

A

english words to represent binary oppcodes

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

what are the pros of low level language?

A

-executes faster
-occupies less memory

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

what are the cons of low level language?

A

-programmer needs to know a lot about hardware details inside CPU

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

what are the two parts of the instructions for a microprocessor?

A

-oppcode: specifies the operation that has to be performed
-opperand: the data that has to be used or memory location

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

describe high level language (source code)

A

-developed to make programming easier for people
-two main features: syntax and keywords

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

what are the pros of high level language?

A

-faster program development
-machine independent (can be run on different computers)

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

what are the cons of high level language?

A

-source code needs to be converted into machine code to be run in the CPU

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

what does a translator do?

A

translates high level languages into machine code

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

what are the types of translators?

A

-assembler
-compiler
-interpreter

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

assembler

A

converts assembly language into machine code

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

interpreter

A

doesn’t translate entire source code in one go (line by line translation)

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

pros of interpreter

A

-errors show immediately
-takes up less memory

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

cons of interpreter

A

-slower compared to compiler
-interpreter must always be present

17
Q

compiler

A

reads all the source code in one go into the form of an executable file

18
Q

pros of compiler

A

-more portable
-translates only once

19
Q

cons of compiler

A

-cannot change the program
-if there’s an error t carries on trying to compile the program