1 How Computers Work- FINAL
1 How Computers Work- FINAL
systems:
●Decimal
●Binary
●Octal
●Hexadecimal
Objectives:
●Familiarize the computer number
systems
●Discuss the role of ASCII code in
computer systems and explain how
computer use it
How Computers Work
and Interpret Data?
• Human’s understand human language while computers
understand machine language.
16 digits or letters):
0,1,2,3,4,5,6,7,8,9,10=A, 11=B, 12=C, 13=D,
14=E, 15=F.
Equivalent Number Systems Values
How computers interpret data
1. From the keyboard, pressure pads are typically found
underneath each key. Upon typing a letter, the pressure pad
sends information to the CPU for processing.
The Binary, Octal, or Decimal value are the remainder written from the
bottom to the top.
Example: Convert 34810 to
348 ÷ 16 = 21.75 = 21 R
Hexadecimal
348 ÷ 8 = 43.5 =
Octal:
348 ÷ 2 = 174 = 174 R 0
Binary:
174 ÷ 2 = 87 = 87 R 043R 4 12
87 ÷ 2 = 43.5 = 43 R1
43 ÷ 8 = 5.375 = 5 21 ÷ 16 = 1.3125 = 1
43 ÷ 2 = 21.5 = 21 R1
R3 R5
21 ÷ 2 = 10.5 = 10 R1
10 ÷ 2 = 5 = 5 R 05 ÷ 8 = 0.625 = 0 1 ÷ 16 = 0.0625 = 0
5 ÷ 2 = 2.5 = 2 R1
R5 R1
2÷2=1=1 R0
1 ÷ 2 = 0.5 = 0 R ANS:
1 534
8
Note: 12 = C
ANS: 1 0 1 0 1 1 1 0 02
ANS: 15C16
YOUR TURN: Convert the following
decimal numbers to binary, octal,
and hexadecimal.
Decimal Binary Octal Hexadecimal
370
2880
10475
Binary to Decimal,
Octal and
Hexadecimal
2. Binary to Decimal
Answer:
=1x +1x +1x +1x
=8+4+2+1
=
Example: (1001) 2= ________ 10
Answer:
=1x +0x +0x +1x
=8+0+0+1
=
3. Binary to Octal
Answer:
= (11)(111)(111)
= (377)8
4. Binary to Hexadecimal
Answer:
= (11111111) 2
= (1111)(1111)
= (15)(15)
= (ff) 16
Your Turn: ½ crosswise
Binary Octal Decimal Hexadecimal
1. 111001
2. 10011010
3. 10111000101
4. 101010010001
5. 1110111100
Your Turn:
5. Octal to Decimal
Digits ←A B C D . E F G→
To Hexadecimal
• Do the steps for binary (above)
• Group the binary numbers into groups of 4 (start from the left)
• Write: 8 4 2 1 to each groups of 4
• Encircle the numbers in 8 4 2 1 that are under the binary digit 1.
• Add the encircled numbers and convert 10, 11, 12, 13, 14, 15 to its respective letters.
• Combine the numbers and letters
Examples: Convert the following octal
number to binary number
1.) 56 1.) 643
5 6 6 4 3
4 2 1 4 2 1 4 2 1 4 2 1 4 2 1
= 1 0 1 1 1 0 = 1 1 0 1 640 0 0 1 1
ANSWER:
101110 ANSWER:
110100011
Examples: Convert the following octal
number to hexadecimal number
2.) 357
1.) 213 1 5 7
2 1 3 4 2 1 4 2 1 4 2 1
4 2 1 4 2 1 4 2 1 = 0 0 1 1 0 1 1 1 1
= 0 1 0 0 0 1 0 1 1 Group of 4:
Group of 4: 0 1 1 0 641 1 1 1
1 0 0 0 1 0 1 1
8 4 2 1 8 4 2 1
8 4 2 1 8 4 2 1
=4+2 =8+4+2+1
=8 =8+2+1
=6 =15
=11
=F
=B
ANSWER: 6F
ANSWER: 8B
YOUR TURN: Convert the following
octal numbers to
binary/hexadecimal numbers
Octal Binary Hexadecimal
1657 1110101111 3AF
35 11101 1D
5. Hexadecimal to Binary / Octal
To Binary
• Separate each digit/letter and convert the letter to its corresponding numerical
value
• Write: 8 4 2 1 under each digit
• Encircle the numbers in 8 4 2 1 that adds up to the numbers above them
• Write 1 under each encircled number, and 0 otherwise.
To Octal
• Do the steps for binary (above)
• Group the binary numbers into groups of 3 (start from the left)
• Write: 4 2 1 to each groups of 3
• Encircle the numbers in 4 2 1 that are under the binary digit 1.
• Add the encircled numbers.
• Combine the numbers and letters
Examples: Convert the following
Hexadecimal numbers2.)to binary numbers
3B7 (Note: B=11)
3 11 7
1.) A9 (Note: A=10)
8 4 2 1 8 4 2 1 8 4 2 1
10 9
0 0 1 1 1 0 1 1 0 1 1 1
8 4 2 1 8 4 2 1
1 0 1 0 1 0 0 1
Answer:
1110110111
Answer:
10101001
Examples: Convert the following
Hexadecimal numbers to octal numbers
2.) 1EF (Note: E=14, F=15)
1.) AC (Note: A=10, C=12)
1 14 15
10 12
8 4 2 1 8 4 2 1 8 4 2 1
8 4 2 1 8 4 2 1
0 0 0 1 1 1 1 0 1 1 1 1
1 0 1 0 1 1 0 0
Group of 3:
Group of 3:
111 101 111
010 101 100
421 421 421
421 421 421
=4+2+1 =4+1 =4+2+1
=2 =4+1 =4
=7 =5 =7
=5
Answer: 757
Answer: 254
Assignment: Convert the following
Hexadecimal numbers to binary/octal numbers