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

Computer Number System and Its Types

Uploaded by

Rayray Ahmad II
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Computer Number System and Its Types

Uploaded by

Rayray Ahmad II
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

Computer Number

System and its Types

Electronic devices, such as the computers, only understands ON and


OFF, represented by 1 and 0, respectively. Therefore, we have to
translate our instructions (i.e. characters, numbers, files, etc.) in the form
of 0s and 1s, we call these the Binary Digits (or bit).

The Binary Number System is just one of the number systems that we
need to learn in order to be able to understand the “language” of
computers.
Computer Number
System and its Types
Using the table below, create an equivalent “8-bit data” by using a series of 0s and 1s, for instance, 0
is represented by 00000000 and 2 is represented by 00000010. (You may change this representation
as you wish). Make sure that no data must be the same for any of the characters.

0 00000000 7 E L S

1 00000001 8 F M T

2 9 G N U

3 A H O V

4 B I P W

5 C J Q X

6 D K R Y
Computer Number
System and its Types
Use your translation table above write the equivalent binary digit equivalent of your
firstname. If your name is more than ten (10) characters long, you can choose to
write in your nickname or a short-cut name. Write the age (2 characters) after your
name (see example below). You can leave the rest of the characters blank.
Computer Number
System and its Types
The number system is a technique used to represent numbers in the computer
system architecture, every value that you are saving or getting into/from computer
memory has a defined number system. The computer system architecture supports
the following number systems:

Figure 1.9. Summary details of the different Base Number Systems


Computer Number System
and its Types
The table below shows an example of a data representation based on the number system and
how it is used as assignment statements in C Language. You will know more about assignment
statements in the succeeding topics.

Number System Example C Language assignment

Binary (10101010)2 int val=10101010;

Octal (252)8 int val=0252;

Decimal (170)10 int val=170;

Hexadecimal (AA)16 int val=0xAA;

To determine the number system that the current data represents, a subscript of the base is indicated. As
shown above, (252)8 means that 252 is an octal number (Base 8) while (170)10 means that 170 is a
decimal number (Base 10). This is very important to remember as we move along to converting one
number system to the other or computing using different number systems.
Computer Number
System and its Types

Number System Conversions

In computer architecture, various components such as memory and resgisters


process data in a certain format following different number systems. To be able to
understand these data in various representations, conversions between number
system is needed. The following are three (3) major ways to do conversion:

Decimal Number System to Other Base Number Systems


Other Base Number Systems to Decimal Number System
Other Base Number Systems to Other Base Number Systems
Computer Number
System and its Types
Decimal Number System to Other Base Number System

The following steps allow you to convert Decimal number system to other base number
systems convert a number system:

1. Divide the given number (i.e. Decimal Number) by the base of target base number
system, that is 2 for Binary (Base 2), 8 for Octal (Base 8), and 16 for Hexadecimal
(Base 16) number system.
2. Write the remainder from step 1.
3. Use the quotient as the new number and repeat step 1 until quotient is 0. The first
remainder is considered as the Least Signification Bit (LSB) and the last as a Most
Significant Bit (MSB).
4. Once the quotient is 0, write data representation from MSB to LSB.
Computer Number
System and its Types
The example below shows the application of the steps above converting the decimal
number 2010 to binary, octal, and hexadecimal.

Decimal to Binary
Computer Number
System and its Types
Decimal to Octal

Decimal to Hexadecimal
Computer Number
System and its Types
Other Base Number System to Decimal Number System

The following steps allow you to convert from any other base number systems to
Decimal number system:

1. Determine the base value of the given number and the position of digits from LSB to
MSB. Note that the LSB is at position 0, next digit’s position is 1, next is 2, and so
on.
2. Multiple the digit and the base value with the position as an exponent.
3. Add the results of the products from step 2.

We will use the result of the previous examples, that is, 101002, 248, and 14 16 to
convert to decimal number and validate our results. Hint: It should arrive to the
same value, 2010 .
Computer Number
System and its Types
Computer Number
System and its Types
Computer Number
System and its Types
Other Base Number System to Other (Non-Decimal) Number System

Since you already know how to convert to and from Decimal numbers, the following steps may be easily applied for
conversions in between other base number systems:

1. Convert the given base number to decimal number.


2. Convert the decimal number to the target base number.

Once again, we will use the results of the previous examples in converting binary and octal numbers, 10100 2
and 24 8 respectively, to hexadecimal number.
Computer Number
System and its Types
Computer Number
System and its Types
Shortcut Method to Convert Octal and Hexadecimal Numbers to/from Binary Numbers

We now know from the wys in converting in between base number systems may be done by initially
converting the number to decimal value. In the language of binary digits, octal numbers is just a series
of 3-bit data while hexadecimal numbers, a series of 4-bit data. Refer to the details in Table 1.4.
Computer Number
System and its Types
Shortcut Method to Convert Octal and Hexadecimal Numbers to/from Binary Numbers

We now know from the wys in converting in between base number systems may be done by initially
converting the number to decimal value. In the language of binary digits, octal numbers is just a series
of 3-bit data while hexadecimal numbers, a series of 4-bit data. Refer to the details in Table 1.4.
Computer Number
System and its Types
Computer Number
System and its Types
Computer Number
System and its Types
Arithmetic Operation

Internally, in the Arithmetic Logic Unit (ALU), the CPU of a computer performs computations to
process inputs and generate the necessary outputs. To perform arithmetic operation with number
systems, numbers to be added or subtracted must be of the same number base. If numbers are of
different bases, one must be converted to the other to make their bases the same.

To make addition and subtraction easier with number system, it is much better to just consider
the numbers as decimal.

Addition with number system

In performing addition, the condition below must be applied:

If the sum is equal or greater than the base of the numbers being added, subtract the value of
the base from the sum and add one (1) to the next higher digit(carry).
Computer Number
System and its Types
Computer Number
System and its Types
Computer Number
System and its Types
Computer Number
System and its Types
Subtraction with number system

With this method of subtraction, the minuend must be greater than the subtrahend. It is
impossible to subtract a bigger value from a smaller value.

Subtraction is done by first arranging the numbers in the column in such a way that the digits
of the same place are in the same column. Starting from the least significant digit, subtract the
subtrahend from the minuend. If the minuend is less than the subtrahend, 10n is being
borrowed from the next higher digit.

Since subtraction is being performed with different number system, 10n is still being borrowed
but with different value. For binary for example, 10 2 is 2 in decimal. 108 is 8 in decimal.

If 10n is borrowed, add its equivalent to the minuend. Subtract the subtrahend from the
minuend just like performing decimal subtraction.
Computer Number
System and its Types
Computer Number
System and its Types
Computer Number
System and its Types
Computer Number
System and its Types
ACTIVITY
Part I. Convert the given values below to other base number systems. Specify on the space after
“Convert to:” the name of the number system you want to convert. And write your final answer on the
space after “Converted Value:”. Show your solution on the space provided for each conversion.
Computer Number
System and its Types
Part II. Perform the following operations and write your solution on the space provided for. You can
choose which of the given values you want to convert to perform the operation. Show the final output
in all the base number systems.

You might also like