0% found this document useful (0 votes)
3 views55 pages

Understanding Number Systems in Computing

The document explains the concept of number systems, including Decimal, Binary, Octal, and Hexadecimal, detailing their importance in mathematics and computing. It covers how to convert numbers between these systems and provides examples and exercises for practice. The document emphasizes the structure and rules of each system, including place values and the representation of numbers.

Uploaded by

jaredofficial989
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views55 pages

Understanding Number Systems in Computing

The document explains the concept of number systems, including Decimal, Binary, Octal, and Hexadecimal, detailing their importance in mathematics and computing. It covers how to convert numbers between these systems and provides examples and exercises for practice. The document emphasizes the structure and rules of each system, including place values and the representation of numbers.

Uploaded by

jaredofficial989
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

NUMBER

SYSTEM
objectives:
Define what a number Differentiate the four
system is and explain its main types of number
importance in systems: Decimal,
mathematics and Binary, Octal, and
computing. Hexadecimal.

Apply knowledge of
Convert numbers
number systems in Odd
from one system to
solving real-life and
another with Even
computer-related
accuracy. problems.
number system
A number system is a way of representing numbers using
a set of symbols (called digits) and rules for combining
them. It provides a framework for expressing quantities,
performing calculations, and processing data. In
mathematics and computing, number systems are
essential because they allow us to communicate and
manipulate numerical information.
types of number system

Decimal Octal System


(Base 10) (Base 8)

Binary System Hexadecimal


(Base 2) System (Base 16)
What is Decimal system ?

The decimal system (also called base 10) is the


standard system for representing numbers in
mathematics and daily life. It is called “decimal”
because it is based on 10 symbols (digits):
0,1,2,3,4,5,6,7,8,9
Place Value System

In decimal, the value of a number is


determined by multiplying each digit by a
power of 10.
-1,-2,-3,-4,-5,-6,-7,-8,-9
(We use negative exponents when the number is less
than 1 (decimal form).)
Power of 10 Value
10⁹ 1,000,000,000
10⁸ 100,000,000
10⁷ 10,000,000
10⁶ 1,000,000
10⁵ 100,000
10⁴ 10,000
10³ 1,000
10² 100
10¹ 10
10⁰ 1
10⁻¹ 0.1
10⁻² 0.01
10⁻³ 0.001
10⁻⁴ 0.0001
10⁻⁵ 0.00001
10⁻⁶ 0.000001
10⁻⁷ 0.0000001
10⁻⁸ 0.00000001
10⁻⁹ 0.000000001
In 345→
3 is in the hundreds place
3×100=300
4 is in the tens place
4×10=40
5 is in the ones place
5×1=5

Total = 345
Example: 5,672

=(5×10³)+(6×10²)+(7×10¹)+(2×10⁰)

=5000+600+70+2=

= 5,672

In short: The decimal system (base 10) is the standard number


system humans use for counting, money, and measurements.
Example:
25.6

(2x 10¹)+(5x10 ⁰)+(6x10 )


-1

20+5+0.6
=25.6
Exercise: Answer the following in exponent form.

a. 6159

b. 356.8
Activity 2.2
Write the following numbers in expanded form using powers of
10.

a. 265.3
b. 502
c. 37.2
d. 18435
e. 9821.75
types of number system

Decimal Octal System


(Base 10) (Base 8)

Binary System Hexadecimal


(Base 2) System (Base 16)
What is Binary code?

A binary unit is also known as a “bit.” It is the


smallest unit of digital information that a
computer can understand. It is stored in a series of
zeros and ones. A computer thinks by relying on
zeros and ones for all information.
Bit Vs Byte

While a bit is the smallest unit of


information that a computer can
understand, a byte is a string of 8 bits.
A byte is also known as a unit of
memory size.
Why Binary
Code?

Computers can compute the


meaning of binary strings very
quickly and translate them into
numbers or letters. Text, images,
sound, and video are converted into
binary before being processed by
the computer.
Think of the numbers like a light switch

1 0
1 is on 0 is off
ODD EVEN
Decimal Binary

0 0000

Numbers 1 0001

in Binary
2 0010

code
3 0011
4 0100
5 0101

