Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Nicdao Ict Module

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 14

Technology and

Livelihood Education
Quarter 1 — Module 1:

ICT: 4 TYPES OF NUMERICAL


SYSTEM:
BINARY, DECIMAL,
HEXADECIMAL, OCTAL.
Module Developer
Writer: Nicdao, Britz Jaimes T.

Printed in the Philippines by EARIST

Schools Division Office of MANILA

Department of Education – National Capital Region

INFORMATION AND
COMMUNICATION
TECHNOLOGY
Module 1: 4 TYPES OF
NUMERICAL SYSTEM:
BINARY, DECIMAL,
HEXADECIMAL, OCTAL.
MODULE CONTENT

LESSON 1# BINARY
TOPICS:
1.) WHAT IS BINARY
2.) BINARY TO DECIMAL
3.) BINARY TO HEXADECIMAL
4.) BINARY TO OCTAL

LESSON 2# DECIMAL
TOPICS:
1.) WHAT IS DECIMAL
2.) DECIMAL TO BINARY
3.) DECIMAL TO HEXA
4.) DECIMAL TO OCTAL

LESSON 3# HEXADECIMAL
TOPICS:
1.) WHAT IS HEXADECIMAL
2.) HEXA TO BINARY
3.) HEXA TO DECIMAL
4.) HEXA TO OCTAL

LESSON 4# OCTAL
1.) WHAT IS OCTAL
2.) OCTAL TO BINARY
3.) OCTAL TO DECIMAL
4.) OCTAL TO HEXA

After going through this module, you are expected to.

1.) Solve Binary, Decimal, Hexadecimal, Octal, in any order.


2.) Know the proper use of each other.
3.) Explore more topics regarding on how important and other use of 4 types

LESSON 1: BINARY
TOPIC NO.1

What is Binary?

Binary in ICT refers to the binary number system, which is a base-2 system
used in computers and digital electronics. It uses only two digits, 0 and 1, to
represent all numbers and data. In binary, each digit is called a bit, and a group of 8
bits is called a byte. By using combinations of 0s and 1s, binary is able to represent
and manipulate data in a way that computers can understand and process.

How Binary Representation is used to store and process various types of data
in computer? In computers, binary representation is used to store and process
various types of data through a system called encoding. Different types of data, such
as numbers, text, images, and audio, are all converted into binary code before being
stored and processed.

For example, let's say we have the number 123. In binary, it would be
represented as 1111011.

