0% found this document useful (0 votes)
2 views

1 How Computers Work- FINAL

The document provides an overview of computer number systems including decimal, binary, octal, and hexadecimal, and their applications in computing. It explains how computers interpret data through binary code and the role of ASCII in text representation and communication. Additionally, it outlines methods for converting between different number systems and includes examples and exercises for practice.

Uploaded by

Emalyn Revilla
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

1 How Computers Work- FINAL

The document provides an overview of computer number systems including decimal, binary, octal, and hexadecimal, and their applications in computing. It explains how computers interpret data through binary code and the role of ASCII in text representation and communication. Additionally, it outlines methods for converting between different number systems and includes examples and exercises for practice.

Uploaded by

Emalyn Revilla
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 86

Computer Number

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.

When a person types on the computer’s keyboard, the


human identifies the letters, numbers, and characters
combined to create words and sentences.

But the computer does not recognize letters as letters in the


alphabet; it sees the letters as a series of 0’s and 1’s called
the binary language.
• Basic Components of a Computer
1.Input Devices
1. Allow users to send data to the computer (e.g., keyboard, mouse, microphone).
2.Processor (CPU - Central Processing Unit)
1. The "brain" of the computer that processes instructions.
3.Memory (RAM - Random Access Memory)
1. Temporarily holds data and instructions for quick access.
4.Storage (HDD, SSD)
1. Stores data permanently.
5.Output Devices
1. Display results to the user (e.g., monitor, printer, speakers).
How Computers Interpret Data
Computers process and interpret data using
binary code, executing operations through the
CPU and memory. They follow a structured cycle
(input → processing → storage → output),
enabling them to perform complex tasks
efficiently.
The Role of ASCII Code in Computer Systems

ASCII (American Standard Code for Information


Interchange) is a character encoding standard that
allows computers to represent and manipulate
text. It plays a crucial role in computer systems by
providing a standardized way to encode
characters, making it possible for different devices
and software to communicate effectively.
How Computers Use ASCII
• Text Representation
Computers store and process all data in binary form (0s and 1s). ASCII assigns a unique
numerical code to each character (e.g., ‘A’ is 65, ‘B’ is 66).
• Data Transmission
For example, when typing on a keyboard, each keystroke is converted into an ASCII
value that the computer understands.
• File Encoding
Many text files (.txt, .csv, etc.) and programming source codes use ASCII encoding to
store information.
• Communication Protocols
ASCII is widely used in network protocols, including email (SMTP), web communication
(HTTP), and other text-based data transfers, ensuring standardized communication.
• Programming and Development
Many programming languages use ASCII for handling text-based operations. Functions
like string comparison, conversion, and manipulation rely on ASCII values.
Which is More Powerful:
The Human Brain or a
CPU?
1.Processing Speed
2. Memory & Storage
3. Learning &
Adaptability
4. Multitasking
Which is More Powerful:
The Human Brain or a
CPU?
1.Processing Speed
2. Memory & Storage
3. Learning &
Adaptability
4. Multitasking
Computer Number Systems
• Humans use the decimal number system: 0,1,2,3,4,5,6,7,8,9
• Computer understands the binary number system: 0, 1

• Number Systems: 4 Basic Notations:


Binary, Hexadecimal, Decimal, Octal Notation.
Computer Number Systems
• Humans use the decimal number system: 0,1,2,3,4,5,6,7,8,9
• Computer understands the binary number system: 0, 1

Other types of number system:

