Chapter1 Introduction
Chapter1 Introduction
Chapter1 Introduction
Embedded Programmings
Lecture 1: Introduction
Lecturer: Dr. Nguyen Tri Cuong (Nguyễn Trí Cường)
Department of Industrial Automation
School of Electrical Engineering
Email: cuong.nguyentri@hust.edu.vn
© DIA 2020.1
Content
1.1. Course Description
1.2. Introduction of programming technique
1.3. Methodologies
1.4. Software development process
1.5. Fundamentals of C/C++ languages
1.6. Getting started
▪ Iterative method
int kq = 1;
while (N > 1)
kq *= N--;
return kq;
Lecture 1: Introduction © DIA 2020.1 20
How to program well?
❑ Learn the way of thinking and programming methodologies
▪ Mathematical thinking, logical thinking, structure thinking, OOP
thinking and generic thinking
▪ Exploring data structures and algorithms
❑ Understand the computer
▪ Interaction amongst CPU, Programs and Memory
▪ Memory management
❑ Mastering the programming language
▪ Understand the strengths and limits of the language
▪ Programming skill
❑ Self-practicing
▪ Understand the above aspects
▪ Keep practicing
▪ Creativity
Lecture 1: Introduction © DIA 2020.1 21
Basic principles
❑ Abstraction
❑ Encapsulation
❑ Modularization
❑ Decentralization
Keep it simple :
as simple as possible,
but no simpler
(Alber Einstein)
// return output y
Analysis Coding
Testing
Object-oriented
design
Two approaches
Structure design, or
top-down design
Break the
system into
procedures
to solve Starting with
problems general then
detailed design
Logic error
would cause unexpected
Desk check
Developer uses testing data results
to verify the program
Structured walkthrough
Test data Developer describes algorithm
is similar to actual data while the programming team
which should be validate program logic
processed by the program
Compiler
Compiled
code
Linker Library
Executable
program
Deploy &
Execute
Lecture 1: Introduction © DIA 2020.1 58
Developing tools / environment
❑ IDE (Integrated Development Environment)
▪ Support the whole process of programming
▪ E.g.: MS Visual Studio, Borland C++ (Builder), Keil-C
❑ Tools
▪ Editor
▪ Compiler
▪ Linker
▪ Loader
▪ Debugger
▪ Project manager
https://spectrum.ieee.org/computing/software/the-top-programming-languages-2019
Lecture 1: Introduction © DIA 2020.1 65
Getting started
❑ Windows:
▪ Install Visual Studio Code (VS Code)
▪ Install C++ extension for VS Code
▪ Install Mingw-w64 in a folder with
simple path, i.e.: C\Mingw64
▪ Set Mingw64\bin in Windows
Environment Variables