Each digit in the binary representation corresponds to a power of 2. Starting from the
rightmost digit, we have 2^0 (1), 2^1 (2), 2^2 (4), 2^3 (2^4 (16), 2^5 (32), and 2^6
(64). By adding up the powers of 2 where the corresponding binary digit is 1, we get
the decimal value 123.

Similarly, text characters can be encoded using binary codes. For example, the letter
'A' can be represented as 01000001 in ASCII encoding. By mapping each character
to its corresponding binary code, we can store and process entire strings of text in
binary form.

Images and audio can also be converted into binary representations. In digital
images, each pixel is assigned a binary code that represents its color or intensity.
Similarly, in digital audio, sound waves are sampled at regular intervals, and each
sample is represented by a binary code. Once data is stored in binary form,
computers can perform various operations on it using logic gates and circuits. These
operations include arithmetic computations, logical operations, comparisons, and
more. The binary nature of data allows for efficient processing and manipulation by
computers.

TOPIC NO.2

Binary to Decimal

Binary to decimal conversion is the process of converting a binary number to its


decimal equivalent. This can be done by multiplying each digit in the binary number
by the corresponding power of 2 based on its position, and then adding up the
results.

For example, let's convert the binary number 1010 to decimal:

1 * 2^3 = 1 * 8 = 8

0 * 2^2 = 0 * 4 = 0
1 * 2^1 = 1 * 2 = 2

0 * 2^0 = 0 * 1 = 0

Now, we add up the results: 8 + 0 + 2 + 0 = 10So, the binary number 1010 is


equivalent to the decimal number 10. Binary to Decimal, Let's say we have the binary
number 101010. To convert it to decimal, we start from the rightmost digit and assign
each digit a weight based on its position for example:

1 * 2^0 = 1 * 1 = 1

0 * 2^1 = 0 * 2 = 0

1 * 2^2 = 1 * 4 = 4

0 * 2^3 = 0 * 8 = 0

1 * 2^4 = 1 * 16 = 16

0 * 2^5 = 0 * 32 = 0

Now, we add up the results: 1 + 0 + 4 + 0 + 16 + 0 = 21So, the binary number


101010 is equivalent to the decimal number 21.

Let's say we have the binary number 101010. To convert it to decimal, we start from
the rightmost digit and assign each digit a weight based on its position.

For example:

1 * 2^0 = 1 * 1 = 1

0 * 2^1 = 0 * 2 = 0

1 * 2^2 = 1 * 4 = 4

0 * 2^3 = 0 * 8 = 0

1 * 2^4 = 1 * 16 = 16

0 * 2^5 = 0 * 32 = 0

Now, we add up the results: 1 + 0 + 4 + 0 + 16 + 0 = 21So, the binary number


101010 is equivalent to the decimal number 21.

TOPIC NO.3
Binary to Hexadecimal

Binary to hexadecimal conversion is the process of converting a binary number to its


hexadecimal equivalent. In this conversion, we group the binary digits into sets of
four, starting from the rightmost digit, and convert each set to its hexadecimal
representation. Here's an example to help you understand: Let's convert the binary
number 11010101 to hexadecimal: Grouping the binary digits into sets of four from
right to left: 1101 0101Converting each set to its hexadecimal representation:1101 =
D0101 = 5So, the binary number 11010101 is equivalent to the hexadecimal number
D5.I

The binary number 10101010 to hexadecimal.

Grouping the binary digits into sets of four:1010 1010Converting each group to its
corresponding hexadecimal digit:1010 is equivalent to A in hexadecimal1010 is also
equivalent to A in hexadecimal So, the binary number 10101010 is equivalent to the
hexadecimal number AA.

TOPIC NO.4

Binary to Octal

Binary and octal are two different numerical systems used in computing. Binary is a
base-2 system, meaning it uses only two digits, 0 and 1, while octal is a base-8
system, meaning it uses 8 digits, 0 to 7. Converting a binary number to octal involves
grouping the binary digits into sets of three and then replacing each set with its
corresponding octal digit.

Here's a step-by-step process for converting a binary number to octal:

1. Group the binary digits into sets of three, starting from the right. If the last group
has less than three digits, add leading zeros to make it a complete group.

2. Write down the octal digit for each group of three binary digits. Here's a quick
reference for the conversion:

- Binary 000: Octal 0

- Binary 001: Octal 1

- Binary 010: Octal 2

- Binary 011: Octal 3


- Binary 100: Octal 4

- Binary 101: Octal 5

- Binary 110: Octal 6

- Binary 111: Octal 7

3. Arrange the octal digits in the same order as they were derived from the binary
number. Let's go through an example: Suppose we want to convert the binary
number 110101101 to octal.

Step 1: Group the binary digits into sets of three:001 101 011

Step 2: Write down the corresponding octal digits:1 5 3

Step 3: Arrange the octal digits in the same order:153So, the octal equivalent of the
binary number 110101101 is 153.

LESSON 2: DECIMAL

TOPIC NO.1

Decimal

Decimal is a base-10 numbering system and a way of representing numbers using the digits 0 through 9. Each
digit's value is based on its position within the number.
The rightmost digit represents ones, the next digit to the left represents tens, the next represents hundreds, and so
on, with each position representing a power of 10.In information and communication technology (ICT), decimal is
important for several reasons:

1. Human readability: Decimal is the numbering system most commonly used by humans, making it easy to
understand and work with. It is the system we use for our everyday counting, measuring, and calculating, making it
a natural choice for representing numerical data in ICT for human consumption.

2. Real-world applications: Decimal is commonly used in ICT to represent quantities that are traditionally expressed
in base-10 units, such as currency, measurements, and most everyday calculations. For example, in a financial
application, decimal numbers are used to represent currency values like dollars and cents.
3. Interoperability: Decimal numbers are easily understood by people from all cultures and backgrounds, making
them a universal choice for representing numerical data in ICT. This simplifies data exchange and communication
between different systems and users.

4. Compatibility: Many ICT systems, including programming languages, databases, and software applications,
natively support decimal numbers. As a result, decimal is widely used as the standard for representing and
processing numerical data across various ICT platforms.

5. Precision: In many ICT applications, precise and accurate numerical representation is crucial. Decimal provides
a familiar and straightforward way to represent and manipulate such data while maintaining the expected level of
precision in calculations.

In summary, decimal is important in ICT due to its compatibility with human understanding, real-world applicability,
interoperability, compatibility with existing systems, and precision in representing numerical data. Its widespread
use in everyday life and across various ICT platforms makes it an essential element of modern digital systems and
applications.

TOPIC NO.2

DECIMAL TO BINARY

Converting a decimal number to binary involves representing the decimal number in base-2 form. Here's how it's
done:

1. Start with the decimal number you want to convert to binary

2. Divide the decimal number by 2 and record the remainder. This gives you the least significant bit of the
binary number.

3. Divide the quotient from the previous step by 2 and record the remainder. Repeat this process, recording
remainders from each division, until the quotient becomes 0.

4. 4. The remainders, read in reverse order, give you the binary representation of the decimal number.For
example, let's convert the decimal number 25 to binary:

Step 1:
Divide 25 by 2. The remainder is 1. The quotient is 12

.Step 2:
Divide 12 by 2. The remainder is 0. The quotient is 6.

Step 3:
Divide 6 by 2. The remainder is 0. The quotient is 3.

Step 4:
Divide 3 by 2. The remainder is 1. The quotient is 1.

Step 5:
Divide 1 by 2. The remainder is 1. The quotient is 0.

Reading the remainders in reverse order (1, 1, 0, 0, 1) gives the binary representation of 25, which is
11001.

So, the binary representation of the decimal number 25 is 11001.


TOPIC NO. 3

Decimal to Hexadecimal

Converting a decimal number to hexadecimal involves dividing the decimal number by 16 repeatedly and noting the
remainders. Here's a step-by-step process:

1. Divide the decimal number by 16.


2. Note the remainder.
3. Continue dividing the quotient by 16 until the quotient is 0, noting the remainders each time.
4. Write the remainders in reverse order to get the hexadecimal equivalent.

Let's take an example: Convert the decimal number 255 to hexadecimal.

255÷16=15255÷16=15 with a remainder of 15 (F in hexadecimal).

15÷16=015÷16=0 with a remainder of 15 (F in hexadecimal).

So, the hexadecimal equivalent of decimal 255 isFF.

Here's a Python code snippet for this conversion:

decimal_number = 255
hexadecimal_equivalent = hex(decimal_number).lstrip('0x').upper()
print (f" The hexadecimal equivalent of {decimal_number} is: {hexadecimal_equivalent}")
This code uses the built-in hex function in Python, which converts a decimal number to its hexadecimal
representation.
The lstrip ('0x') is used to remove the '0x' prefix that hex adds, and upper() is used to convert the result to
uppercase.

TOPIC NO.4

Decimal to Octal

Converting a decimal number to octal involves dividing the decimal number by 8 repeatedly and noting the
remainders.
Here's a step-by-step process:

1.) Divide the decimal number by 8.