6 0110
7 0111
8 1000
9 1001
10 1010
Example: Decimal to Binary

3
4
4÷2= 2 ( 0 )
3÷2= 1 (remainder 1) 2÷2= 1 (0 )
1÷2=0 (remainder 1)
1÷2= 0 (remainder 1 )
3= 0011
4=0100
Exercise: Decimal to Binary

a. 5

b. 6

c. 7
Binary to decimal
Binary Code Example: 101001100

2^8 2^7 2^6 2^5 2^4 2^3 2^2 2^1 2^0

256 128 64 32 16 8 4 2 1

Is this on or off? 1=on 0=off 1=on 0=off 0=off 1=on 1=on 0=off 0=off

Total: 256 0 64 0 0 8 4 0 0

Add it up 256 + 0 + 64 + 0 + 0 + 8 + 4 + 0 + 0

Computer reads it
as: 332
Example:
11001010 1 1 0 0 1 0 1 0

2^7 2^6 2^5 2^4 2^3 2^2 2^1 2^0

128 64 32 16 8 4 2 1

128 64 x x 8 x 2 x

128+64+8+2= 202
Exercise: Binary to Decimal

a. 11101

b. 001011
From decimal number to binary
Example Number: 296
Look at your number. Subtract the largest power of 2 that is able to be
subtracted from your number. In this example, we can subtract 256
so we can put a 1 in that column to indicate it is “on”.
296-256 = 40
Now look at what is left, in this case 40. You would put a “0” in the 128
and 64 columns because they cannot be subtracted. 32 CAN be
subtracted so you would put a 1. Continue this until your result is zero
when you subtract.
40 - 32 = 8 then... 8-8=0
256 128 64 32 16 8 4 2 0

1 0 0 1 0 1 0 0 0

296 in binary is 100101000


Another Way to convert
Divide your number by 2 and write
the remainder until you get zero as 296 divided by 2 = 148 remainder 0
the answer. Write the remainders 148 divided by 2 = 74 remainder 0
starting from the last one first. 74 divided by 2 = 37 remainder 0
37 divided by 2 = 18 remainder 1
Example number: 296 18 divided by 2 = 9 remainder 0
9 divided by 2 = 4 remainder 1
Remainders written
4 divided by 2 = 2 remainder 0
backwards:
2 divided by 2 = 1 remainder 0
100101000 1 divided by 2 = 0 remainder 1
Binary Facts
Binary code is the Ancient Egyptians
basis for all computer discovered binary
languages. code.

If the last digit of a


A byte is a collection binary number is 1, it Odd

of 8 binary digits. will be odd. If it is 0, it Even


will be even.
Convert the following binary numbers into decimal.

a. 1010
b. 11101
c. 100110
d. 1100110
e. 10110101
Convert a decimal number with a decimal point into binary.

Example: 12.75
Convert the whole number part before the decimal point.
12 → in binary it is 1100.
Convert the fractional part after the decimal point.
0.75×2=1.5 → take 1
0.5×2=1.0→ take 1
So, 0.75=.11 in binary.

12.7510​=1100.112​
types of number system

Decimal Octal System


(Base 10) (Base 8)

Binary System Hexadecimal


(Base 2) System (Base 16)
What is Octal system?

The octal number system is a base-8 number


system.
That means:
It uses 8 digits only: 0, 1, 2, 3, 4, 5, 6, and 7.
Each digit’s place value is a power of 8, similar
to how the decimal system (base-10) uses
powers of 10.
place value of octal numbers

→ 0
Rightmost digit 8 =1 (ones place)
→ 1
Next digit 8 =8 (eights place)
→ 2
Next digit 8 =64 (sixty-fours place)
→ 3
Next digit 8 =512 (five hundred twelves
place)
→ 4
Next digit 8 =4096 (four thousand ninety-
sixes place)
… and so on.
Example: Octal to Decimal
7268

2 1 0
(7x8 )+(2x8 )+(6x8 )
=(7x64)+(2x8)+(6x1)
=448+16+6

=47010
Example: Octal to Decimal
24538

3 2 1 0
(2x8 )+(4x8 )+(5x8 )+(3x8 )
=(2x512)+(4x64)+(5x8)+(3x1)
=896+256+40+3

