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

Lesson 2 Part 1 - Number System (1)

The document covers the fundamentals of number systems used in computer architecture, including decimal, binary, octal, and hexadecimal systems. It explains each system's structure, positional value, and methods for converting between them. The content is aimed at providing a foundational understanding of how numbers are represented and manipulated in digital systems.

Uploaded by

Bea Magallanes
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

Lesson 2 Part 1 - Number System (1)

The document covers the fundamentals of number systems used in computer architecture, including decimal, binary, octal, and hexadecimal systems. It explains each system's structure, positional value, and methods for converting between them. The content is aimed at providing a foundational understanding of how numbers are represented and manipulated in digital systems.

Uploaded by

Bea Magallanes
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 47

CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025

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

Decimal Number System


Say we have three numbers – 734, 971 and 207.
The value of 7 in all three numbers is different−
Number Systems
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025

Decimal Number System


= 1 (any number with absolute zero power is equivalent to
1)
= 10

= 100 (10 x 10)

= 1000 (10 x 10 x 10)

= 10000 (10 x 10 x 10 x 10)

= 100000 (10 x 10 x 10 x 10 x 10)


Number Systems
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025

Decimal Number System


Example of Decimal Number System:
The decimal number 1457 consists of the digit 7 in the units
position, 5 in the tens place, 4 in the hundreds position, and 1 in
the thousands place whose value can be written as:
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025

Decimal Number System


In digital systems, instructions are given
through electrical signals; variation is done by
varying the voltage of the signal. Having 10
different voltages to implement decimal number
system in digital equipment is difficult. So, many
number systems that are easier to implement
digitally have been developed. Let’s look at them
in detail.
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025

Binary Number System


CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025

Binary Number System


The easiest way to vary instructions through electric
signals is two-state system – ON and OFF.
 ON is represented as 1, and,
 OFF as 0

The number system having just these two digits – 0 and 1


– is called binary number system.

Each binary digit is also called a bit.


CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025

Binary Number System


Binary number system is also positional value system,
where each digit has a value expressed in powers of 2, as
displayed here.
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025

Binary Number System


In any binary number, the rightmost digit is called least
significant bit (LSB) and leftmost digit is called most
significant bit (MSB).
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025

Binary to Decimal Number


System
Decimal equivalent of Binary 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

Octal Number System


CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025

Octal Number System


Octal number system has eight digits – 0, 1, 2, 3, 4, 5,
6 and 7. Octal number system is also a positional value
system with where each digit has its value expressed in
powers of 8, as shown here −
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025

Octal Number System


Decimal equivalent of any octal 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

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

The table at the right


depicts the relationship
between decimal, binary,
octal and hexadecimal
number systems.
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025

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.

To convert binary, octal and hexadecimal to decimal


number, we just need to add the product of each digit with
its positional value. Here we are going to learn other
conversion among these number systems.
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025

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.

The remainders are


to be read from
bottom to top to
obtain the binary
Number System
Conversion
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025

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.

The remainders are


to be read from
bottom to top to
obtain the binary
equivalent.
Number System
Conversion
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025

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.

The remainders are to


be read from bottom to
top to obtain the
hexadecimal
equivalent.
Number System
Conversion
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025

Binary to Decimal

By the positional notation of binary to decimal


conversion, we multiply every digit in the binary
number with its base raised to the power based on
its position. This is done by starting from the
rightmost digit and moving on to the left and
summing up all the values.
Number System
Conversion
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025

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)

Find a line of up to four binary numbers to convert. Binary numbers


can only be 1 and 0. Hexadecimal numbers can be 0-9, or A-F, since
hexadecimal is base-16. You can convert any binary string to
hexadecimal (1, 01, 101101, etc.), but you need four numbers to
make the conversion (0101→5; 1100→C, etc.)

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

Hex to Decimal Table


Number System
Conversion
CS 106 – COMPUTER ARCHITECTURE AND ORGANIZATION BOBET REYES LANTO 1st SEMESTER CY 2024-2025

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

End of Lesson 2 Part 1


Number System

You might also like