4.6 Computer Systems Flashcards

1
Q

What are low level languages?

A

They are specific to the type of processor they are written for and directly affect the computers processor - very similar to the instruction set of the computer

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

What is machine code?

A

Machine code uses the binary digits 1 and 0 to represent instructions so they directly manipulate the processor

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

What are the advantages of using machine code?

A

Programmers are not constrained when using machine code and there is no need to translate it before executing it so its useful for embedded systems and real time applications

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

What are the disadvantages of using machine code

A

Very long and extremely difficult for humans to understand so its prone to errors and difficult to debug - also not portably as it is processor specific

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

What is assembly language

A

Simplifies machine code by using mnemonics instead of binary instructions so it has a 1-1 correlation to machine code instructions

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

what are the advantages of assembly language over using machine code

A

More compact and less prone to errors than machine code as mnemonics help make the code easier for humans to understand so debugging is easier and translation to machine code is quick

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

What are the disadvantages of assembly language

A

Not portable as the program is processor specific - the debugging is more difficult then high-level languages and an assembler still has to be used to translate the program

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

What is a situation when you would use low-level languages

A

When coding for execution speed and when coding for a specific processor

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

What are high level languages

A

They are non-platform specific languages that use English instructions and mathematical symbols

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

What are advantages of using high-level language

A

Code is easier to understand,mantain and debug - faster development time - programs are more portable to other hardier platforms as they are not processor specific

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

What are disadvantages of high-level languages compared to low level languages

A

Low level languages may execute code quicker - may use more memory them low level languages - low level languages have more direct access to computer hardware

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

State four reasons that high level language programs are easier to understand

A

Use of indentation to separate statement blocks, use of comments to annotate the program, use of procedures/functions, use of constants

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

Explain the term imperative in context to high-level languages

A

Instructions are executed in programmer defined order - imperative languages describe now to solve a problem in terms of sequences of actions to be taken

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

Why are there so many high level programming languages

A

Languages used for a specific problem type

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

What is a compiler

A

A compiler translates high level languages by translating the whole source code at once, it will not produce an executable file if an error is encountered, it produces object code, you do not need the compiler to execute a compiled program, compiled code can only be executed on a machine with the same processor type

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

What is an interpreter

A

An interpreter translates high-level languages by analysing source code line by line, it will debug and execute each line until the end or the first error, interpreter and source code must always be present

17
Q

What is an assembler

A

A translator that translates assembly language into machine code it is very quick and straightforward due to the 1-1 relationship - but they are platform specific

18
Q

What is the input and output for a translator called

A

Input is source code and output is object code

19
Q

How do compilers that use intermediate languages work

A

They translate the source code into an intermediate language (often bytecode) which allows for platform independence, it then uses a virtual machine to execute the bytecode on different processors - allows source code to only be translated once but translated code can be executed with a variety of different processors

20
Q

Why would interpreters be used instead of compilers

A

If you don’t know what type of processor will be in the user’s computer - a compiled program will only execute on a processor of a specific type

21
Q

Describe a half adder

A

It has two inputs and two outputs - sum and carry bit, used to add two Boolean values

22
Q

Describe a full adder circuit

A

It describes a full adder circuit has three inputs and two outputs - enables it to input two Boolean value and a carry bit from Describe a full adder circuit a previous operation - it outputs the sum and a carry bit

23
Q

Boolean identities common laws to simplify these
1) A+B.C
2) A.(A+B)

A

1) A+B.C = (A+B).(A+C)
2) A.(A+B) = A

24
Q

Describe de mogan’s law in words

A

Break the not and switch signs