1 Introduction Flashcards

1
Q

Advantages of Assembly?

A
  • Translated by an assembler directly in processor op-codes
  • Incredibly powerful, it does exactly what we tell it to
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Disadvantages of Assembley?

A
  • It can be very hard for a human to read
  • This can make it very hard to debug and fix
  • It is processor specific, you have to rewrite it for another PIC
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Why and How do we need high level programming languages?

A
  • Humans describe ideas using abstract high level concepts (i.e solve this function)
  • Computers don’t understand these concepts, so we need to have some form of intermediary
  • This problem was solved by creating new languages
  • These languages are understandable to humans but can still be translated into op-codes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How is MATLAB run on a computer?

A
  • In order to generate op-codes from MATLAB we need a translator
  • The translator takes our high level code and translates it into specific op-codes
  • There is a one-to-many mapping, typically each line of MATLAB will require more than one op-code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why and how do we need a compiler?

A
  • Sooner or later this process gets very complicated, and there may often be more than one “answer” to the translation
  • The translation of large programs is performed using a tool called a compiler
  • Compilers are tools that perform translation, optimisation, syntax translation and semantic analysis
  • Compilers can be notoriously complicated but they all perform the same job – translating our code into op-codes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Levels of programming?

A

Levels of programming?

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

C origins?

A
  • General purpose computer programming language
  • Invented in 1972 at Bell labs USA
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Advantages of C?

A
  • C is fast, flexible and provides good access to hardware, it works well on microprocessors
  • C programs are easily portable between different microprocessors
  • Linux, Windows and Mac OS – These are all coded in C
  • Lots of support both online and in books
  • Lots of code examples and libraries
  • Considered to be the gold standard
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Disadvantages of C?

A

Not necessarily the most compact representation

There are almost no sanity checks, it will let you do silly things

It is possible to write some very cryptic code in C

Not everything is portable, for example porting some interfacing code from a PIC to an Arduino would require some changes

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