08 Programming Foundations - Octal
08 Programming Foundations - Octal
08 Programming Foundations - Octal
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
Computer Foundations
What is
Octal System?
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
Counting Systems?
7 6 5 4 3 2 1 0
Each octal digit represents 3 bits, so a 6-bit byte is two octal digits
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
ASCII Table
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
Why Octal?
• Previously in old computers the byte was only 6 digits not 8 digits.
• In octal a binary number is divided up into groups of only 3 bits,
with each group or set of bits having a distinct value of between
000 and 111.
• The use of octal numbers has declined now, why?!
Because most modern computers (use Nibbles) no longer base their word length on
multiples of three bits, (they are based on multiples of four bits, so hexadecimal is
more widely used).
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
It’s hard for human to read binary!
What does this mean?
01001001 00100000 01001100 01101111 01110110 01100101
00100000 01011001 01101111 01110101 00100001
I Love You!
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
Both Hexadecimal and Octal Systems
Provides a human-friendly representation
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
Computer Foundations
Octal Prefix
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
Prefix:
Hexa Prefix:
Technology/Language Prefix Example
HTML & CSS #Code #FFFFFF
C,C++,Java..etc 0x Code 0x725
XML &#Code &#C2A4
Unicode U+Code U+C2A4
Octal Prefix:
0oCode 0o725
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
Computer Foundations
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
Remember that binary was base 2.
27 26 25 24 23 22 21 20 Base 2
128 64 32 16 8 4 2 1 Doubling
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
Hexadecimal is base 16.
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
Octal System is base 8.
84 83 82 81 80 Base 8
4k 512 64 8 1
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
Computer Foundations
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
conversion from decimal to octal and
binary to octal
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
Convert 469 to Octal
Number / 8 Result Integer Fraction Remainder Octal
7/8 = -- -- -- 7 7
469 10 725 8
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
Computer Foundations
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
Convert Octal 725 to Decimal
82 81 80
725
5 x 80 = 5 x 1 = 5+
2 x 81 = 2 x 8 = 16 +
7 x 82 = 7 x 64 = 448
469
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
Computer Foundations
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
Way 1:
That’s it.
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
Way 2:
Direct Conversion.
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
Direct Conversion:
7 2 5
Only 3 digits
not Nibble
111 010 101
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
Computer Foundations
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
Way 1:
That’s it.
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
Way 2:
Direct Conversion.
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
Convert 000111010101 to Octal
7 2 5
72 5
ProgrammingAdvices.com
Mohammed Abu-Hadhoud
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
1- Convert those Octal numbers to Decimal:
• 100
• 512
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
2- Convert those Decimal numbers to Octal:
• 64
• 330
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
2- Convert (direct) those Octal numbers to Binary :
• 100
• 512
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
3- Convert (direct) those Binary numbers to Octal :
• 0100 0000
• 0001 0100 1010
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
Solution
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
Solutions:
1:
• 100 64
• 512 330
2:
• 64 100
• 330 512
3:
• 100 0100 0000
• 512 0001 0100 1010
4:
• 0100 0000 100
• 0001 0100 1010 512
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience
Thank you
124 150 141 156 153 040 131 157 165 040 072 055 051 015 012
Mohammed Abu-Hadhoud
ProgrammingAdvices.com
MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
Copyright© 2022 26+ years of experience