• Hexadecimal number system: (Hexa = 6, Deci =10 → uses


• Octal number system: 0,1,2,3,4,5,6,7

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.

2. The information is hen transmitted in the form of 0’s and 1’s


using the ASCII (American Standard Code for Information
Interchange) code. [converting characters to 0 and 1]
How computers interpret data
3. The CPU determines what character has been typed and
sends the information to the computer monitor, again in
0’s and 1’s.

4. The monitor displays the information in its equivalent


character, this time readable and understandable by
humans.
ASCII TABLE:
CONVERSIONS OF NUMBER
SYSTEMS
1. DECIMAL TO Binary, Octal, and
Hexadecimal.
Strategy: Successive division.
Divide the given decimal number and the succeeding quotients by
2 for Binary
8 for Octal
16 for Hexadecimal.
Record the successive quotients and remainders, and stop only when
the quotient is 0.

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 101110010 562 172

3284 110011010100 6324 CD4

16475 100000001011011 40133 405B


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

• Binary to Decimal Conversion Method


The binary number system as it consists of
two digits namely 0 and 1 is generally
applied in computers and electronic
devices to represent data easily. Similarly,
the decimal number system consisting of 0
to 9 digits is a commonly used number
system for easy learning for people. Let us
learn how to convert binary numbers to
How to convert binary to decimal
?
Binary to Decimal Conversion using
Positional Notation Method
1. Find the position of every binary digit. We should
count the position from the right direction of the
number. And the position count starts from 0.
Example: 0001 - position of 1 = 0, 0 = 1, 0 = 2, 0 =
3.
2. Multiply every digit with 2 to the power of their
corresponding position. (2 position)
3. Finally, calculate the sum of all the multiples.
Example: (1111) 2= ________ 10

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

•How to convert binary to


octal ?
• Group every 3 binary bits from right to left
and construct the octal number system.
Example: (101010101)2 to octal
• (101)(010)(101)
• = (525)8
Example: (11111111) 2= ________ 8

Answer:
= (11)(111)(111)
= (377)8
4. Binary to Hexadecimal

How to convert binary to


hexadecimal? Group every 4 binary
bits from right to left and construct the
hexadecimal number system.
• Example: (101010101)2 to hexadecimal
• = (101010101)2
• = (1)(0101)(0101)
Example: (11111111) 2= ________ 16

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

•Octal number is a number expressed in


the base 8 numeral system. Octal
number's digits have 8 symbols:
0,1,2,3,4,5,6,7. Each digit of an octal
number counts a power of 16
5. Octal to Decimal

How to convert from octal to decimal


Step 1: Since an octal number only uses digits from 0 to 7, we first
arrange the octal number with the power of 8.
Step 2: We evaluate all the power of 8 values such as 80 is 1, 81 is
8, etc., and write down the value of each octal number.
Step 3: Once the value is obtained, we multiply each number.
Step 4: Final step is to add the product of all the numbers to obtain
the decimal number.
Example: (140) 8= ________ 10
Example: (140) 8= ________ 10
2. Binary, Octal, Hexadecimal to
Decimal

Digits ←A B C D . E F G→

← 23 22 21 20 . 2-1 2-2 2-3 →


← 83 82 81 80 . 8-1 8-2 8-3 →
Binary (base 2)

← 163 162 161 160 . 16-1 16-2 16-3 →


Octal (base 8)
Hexa(base 16)
decimal
*Multiply the digit/s and its corresponding baseexponent and then add.
Example: Convert the following binary
to decimal
1.) 1 0 1 1 0 1 2.) 1 0 1 . 1 0 1
25 24 23 22 21 20 22 21 20 2-1 2-2 2-3
*do not include 0 *do not include 0
1 x 25 = 32 1 x 22 = 4
1 x 23 = 8 1 x 20 = 1
1 x 22 = 4 1 x 2-1 = 0.5

SUM: 4510 ← Answer SUM: 5.62510 ← Answer


1 x 20 = 1 1 x 2-3 = 0.125
YOUR TURN: Convert the following
to Decimal
Binary / Octal / Hexadecimal Decimal
1 1 0 1 12
1 0 0 1 1 . 0 1 12
7658
635.758
AB0916
E41.2D16
YOUR TURN: Convert the following
to Decimal
Binary / Octal / Hexadecimal Decimal
1 1 0 1 12 27
1 0 0 1 1 . 0 1 12 19.3755
7658 501
635.758 413.953125
AB0916 43,785
E41.2D16 3649.17578125
Example: Convert the following octal to
decimal
2.) 425.27
1.) 1075 4 2 5 . 2 7
82 81 80 8-1 8-2
1 0 7 5 *do not include 0
83 82 81 80
4 x 82 = 256
*do not include 0
2 x 81 = 16
1 x 83 = 512
7 x 81 = 56 5 x 80 = 5
2 x 8-1 =0.25
SUM: 57310 ← Answer
5 x 80 = 5
7 x 8-2 =0.109375
SUM: 277.35937510 ← Answer
Example: Convert the following
hexadecimal to decimal
2.) 3B4.C8 Note: B=11, C=12)
1.) 23E (Note: E=14) 3 11 4 . 12 8
2 3 E(14) 162 161 160 16-1 16-2
162 161 160 *do not include 0
*do not include 0 3 x 162= 768
2 x 162= 512 11 x 161 = 176
3 x 161 = 48 4 x 160 = 4

SUM: 57410 ← Answer