2.) Note the remainder.
3.) Continue dividing the quotient by 8 until the quotient is 0, noting the remainders each time.
4.) Write the remainders in reverse order to get the octal equivalent.

Let's take an example: Convert the decimal number 27 to octal.

27÷8=327÷8=3 with a remainder of 3.


3÷8=03÷8=0 with a remainder of 3.

So, the octal equivalent of decimal 27 is3333.

Here's a Python code snippet for this conversion:

decimal_number = 27
octal_equivalent = oct(decimal_number).lstrip('0o')
print(f"The octal equivalent of {decimal_number} is: {octal_equivalent}")

LESSON 3:HEXADECIMAL
TOPIC NO.1

Hexadecimal

In the context of information and communication technology (ICT), hexadecimal (often abbreviated as hex) is a
base-16 numeral system.

It is widely used in computing and digital electronics as a convenient way to represent binary-coded values.
Here are key points related to hexadecimal in the context of ICT:Base-16 Representation: Hexadecimal is a
positional numeral system with a base of 16.
It uses the digits 0-9 and the letters A-F (or a-f) to represent values.

The reason for using letters is to represent values greater than 9 in a single digit.Binary Conversion:

Hexadecimal is particularly useful in computing because it provides a more human-readable representation of


binary-coded values.
Each hexadecimal digit corresponds to four binary digits (bits). Therefore, it's common to see hexadecimal used
when dealing with memory addresses, byte values, and binary data.

