G1
G1
យូ វណ្ណ ឌី
YOU Vanndy
Presh Sisowat high school 2008
2008 => 2012 = Bachelor of Education in English
2008 => 2013 = Engineering’s Degree in GIC
2014 = EDC
2014 => M.Ed. in Europe X
2014 => 2016 Scholarship to India = Master of IT (Mahatma Gandhi University) ICCR
Indian Government scholarship
2016 => present = ITC
GIC = Vice-Head of Department
1000
Team os
CMOS / BIOS
HDD / SSD
Computer <= Compute <= Calculator
Transistor open/close current
Computer:
• Hardware: ផ្នែករឹង, EX: RAM, CPU/Chip, GPU/VGA, Motherboard, Keyboard, Mouse,
Screen, HDD, Battery/Power Supply, Fan, Adaptor, Webcam,
• Software: ផ្នែកទន់:
Operating System ប្រព័ន្ធប្រតិបត្តិការ, EX: Windows 7, 8, 10, MacOS, Linux
Application កម្មវិធី, EX: MS Office, PhotoShop, game, VLC, Chrome, MS Teams
Hardware
Input I/O Processing Output
Keyboard Flash USB CPU Headset
Mouse HDD / SSD VGA/GPU Printer
Mic RAM Screen/Monitor
Webcam Speaker
Adaptor Projector
Battery/Power CD Writer
Supply
Scanner
Joystick/Controller
CD ROM
Laser Pen
Trackpad
Motherboard
Memory អង្គចង់ចាំ
Main Memory or Primary memory: RAM, EX: 6GB. Temporary, small, fast (electricity)
Secondary Memory: storage (HDD, SSD, M2, PCIe), EX: 128GB. Permeant, big, slow (IC
memory)
RAM = Random Access Memory
GPU
When to use CPU when to use GPU? Which one consume more power?
GPU = Graphic Processing Unit: array calculation ផ្ទា ំង
CPU = Central Processing Unit: general calculation, EX: math
Pixel
Resolution: 1080 pixel
SD
HD = 1280 * 720
Full HD = 1920 * 1080
2K = 2040 *1152
4K = ultra HD = 3840 * 2160
8k
GPU has speed GHz, RAM
OS
1 pixel = 3 Diode (RGB Red Green Blue)
GPU: Graphic Processing Unit ដាច់ nVidia … ឬ ជាប់ on-board VGA
RAM
RAM for run application
When RAM is full, what will we do?
Virtual Memory = borrow space Secondary memory => Virtual Memory <=> RAM
MacOS, iPhone and iPad: Memory Compress
Execution Process
Game => OS copy Game
Secondary memory => RAM => CPU => VGA => Screen
VGA: display on screen
CPU slow to calculate
VGA => GPU
Operating System (OS)
OS control Hardware
The core of OS = Kernel control hardware
Kernel translate from high-level language to low-level language => binary language (0, 1)
=> hardware
class InchToMeterTable {
public static void main(String args[]) {
double inches, meters;
int counter;
counter = 0;
for(inches = 1; inches <= 144; inches++) {
meters = inches / 39.37; // convert to meters
System.out.println(inches + " inches is " +
meters + " meters.");
counter++;
// every 12th line, print a blank line
if(counter == 12) {
System.out.println();
counter = 0; // reset the line counter
}
}
}
}
High-level language => Java interpreter => low-level language => Kernel => binary
language
Internet
Internet = International Network
Applications of the Internet
WWW = World-Wide Web: website, game, banking, map, book, buy, sell
Email: send and receive e mail: EX: gmail, yahoo mail, itc email
File Transfer Protocol (FTP): download files, game, video
Secure Shell: SSH Protocol: remote or hack
My PC => Team Viewer server => your PC
Internet Protocol (IP Address)
7 OSI Layers
LAN or WAN
Local Area Network
Wide Area Network
Method of Transmission
TCP: Transmission Control Protocol: 100% no error, slow, use for transfer file and open
website
UDP: User Datagram Protocol: error, fast, use for streaming game, video, sound
Port Number
IP Address: 192.168.100.50:80 :433 :90 :8000
Range 0 => 65 353
NetCut
Base គោល
Base 2 Binary: 0, 1
Base 8 Octal: 0, 1, 2, 3, 4, 5, 6, 7
Base 10 Decimal: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Base 16 Hexadecimal: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
010,101,010,101,111,001 = 252571
(1010101101100110101010111000)2 = (???)8
001,010,101,101,100,110,101,010,111,000 = 1255465270
(54362)8 = (???)2
54362 = 101 100 011 110 010
0000 = 0 1000 = 8
0001 = 1 1001 = 9
0010 = 2 1010 = A
0011 = 3 1011 = B
0100 = 4 1100 = C
0101 = 5 1101 = D
0110 = 6 1110 = E
0111 = 7 1111 = F
(10101010101010101111000101101100)2 = (?)16
1010,1010,1010,1010,1111,0001,0110,1100 = AAAAF16C
(874FD34B)16 = (???)2
874FD34B = 1000 0111 0100 1111 1101 0011 0100 1011
(1010101)2 = (???)10
តំររៀបលេខពីស្ដា ំមកឆ្វេងចាប់ពីសូន្យ
២ ស្វ័យគុណនឹងលេខដែលបានរៀប
បើលេខនោះនៅលើលេខសូន្យ x ចោល
បូកចម្លើយចូលគ្នា
6 5 4 3 2 1 0
1 0 1 0 1 0 1
20 + 22 + 24 + 26 = 1 + 4 + 16 + 64 = 85
(1101011010101)2 = (?)10
12 11 10 9 8 7 6 5 4 3 2 1 0
1 1 0 1 0 1 1 0 1 0 1 0 1
(152)10 = (??)2
152 0
76 0
38 0
19 1
9 1
4 0
2 0
1
ក្រោមឡើងលើ សរសេរពីឆ្វេងទៅស្ដា ំ
10011000
212 0
106 0
53 1
26 0
13 1
6 0
3 1
1
11010100
22 0
11 1
5 1
2 0
1
10110
Logics
NOT = ផ្ទុយ មិន
OR = ឬ ឲ្យតែមាន True យ៉ា ងតិចមួយ => True
AND = និង ឲ្យតែមាន False យ៉ា ងតិចមួយ => False
XOR = eXclusive OR មាន T ជាចំនួនសេស
NOT
A NOT A
T F
F T
OR
A B A OR B
T T T
T F T
F T T
F F F
AND
A B A AND B
T T T
T F F
F T F
F F F
XOR
A B C D XOR
T T F T T
T F F T F
F T T T T
F F T T F
1=T
0=F
10101 A
01011 B AND
------------
00001
Python Programming
print( )
គឺជា command មួយសម្រាប់បង្ហា ញ់អ្វីៗដែលមានក្នុង ()
បើក្នុង ( ) មានអ្វីក្នុង " " វានឹងបង្ហា ញអ្វីទាំងអស់នោះក្នុង " "
បើក្នុង ( ) មានអញ្ញា ត្តិ វានឹងបង្ហា ញតម្លៃរបស់អញ្ញា ត្តិនោះ
ការកំណត់តម្លៃរបស់អញ្ញា ត្តិ
ឈ្មោ ះអញ្ញា ត្តិ = តម្លៃរបស់អញ្ញា ត្តិ
EX: x = 10
Integer ចំនួនគត់
EX: a = 20 b = 45 c = 9864 d = -234
Integer + - * / Integer
Float + - * / Float
String + = តំរៀបបន្តគ្នា
String * = សរសេរដដែលៗចំនួន n ដង
type( )
គឺជា command សម្រាប់បង្ហា ញប្រភេទនៃអញ្ញា ត្តិ
EX: a = 10
print(type(a))
=> <class 'int'>
សញ្ញា # ក្នុង Python គឺតំណាងឲ្យ comment គឺជាការឲ្យមតិ ឬការកំណត់ចំណាំ
សរសេរអ្វីក៏បានដែរ សរសេរភាសាអ្វីក៏បាន ។ Python មិន run comment ទេ ។
input( )
គឺជា command មួយសម្រាប់ទទួលយកការបញ្ចូលតាមរយៈ keyboard
រាល់ពេលដែល input ទទួលបានពី keyboard មកភ្លា ម វាជាប្រភេទ string ទាំងអស់
int( )
គឺជា command មួយសម្រាប់ convert ពី string ឬ float ទៅជា integer
float( )
គឺជា command មួយសម្រាប់ convert ពី string ឬ integer ទៅជា float
str( )
គឺជា command មួយសម្រាប់ convert ពី float ឬ integer ទៅជា string
Condition
if condition: បើ
do work1 ចូលដើមបន្ទា ត់ចុច space ៤ ដង
do work2
else: បើមិនដូច្នោ ះទេ
do work3
if condition1:
do work1
do work2
elif condition2:
do work3
do work4
elif condition3:
do work5
do work6
elif condition4:
do work7
do work8
elif conditionX:
do workX
do workY
else:
do workABC
do workDEF
== មានន័យថាប្រៀបធៀប ឬចង់ដឹងថាស្មើរមែនអត់ ?
Floor Division មានន័យថាចែកយកតែលេខគត់ ក្រោយក្បៀសមិនយកទេ តាងដោយសញ្ញា //
ដោះស្រាយសមីការដឺក្រេទី ២ ៖
១. តាងសមីការ ax2 + bx + c = 0
២. បញ្ចលូ តម្លៃ a
៣. បញ្ចលូ តម្លៃ b
៤. បញ្ចូលតម្លៃ c
៥. គណនា ដែលតា d = b*b - 4ac
៦. បើ ដែលតា < 0
សមីការគ្មា នឬស
៧. បើ ដែលតា == 0
សមីការមានឬសដូចគ្នា x1 = x2 = -b / 2a
៨. បើ ដែលតា > 0
x1 = ….
X2 = ….
a = 2020
a = a+1 a+=1 shorthand operation can be with + - * /
a ថ្មី = a ចាស់ +1