Chapter1 Introduction v20242 Rev1
Chapter1 Introduction v20242 Rev1
© HĐC 2024.1
Content
Communication
Indutrial Communication
Systems
Logic Control and PLC
Computer Integrated
Manufacturing Systems
Programming Techniques
Programming Languages
Microcontroller
Drivers
Sensors
Communication
Programming Techniques
Programming Languages
English:
[1] Brian Kernighan B.W., Ritchie D.M., The
C Programming Language, 2nd edition,
Prentice Hall, 1998
[2] Bjarne Stroustrup, The C++
Programming Language, 4th Edition
[3] Stanley B. Lippman et. al, C++ Primer,
5th Edition
[4] Scott Meyers, Effective C++, 3rd Edition
[*] Many other books and resources
Tiếng Việt:
[5] Phạm Văn Ất et. al., Giáo Trình Kỹ Thuật
Lập Trình C Căn Bản và Nâng Cao
[6] Phạm Văn Ất et. al., Giáo Trình C++ Và
Lập Trình Hướng Đối Tượng
Our team:
Assoc. Prof. Nguyễn Hồng Quang
Dr. Hoàng Đức Chính
Dr. Nguyễn Trí Cường
Dr. Võ Duy Thành
Department of Automation Engineering,
School of Electrical and Electronics Engineering
Lecture notes (Slides bài giảng), assignments &
discussion: Microsoft Teams (Team code: xem QLĐT)
It is highly recommended to discuss about the course in
the offline class and the class’s Teams
Windows:
Install Visual Studio Code (VS Code)
https://code.visualstudio.com/download
Install C++ extension for VS Code
Download MinGW-w64 here: https://github.com/niXman/mingw-
builds-binaries/releases/download/14.2.0-rt_v12-rev1/x86_64-14.2.0-
release-posix-seh-ucrt-rt_v12-rev1.7z
Install MinGW-w64 by extracting the above file in a folder with
simple path, e.g: C\Mingw64
Set Mingw64\bin in Windows Environment Variables
Linux:
gcc or g++ may be installed by default, otherwise install it:
sudo apt-get update
sudo apt-get install build-essential gdb
MacOS: Use Clang for compiling
Check if Clang is install: clang --version
Install it: xcode-select --install
Install MinGW-w64
Version: (choose the highest)
Architecture: x86_64
Threads: win32 or posix
Exceptions: seh
Build revision: 0
Add the path to your Mingw-w64 bin folder to the
Windows PATH environment variable
Otherwise, the
code cannot be
compiled, and
you have to
reinstall/reconfig
Devices 0x634200
0x634204
.
.
Secondary Storage .
Memory Unit
ALU
Instruction Data
Control Unit
Memory Memory
I/O
Harvard Architecture
Blooming era of
Stronger Internet
Computational Languages facilitate
Languages Internet applications
Cobol, Lisp, Basic including Web, IoT, Big
Data, etc.
Iterative method
int kq = 1;
while (N > 1)
kq *= N--;
return kq;
“Keep it simple :
as simple as possible,
but no simpler”
- Albert Einstein
Sequential programming
Structured programming
Modular programming
Object-oriented programming
Generic programming
Component-based programming
Real-time programming
Strengths:
Simple thinking
Low-level abstraction, easy to manage resources
May be high efficient
Appropriate to small problems or in embedded system
Weakness:
Difficult to read, thus easy to make mistakes
Difficult to reuse
Low effectiveness
Not suitable to large-scale applications
// return output y
Analysis Coding
Testing
Coordination is not needed as one team starts the work Coordination among project teams is required to
after the finish of another team. ensure correctness.
It is mainly used for small project development. It is really useful in large and complex projects.
Testing can only be performed when the complete The testing part can be started before the development
product is ready. of the entire product.
It takes more time compared to Agile. It completes the project in comparatively less time.
Hardly any test plan is discussed during a cycle. After each sprint/cycle test plan is discussed.
A compiler is a computer
program that translates
computer code written in one
programming language (the
source language) into another
language (the target language).
The name "compiler" is
primarily used for programs
that translate source code from
a high-level programming
language to a lower level
language (e.g., assembly
language, object code, or
machine code) to create an
executable program
Example: C, C++, C#, Java,
COBOL, Go
Flow Chart
Flow Charts used shapes to present a
program/algorithm
o Start/End
o Process
o Decision
o Data…
Disadvantages
o Used only for small applications
o Modification and drawing are time-consuming
o Unstructured code is difficult to maintain
Flowline (Arrowhead)
Terminal
Decision
Input/Output
Predefined Process
Annotation (Comment)
On-page Connector
Off-page Connector
Class Diagram
Sequence Diagram
Example:
2021 2022
https://spectrum.ieee.org/top-programming-languages-2021 https://spectrum.ieee.org/top-programming-languages-2022
https://spectrum.ieee.org/the-top-programming-languages-2023
https://spectrum.ieee.org/the-top-programming-languages-2023
https://spectrum.ieee.org/the-top-programming-languages-2023
C:
At Bell Labs by Dennis Ritchie between 1972 and 1973 for
Unix.
K&R C (Brian Kernighan and Dennis Ritchie) in 1978
During the 1980s, C gradually gained popularity, many C
compilers
Standardized by the ANSI since 1989 (ANSI C - American
National Standards Institute) and by the International
Organization for Standardization.
Newest release C18 (ISO/IEC 9899:2018)
Next version C2x
Embedded C Thomson,
Ritchie,
& Kernighan
C++:
Bjarne Stroustrup’s “C with Classes” at
Bell Labs in 1979
C++ in 1982
https://www.stroustrup.com/
First commercial implementation in 1985
In 1998, C++ started to be standardized as C++98 (ISO/IEC
14882:1998)
Features:
Close to hardware
High efficiency
Relatively user-friendly to developers
Interchangeable
International Standardization
Strength of ANSI-C
Popular in most of microprocessor, microcontroller, DSP
Popular to world-wide developers
Strength of ANSI/ISO C++:
Object-oriented programming
Generic programming (template)
Mathematical programming (Data Abstraction and Operator
Overloading)