Memory Addresses: In programming and system architecture, memory addresses are often represented in
hexadecimal.

For example, memory addresses in a computer's RAM or storage devices are commonly expressed in
hexadecimal notation.Color Representation:

In graphics and web development, hexadecimal is frequently used to represent colors. A color in hexadecimal
notation is typically expressed as a six-digit code, where the first two digits represent the red component, the next
two represent green, and the last two represent blue (RGB color model).

Example:
The hexadecimal color code #FF0000 represents pure red (255 in red, 0 in green, and 0 in blue).
ASCII Representation: Hexadecimal is also used to represent characters in the ASCII (American Standard Code for
Information Interchange) character encoding.
Each ASCII character is assigned a unique hexadecimal value.

In summary, hexadecimal plays a crucial role in ICT for representing binary-coded information in a more readable
and compact form.
It is commonly used in programming, memory addressing, color representation, and other areas of computing.

LESSON NO.2

Hexadecimal to Binary
Converting a hexadecimal number to binary involves converting each hexadecimal digit to its equivalent 4-bit binary
representation. Each hexadecimal digit corresponds to a group of 4 bits in binary.

Write down the 4-bit binary representation for each hexadecimal digit.
0 in hex is 0000 in binary.
1 in hex is 0001 in binary.
2 in hex is 0010 in binary.
3 in hex is 0011 in binary.
4 in hex is 0100 in binary.
5 in hex is 0101 in binary.
6 in hex is 0110 in binary.
7 in hex is 0111 in binary.
8 in hex is 1000 in binary.
9 in hex is 1001 in binary.
A in hex is 1010 in binary.
B in hex is 1011 in binary.
C in hex is 1100 in binary.
D in hex is 1101 in binary.
E in hex is 1110 in binary.
F in hex is 1111 in binary.

Replace each hexadecimal digit with its binary equivalent.For example, if you have the hexadecimal number 1A3,
replace '1' with 0001, 'A' with 1010, and '3' with 0011.
Combine the binary representations.For the example 1A3, the binary equivalent is 0001 1010 0011.

LESSON NO.3

Hexadecimal to Decimal

To convert a hexadecimal number to binary manually, you can follow these steps:

Write down the 4-bit binary representation for each hexadecimal digit.
Replace each hexadecimal digit with its binary equivalent.
Combine the binary representations.
Let's take an example:
Convert the hexadecimal number 1A3 to binary.

'1' in hex is 0001 in binary.


'A' in hex is 1010 in binary.'
3' in hex is 0011 in binary.

Combine these binary representations to get the binary equivalent: 000110100011.


So, the binary equivalent of the hexadecimal number 1A3 is 000110100011.

Let's take an example and convert a hexadecimal number to its decimal equivalent.
Consider the hexadecimal number 1A3:

1.) The rightmost digit is '3', which in decimal is 3.


2.) Moving to the left, 'A' in hexadecimal is equivalent to 10 in decimal.
3.) The leftmost digit '1' in hexadecimal is equivalent to 1 in decimal.

LESSON NO.4
Hexadecimal to Octal

To convert a hexadecimal number to octal, you can first convert it to binary and then from binary to octal.
Here's the step-by-step process:

1. Convert Hexadecimal to Binary:


Replace each hexadecimal digit with its 4-bit binary equivalent.
2. Group Binary Digits into Sets of 3:
Starting from the right, group the binary digits into sets of three.
3. Convert Each Group to Octal:
Replace each group of 3 binary digits with its octal equivalent.

Let's take an example: Convert the hexadecimal number 1A3 to octal.


'1' in hex is 0001 in binary.
'A' in hex is 1010 in binary.
'3' in hex is 0011 in binary.

Combine these binary digits: 000110100011.


Now, group into sets of three: 000 | 110 | 100 | 011.
Convert each group to octal: 0 | 6 | 4 | 3.
Combine the octal equivalents: 0643.
So, the octal equivalent of the hexadecimal number 1A3 is 643.

LESSON 4: OCTAL
TOPIC NO.1

Octal

