03 Programming Foundations - Binary System
03 Programming Foundations - Binary System
How to represent
data in computer?
Binary System
9 8 7 6 5 4 3 2 1 0
Decimal System
1 0
Binary System
What is Bit?
What is Byte?
MSB
65 Bit
LSB
0 1 0 0 0 0 0 1
27 26 25 24 23 22 21 20 Base 2
128 64 32 16 8 4 2 1 Doubling
8 Bits = 1 Byte
Decimal to Binary.
0 0 0 0 0 0 1 1
27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
00000011
ProgrammingAdvices.com Mohammed Abu-Hadhoud
Copyright© 2022 MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
Represent this in binary…
0 0 0 0 1 0 0 0
27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
00001000
ProgrammingAdvices.com Mohammed Abu-Hadhoud
Copyright© 2022 MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
Represent this in binary…
0 0 0 0 0 1 0 1
27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
00000101
ProgrammingAdvices.com Mohammed Abu-Hadhoud
Copyright© 2022 MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
Represent this in binary…
0 0 0 1 0 1 0 0
27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
00010100
ProgrammingAdvices.com Mohammed Abu-Hadhoud
Copyright© 2022 MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
Represent this in binary…
Only one way
to represent Data
0 0 0 1 0 1 0 1
27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
00010101
ProgrammingAdvices.com Mohammed Abu-Hadhoud
Copyright© 2022 MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
Computer Foundations
Binary to Decimal.
0 0 0 0 0 0 1 1
27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
00000011
ProgrammingAdvices.com Mohammed Abu-Hadhoud
Copyright© 2022 MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
Represent this in decimal…
0 0 0 0 1 0 0 0
27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
00001000
ProgrammingAdvices.com Mohammed Abu-Hadhoud
Copyright© 2022 MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
Represent this in decimal…
0 0 0 0 0 1 0 1
27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
00000101
ProgrammingAdvices.com Mohammed Abu-Hadhoud
Copyright© 2022 MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
Represent this in decimal…
0 0 0 1 0 1 0 0
27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
00010100
ProgrammingAdvices.com Mohammed Abu-Hadhoud
Copyright© 2022 MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
Represent this in binary…
0 0 0 1 0 1 0 1
27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
00010101
ProgrammingAdvices.com Mohammed Abu-Hadhoud
Copyright© 2022 MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
Computer Foundations
Largest number in
a byte?
1 1 1 1 1 1 1 1
27 26 25 24 23 22 21 20
128 + + + + + + +
64 32 16 8 4 2 1
=
11111111
ProgrammingAdvices.com Mohammed Abu-Hadhoud
Copyright© 2022 MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
What if I have larger number such as 257?!!
1 1 1 1 1 1 1 1
27 26 25 24 23 22 21 20
128 + + + + + + +
64 32 16 8 4 2 1
=
8 Bits = 1 Byte
0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Second Byte
11111111 11111111 First Byte
www.ProgrammingAdvices.com
ProgrammingAdvices.com
Copyright© 2022
Mohammed Abu-Hadhoud
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
Computer Foundations
www.ProgrammingAdvices.com
ProgrammingAdvices.com
Copyright© 2022
Mohammed Abu-Hadhoud
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
How to represent letters?
65 Or A??
0 1 0 0 0 0 0 1
27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
8 Bits = 1 Byte
Mohammed Abu-Hadhoud
01001101 01101111 01101000 01100001 01101101 01101101
01100101 01100100 00100000 01000001 01100010 01110101
00101101 01001000 01100001 01100100 01101000 01101111
01110101 01100100
Machine Language
Mohammed Abu-Hadhoud
www.ProgrammingAdvices.com
ProgrammingAdvices.com
Copyright© 2022 MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
What does this mean?
01001001 00100000 01001100 01101111 01110110 01100101
00100000 01011001 01101111 01110101 00100001
I Love You!
Mohammed Abu-Hadhoud
www.ProgrammingAdvices.com
ProgrammingAdvices.com
Copyright© 2022 MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
But!
www.ProgrammingAdvices.com
ProgrammingAdvices.com
Copyright© 2022
Mohammed Abu-Hadhoud
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
Computer Foundations
Unicode
www.ProgrammingAdvices.com
ProgrammingAdvices.com
Copyright© 2022
Mohammed Abu-Hadhoud
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
Problem:
محمد
□□□□ ؟؟؟؟
www.ProgrammingAdvices.com
ProgrammingAdvices.com
Copyright© 2022
Mohammed Abu-Hadhoud
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
UNICODE
Unicode is an International
character encoding standard
www.ProgrammingAdvices.com
ProgrammingAdvices.com
Copyright© 2022
Mohammed Abu-Hadhoud
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
ASCII UNICODE
VS
Supports specific characters (less space) Large number of characters (large space)
It has 3 standards:
Has 2 standards: Diffrences UTF 8 – 256 characters
7-bit ASCII – 128 characters
UTF 16 – 65,536 characters
8-bit ASCII – 256 characters
UTF 32 – 4,294,967,296 characters
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
64 Bits = 8 Bytes 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
??
Mohammed Abu-Hadhoud
www.ProgrammingAdvices.com
ProgrammingAdvices.com
Copyright© 2022 MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
9,223,372,036,854,780,000
www.ProgrammingAdvices.com
ProgrammingAdvices.com
Copyright© 2022
Mohammed Abu-Hadhoud
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
128 64 32 16 8 4 2 1
??
Mohammed Abu-Hadhoud
www.ProgrammingAdvices.com
ProgrammingAdvices.com
Copyright© 2022 MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
18,446,744,073,709,600,000
www.ProgrammingAdvices.com
ProgrammingAdvices.com
Copyright© 2022
Mohammed Abu-Hadhoud
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
www.ProgrammingAdvices.com
ProgrammingAdvices.com
Copyright© 2022
Mohammed Abu-Hadhoud
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
1- Represent those numbers in binary…
• 512
• 44
• 129
• 717
• 999
Mohammed Abu-Hadhoud
www.ProgrammingAdvices.com
ProgrammingAdvices.com
Copyright© 2022 MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
2- Write your name in binary and put it
in the comments.
Thank you
01010100 01101000 01100001 01101110 01101011 00100000
01111001 01101111 01110101 00100000 00111010 00101001
00001010
Mohammed Abu-Hadhoud
www.ProgrammingAdvices.com
ProgrammingAdvices.com
Copyright© 2022 MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience