Lesson 2 Part 1 - Number System (1)
Lesson 2 Part 1 - Number System (1)
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025
Lesson 2 Part 1
Number System
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025
Number System
The technique to represent and work with
numbers is called number system.
Decimal number system is the most common
number system.
Other popular number systems include:
1. binary number system,
2. octal number system,
3. hexadecimal number system
Number Systems
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025
Decimal Number
System
Decimal number system is a base 10 number
system having 10 digits from 0 to 9. This means
that any numerical quantity can be represented
using these 10 digits.
Decimal number system is also a positional
value system. This means that the value of
digits will depend on its position.
Number Systems
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025
Hexadecimal (HEX)
Number System
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025
Hexadecimal Number
System
Hexadecimal number system has 16 symbols – 0 to 9
and A to F where A is equal to 10, B is equal to 11 and so on
till F. Hexadecimal number system is also a positional value
system with where each digit has its value expressed in
powers of 16, as shown here −
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025
Hexadecimal Number
System
Decimal equivalent of any hexadecimal number is sum
of product of each digit with its positional value.
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025
Number
System
Relationship
Number System
Conversion
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025
Number System
Conversion
As you know decimal, binary, octal and hexadecimal
number systems are positional value number systems.
Number System
Conversion
1. Decimal to Binary
2. Decimal to Octal
3. Decimal to
Hexadecimal
Number System
Conversion
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025
Decimal to Binary
Decimal numbers can be converted to binary by
repeated division of the number by 2 while recording
the remainder. Let’s take an example to see how this
happens.
Decimal to Octal
Decimal numbers can be converted to octal by
repeated division of the number by 8 while recording
the remainder. Let’s take an example to see how this
happens.
Decimal to Hexadecimal
Decimal numbers can be converted to hexadecimal by
repeated division of the number by 16 while recording
the remainder. Let’s take an example to see how this
happens.
Binary to Decimal
Binary to Decimal
10
First, we will use position notation
Number System
Conversion
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025
Binary to Decimal
Number System
Conversion
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025
Binary to Decimal
Number System
Conversion
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025
Binary to Octal
To convert a binary number to octal number, these steps are followed
−
Number System
Conversion
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025
Binary to Octal
Let’s take an example to understand this.
Number System
Conversion
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025
Binary to Hexadecimal
to convert binary (base 2) to hexadecimal (base 16)
If you don't have 4 digits, add zeros to the front to make it four digits.
So, 01 would become 0001
Number System
Conversion
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025
Binary to Hexadecimal
Example:
Number System
Conversion
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025
Binary to Hexadecimal
Example:
Number System
Conversion
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025
Octal to Decimal
To convert an
octal number to a
decimal number we
need to multiply
each digit of the
given octal with
the reducing
power of 8
Number System
Conversion
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025
Octal to Binary
To convert an octal number to binary, each octal digit
is converted to its 3-bit binary equivalent according
to this table.
Number System
Conversion
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025
Octal to Hexadecimal
Hexadecimal numbers consist of numbers and alphabets. It
is represented with base 16. The numbers from 0-9 are
represented in the usual form, but from 10 to 15, it is
denoted as A, B, C, D, E, F.
Conversion of the octal number to hexadecimal requires
two steps:
First, convert octal numbers to decimal numbers
Then, convert decimal numbers to hexadecimal
numbers
Number System
Conversion
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025
Octal to Hexadecimal
First, convert octal numbers to decimal numbers
Then, convert decimal numbers to hexadecimal
numbers
10 16
Number System
Conversion
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025
Hexadecimal to Decimal
To convert this into a decimal number system, multiply
each digit with the powers of 16 starting from units place of
the number.
Number System
Conversion
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025
Hexadecimal
to Decimal
Hexadecimal to Binary
Hexadecimal numbers consist of numbers and
alphabets. It is represented with base 16. The numbers from
0-9 are represented in the usual form, but from 10 to 15, it is
denoted as A, B, C, D, E, F.
Conversion of the hexadecimal number to binary
requires two steps:
First, convert hexadecimal numbers to decimal
numbers
Then, convert decimal numbers to binary numbers
Number System
Conversion
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025
Hexadecimal to Binary
First, convert hexadecimal numbers to
decimal numbers
Then, convert decimal numbers to binary
numbers
Number System
Conversion
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025
Hexadecimal to Octal
Hexadecimal numbers consist of numbers and
alphabets. It is represented with base 16. The numbers from
0-9 are represented in the usual form, but from 10 to 15, it is
denoted as A, B, C, D, E, F.
Conversion of the hexadecimal number to binary
requires two steps:
First, convert hexadecimal numbers to Decimal
numbers
Then, convert decimal numbers to Octal numbers
Number System
Conversion
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025
Hexadecimal to Octal
First, convert hexadecimal numbers to Decimal numbers
Then, convert decimal numbers to Octal numbers
Number System
Conversion
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025
Exercises
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025