=119510
Exercise: Octal to Decimal

a. 6828

b. 84128
Decimal to Octal

To convert decimal to octal:


[Link] the decimal number by 8.
[Link] the remainder.
[Link] the quotient by 8 again until it becomes
0.
[Link] the remainders from bottom to top.
Example: Decimal to Octal
83 (decimal)

83÷8=10 remainder 3
10÷8=1 remainder 2
1÷8=0 remainder 1
=123

(83)10 =(123)8
Exercise: Decimal to Octal

a. 25
b. 951
Example: Octal to Binary
5368
Break it into digits: 5, 3, 6.
Change each octal digit into 3-digit binary:
5 in decimal is 101 in binary.
3 in decimal is 011 in binary.
6 in decimal is 110 in binary.
Put them together:
58​=1012​,38​=0112​,68​=1102​

536₈ = 101 011 110₂


Example: Octal to Binary
31528
3 = 011
1 = 001
5 = 101
2 = 010

38​=0112​,18​=0012​,58​=1012​,2=0102

3152₈ = 11001101010₂
Exercise: Octal to Binary

a. 6828

b. 84128
Activity 2.4: Convert the following:

(Octal to Decimal and Octal to Binary) (Decimal to Octal)


a. 7518 a. 45
b. 2308 b. 621
types of number system

Decimal Octal System


(Base 10) (Base 8)

Binary System Hexadecimal


(Base 2) System (Base 16)
What is hexadecimal system?

The hexadecimal system is a base-16


numeral system that uses 16 unique
symbols to represent numbers. Unlike the
decimal system (base-10), which uses digits
0-9, the hexadecimal system uses 0-9 and
the letters A-F to represent values.
What is hexadecimal system?

It uses 16 unique symbols to represent values.


These symbols are:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
0–9 represent values zero to nine (just like in
decimal).
A = 10, B = 11, C = 12, D = 13, E = 14, F = 15 in
decimal.
How it works:
Each digit’s place is a power of 16, similar to how
decimal uses powers of 10.
Example:
(2A3)16

2 1 0
=(2×16 )+(A×16 )+(3×16 )
=(2×256)+(10×16)+(3×1)
=512+160+3=675(decimal)
Example: Hexadecimal to Decimal
2F
The digit 2 has a decimal value of 2.
The digit F has a decimal value of 15 (as A=10, B=11, C=12,
D=13, E=14, F=15).
Multiply by powers of 16:
For the first digit from the right (F), the place value is 160

(which is 1). So, 15×16 =15×1=15.


0

For the next digit to the left (2), the place value is 16 1

(which is 16). So, 2×16 =2×16=32.


1

Add the results: 15+32=47.


Exercise: hexadecimal to decimal

a. (4E)16

b. (2B7)16
Hexadecimal to Binary

(F3)₁₆

F → 1111
3 → 0011

(F3)16​=(11110011)2​
Exercise: hexadecimal to binary

a. (4E)16

b. (2B7)16
Activity: Convert the following: hexadecimal to decimal and
hexadecimal to binary

a. (4E)16

b. (2B7)16
Hexadecimal to Octal

Step 1: Convert Hex → Binary


Each hex digit = 4 binary bits.
Step 2: Group Binary → Octal
Each octal digit = 3 binary bits.
After converting to binary, group into 3 bits (from right)
and convert to octal.
Hexadecimal to Octal
1 Step:(hex to binary)
st
2 nd
Step: (binary to octal)

(2F)16 00101111= 000 101 111


000= 0
2= 0010 101= 5
F= 1111 111= 7

(2F)16 = (00101111)2 (2F)16 = 578


Hexadecimal to Octal

Remember: octal uses groups of 3 bits.


But here we have 8 bits (0010 1111).
8 is not a multiple of 3, so we add leading zeros to make it divisible by
3.

0010 1111(8 bits)

Add a zero in front → 9 bits:

000 101 111


Hexadecimal to Octal
1 Step:(hex to binary)
st
2 nd
Step: (binary to octal)

(A3)16 10100011= 010 100 011


010= 2
A=1010 100= 4
3= 0011 011= 3

(A3)16 = (10100011)2 (A3)16 = 2438

You might also like