In information and communication technology (ICT), octal is a numeral system with a base of 8.
The octal system uses the digits 0 through 7 to represent values, and each digit in an octal number corresponds to
a group of three binary digits (bits). Octal is less commonly used in modern computing compared to binary and
hexadecimal, but it still has historical significance.

Here are some key points about octal in the context of ICT:

1. Base-8 Representation: Octal is a positional numeral system, and each place value represents a power of
8. The rightmost digit represents8080(1), the next digit to the left represents8181(8), the next
represents8282(64), and so on.
2. Binary Relationship: Each octal digit corresponds to a unique combination of three binary digits.

For example:
0 in octal is 000 in binary.
1 in octal is 001 in binary.
2 in octal is 010 in binary.
3 in octal is 011 in binary.
4 in octal is 100 in binary.
5 in octal is 101 in binary.
6 in octal is 110 in binary.
7 in octal is 111 in binary.

3. Historical Usage: Octal was more commonly used in early computing systems because it aligns well with
the word sizes of certain computer architectures.
For example, early mainframe computers often had word sizes that were multiples of 3, making octal a
natural choice for representing data.
4. Address Representation: In some computer architectures, memory addresses and values were represented
in octal. For instance, the PDP-8, a historic minicomputer, used octal extensively in its assembly language
and memory representation.
5. Limited Modern Use: With the prevalence of binary and hexadecimal representation, octal is less commonly
used in modern computing.
Hexadecimal is often preferred when a more compact representation is needed.

In summary, octal has historical significance in the early days of computing, but its usage has diminished
over time, and it is not as prevalent in contemporary ICT as binary or hexadecimal.

TOPIC NO.2

Octal to Binary

Converting an octal number to binary involves replacing each octal digit with its 3-bit binary equivalent.
Here's a step-by-step process:

Write down the 3-bit binary representation for each octal digit.

0 in octal is 000 in binary.


1 in octal is 001 in binary.
2 in octal is 010 in binary.
3 in octal is 011 in binary.
4 in octal is 100 in binary.
5 in octal is 101 in binary.
6 in octal is 110 in binary.
7 in octal is 111 in binary.

Replace each octal digit with its binary equivalent.


For example, if you have the octal number 643, replace '6' with 110, '4' with 100, and '3' with 011.
Combine the binary representations.
For the example 643, the binary equivalent is 110100011.

TOPIC NO.3

Octal to Decimal

Converting an octal number to decimal involves interpreting each digit in the octal number as a multiple of powers
of 8 and then summing these values.
The positional values in octal are powers of 8, starting from the rightmost digit as 8^0, 8^1, 8^2, and so on.

Here's a step-by-step process:

1. Write down the octal number.


2. Starting from the rightmost digit, assign each digit a positional value as a power of 8.
3. Multiply each digit by the corresponding power of 8.
4. Sum up all the results.

TOPIC NO. 4

Octal to Hexadecimal

To convert an octal number to hexadecimal, you can first convert it to binary and then from binary to
hexadecimal. Here's the step-by-step process:
1. Convert Octal to Binary:
Replace each octal digit with its 3-bit binary equivalent.
2. Group Binary Digits into Sets of 4:
Starting from the right, group the binary digits into sets of four.
3. Convert Each Group to Hexadecimal:
Replace each group of 4 binary digits with its hexadecimal equivalent.

Let's take an example: Convert the octal number 643 to hexadecimal.

'6' in octal is 110 in binary.


'4' in octal is 100 in binary.
'3' in octal is 011 in binary.

Combine these binary digits: 110100011.


Now, group into sets of four: 1101 | 0001 | 1.
Convert each group to hexadecimal: D | 1 | 1.
Combine the hexadecimal equivalents: D11.

So, the hexadecimal equivalent of the octal number 643 is D11.

References

ELECTRONIC RESOURCES

https://byjus.com/maths/number-system/#:~:text=Computer%20Numeral%20System%20(Number
%20System%20in%20Computers)&text=In%20general%2C%20the%20binary%20number,systems
%20are%20also%20used%20sometimes.

https://www.toppr.com/guides/computer-aptitude-and-knowledge/basics-of-computers/number-systems/

https://www.tutorialspoint.com/computer_fundamentals/computer_number_system.htm

Written and Submitted by: Britz Jaimes T. Nicdao

You might also like