14 x 160 = 14 12 x 16-1 = 0.75
8 x 16-2 = 0.03125
YOUR TURN: Convert the following
to Decimal
Binary / Octal / Hexadecimal Decimal
1 1 0 1 12 27
1 0 0 1 1 . 0 1 12 19.3755
7658 501
635.758 413.953125
AB0916 43,785
E41.2D16 3649.17578125
3. Binary to Octal / Hexadecimal
To Octal:
• Group the binary numbers into groups of 3 (start from the left)
• Write: 4 2 1 to each groups of 3
• Add the numbers under the binary digit 1.
• Combine the numbers
To Hexadecimal:
• Group the binary numbers into groups of 4 (start from the left)
• Write: 8 4 2 1 to each groups of 4
• Add the numbers under the binary digit 1
• Convert the numbers 10, 11, 12, 13, 14, or 15 to its corresponding
letter
• Combine the numbers and letters.
Examples: Convert the following binary
numbers to octal numbers
1. 1 1 0 1 0 1 2. 1 1 1 1 1 1 0
1 1 0 1 0 1 0 0 1 1 1 1 1 1 0
4 2 1 4 2 1 4 2 1 4 2 1 4 2 1
=4 +2 =4+1 =1 =4+2+1 =4+2
=6 =5 =7 =6

Answer: 65 Answer: 176


Examples: Convert the following binary
numbers to Hexadecimal numbers
1. 10110111 2. 1011101010
1 0 1 1 0 1 1 1 0 0 1 0 1 1 1 0 1 0 1 0
8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1
=8 +2+1 =4+2+1 =2 =8+4+2 =8+2
=11 =7 =14 =10
=B =E =A
Answer: B7 Answer: 176
YOUR TURN: Convert the following
binary numbers to Octal and
Hexadecimal numbers.
Binary Octal Hexadecimal
11011010
1111011111100
YOUR TURN: Convert the following
binary numbers to Octal and
Hexadecimal numbers.
Binary Octal Hexadecimal
11011010 3328 DA16
1111011111100 173748 1EFC16
4. Octal to Binary / Hexadecimal
To Binary
• Separate each digit
• Write: 4 2 1 under each digit
• Encircle the number/s in 4 2 1 that adds up to the digit above them
• Write 1 under the encircled numbers, and 0 otherwise. (binary)

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

Hexadecimal Binary Octal


1D29
1F2C
ASCII TABLE:
The Role of ASCII Code in Computer Systems

ASCII (a·skee) (American Standard Code for


Information Interchange) is a character encoding
standard used in computer systems to represent text
and control characters. It plays a crucial role in
ensuring compatibility between different devices and
software applications by providing a standardized
way to encode characters as binary values.
How Computers Use ASCII
1. Text Representation
• Computers store and process
text as binary data. ASCII
assigns a unique numeric
code (from 0 to 127 in
standard ASCII) to each
character, such as letters,
digits, punctuation marks,
and control characters.
• For example, the letter 'A' is
represented as 65 in ASCII,
which corresponds to
01000001 in binary.
How Computers Use ASCII
2. Communication & Data
Exchange
• ASCII is widely used in data
transmission protocols (e.g.,
HTTP, SMTP) to encode
messages exchanged between
computers and networks.
• It ensures that different
systems can interpret text data
correctly, regardless of
hardware or software
differences.
How Computers Use ASCII
2. Communication & Data
Exchange
• ASCII is widely used in data
transmission protocols (e.g.,
HTTP, SMTP) to encode
messages exchanged between
computers and networks.
• It ensures that different
systems can interpret text data
correctly, regardless of
hardware or software
differences.
How Computers Use ASCII
3. Programming & Software
Development
• Many programming languages (C,
Python, Java, etc.) use ASCII to process
text-based data.
• Functions like converting uppercase to
lowercase or checking character types
rely on ASCII values.
Example in Python:
• print(ord('A')) # Outputs: 65
• print(chr(97)) # Outputs: 'a'
How Computers Use ASCII
4. Keyboard Input & Display
• When a user presses a key, the keyboard sends its corresponding ASCII value to
the computer.
• The operating system and applications interpret this ASCII code and display the
correct character on the screen.
How Computers Use ASCII
5. File Encoding & Storage
• Text files (like .txt, .csv, and .json)
often use ASCII encoding to store
characters.
• ASCII is lightweight compared to
more complex encoding systems like
Unicode, making it efficient for
simple text storage.
Conclusion:
ASCII serves as a fundamental
encoding system that allows
computers to process, store,
and communicate text data
efficiently. Although modern
systems use Unicode (which
includes ASCII as a subset),
ASCII remains essential in
computing, especially in
legacy systems, programming,
and data transmission.
Review:
Let’s convert "FUN"
into binary using
ASCII. Use 8-bit
binary.
1. Find the ASCII values.
2. Convert to 8-bit
binary.
Answer:
F → 01000110
U → 01010101
N → 01001110
 This is the binary
representation of
"FUN" using the ASCII
system. 😊
01000110 01010101 01001110

You might also like