You are on page 1of 19

ASSIGNMENT 2

MICRO-
PROCESSOR
BSCPE-3A

AERON L. ALMOSARA
WHAT IS NUMBER
REPRESENTATION
SYSTEM?
A number representation system, also known as a
numeral system, is a system of representing
numbers using symbols or digits. Different number
representation systems are used in different parts
of the world and in different fields of study, such
as mathematics, computer science, and
engineering.
The most commonly used number representation
system is the decimal system, which uses ten digits
(0, 1, 2, 3, 4, 5, 6, 7, 8, 9) to represent all numbers.
Other number representation systems include
binary (base 2), octal (base 8), hexadecimal (base
16), and Roman numerals.
Each digit in a number representation system has
a positional value based on its position within the
number. For example, in the decimal system, the
digit in the ones place has a value of 1, the digit in
the tens place has a value of 10, the digit in the
hundreds place has a value of 100, and so on.
HOW TO CONVERT THE
FOLLOWING:

Here are the steps to convert numbers between


different number representation systems:
a. Decimal to Binary:
Divide the decimal number by 2 and write
down the remainder (0 or 1).
Divide the quotient by 2 and write down the
remainder.
Repeat the process until the quotient becomes
0.
Write the remainders in reverse order to get
the binary equivalent.
Example: Convert decimal number 25 to binary.
25 divided by 2 = 12 remainder 1
12 divided by 2 = 6 remainder 0
6 divided by 2 = 3 remainder 0
3 divided by 2 = 1 remainder 1
1 divided by 2 = 0 remainder 1
The binary equivalent of 25 is 11001.
HOW TO CONVERT THE
FOLLOWING:

b. Decimal to Octal:
Divide the decimal number by 8 and write
down the remainder (0 to 7).
Divide the quotient by 8 and write down the
remainder.
Repeat the process until the quotient becomes
0.
Write the remainders in reverse order to get
the octal equivalent.
Example: Convert decimal number 134 to octal.
134 divided by 8 = 16 remainder 6
16 divided by 8 = 2 remainder 0
2 divided by 8 = 0 remainder 2
The octal equivalent of 134 is 206.
HOW TO CONVERT THE
FOLLOWING:

c. Decimal to Hexadecimal:
Divide the decimal number by 16 and write
down the remainder (0 to 9 and A to F for
values 10 to 15).
Divide the quotient by 16 and write down the
remainder.
Repeat the process until the quotient becomes
0.
Write the remainders in reverse order to get
the hexadecimal equivalent.
Example: Convert decimal number 443 to
hexadecimal.
443 divided by 16 = 27 remainder 11 (B in
hexadecimal)
27 divided by 16 = 1 remainder 11 (B in
hexadecimal)
1 divided by 16 = 0 remainder 1
The hexadecimal equivalent of 443 is 1BB.
HOW TO CONVERT THE
FOLLOWING:

d. Binary to Decimal:
Write down the binary number.
Multiply each digit by the corresponding power
of 2 (from right to left starting with 2^0).
Add the products to get the decimal
equivalent.
Example: Convert binary number 11011 to decimal.
1 x 2^4 + 1 x 2^3 + 0 x 2^2 + 1 x 2^1 + 1 x 2^0 =
16 + 8 + 0 + 2 + 1 = 27.
e. Binary to Octal:
Divide the binary number into groups of three
digits (starting from the right) and write down
the equivalent octal digit for each group.
If the leftmost group has fewer than three
digits, add zeros to the left to make it a three-
digit group.
Example: Convert binary number 11011 to octal.
011 011 -> 33 in octal.
The octal equivalent of 11011 is 33.
HOW TO CONVERT THE
FOLLOWING:

e. Binary to Octal: To convert a binary number to


octal, you can group the binary digits into sets of
three, starting from the rightmost digit. If
necessary, add zeros to the leftmost group to make
it a complete set of three digits. Then, replace each
set of three digits with its octal equivalent.
For example, let's convert the binary number
1011101 to octal:
1. Group the digits into sets of three: 1 011 101
2. Add a zero to the leftmost group to make it a
complete set of three digits: 001 011 101
3. Replace each set of three digits with its octal
equivalent: 1 3 5 So the octal representation of
1011101 is 135.
HOW TO CONVERT THE
FOLLOWING:

f. Binary to Hexadecimal:
Divide the binary number into groups of four
digits (starting from the right) and write down
the equivalent hexadecimal digit for each
group.
If the leftmost group has fewer than four
digits, add zeros to the left to make it a four-
digit group.
Example: Convert binary number 11011 to
hexadecimal.
0001 1011 -> 1B in hexadecimal.
The hexadecimal equivalent of 11011 is 1B.
HOW TO CONVERT THE
FOLLOWING:

g. Octal to Decimal: To convert an octal number to


decimal, you can follow these steps:
1. Write down the octal number.
2. Assign each digit a positional value based on
its position in the number (starting from the
rightmost digit).
3. Multiply each digit by its positional value.
4. Add up the products from step 3 to get the
decimal number.
For example, let's convert the octal number 345 to
decimal:
1. 345
2. Digit 5 is in the 8^0 position, digit 4 is in the
8^1 position, and digit 3 is in the 8^2 position.
3. Multiply each digit by its positional value:
5x8^0 + 4x8^1 + 3x8^2 = 229 So the decimal
representation of 345 is 229.
HOW TO CONVERT THE
FOLLOWING:

h. Octal to Binary: To convert an octal number to


binary, you can replace each octal digit with its
binary equivalent.
For example, let's convert the octal number 67 to
binary:
1. 67
2. 6 in binary is 110, and 7 in binary is 111.
3. So the binary representation of 67 is 110111.
i. Octal to Hexadecimal: To convert an octal
number to hexadecimal, you can first convert the
octal number to binary and then convert the binary
number to hexadecimal.
For example, let's convert the octal number 763 to
hexadecimal:
1. Convert the octal number to binary: 763 in
octal is 111110011 in binary.
2. Convert the binary number to hexadecimal: 1111
1001 1 in binary is F9 in hexadecimal. So the
hexadecimal representation of 763 is F9.
HOW TO CONVERT THE
FOLLOWING:

3. 11 in hexadecimal is equivalent to 17 in decimal.


4. Multiply each digit by its positional value:
6x16^0 + 17x16^1 + 2x16^2 = 694 So the decimal
representation of 2B6 is 694.

j. Hexadecimal to Decimal: To convert a


hexadecimal number to decimal, you can follow
these steps:
1. Write down the hexadecimal number.
2. Assign each digit a positional value based on
its position in the number (starting from the
rightmost digit).
3. Replace any letters with their decimal
equivalent (A = 10, B = 11, C = 12, D = 13, E =
14, F = 15).
4. Multiply each digit by its positional value.
5. Add up the products from step 4 to get the
decimal number.
HOW TO CONVERT THE
FOLLOWING:

For example, let's convert the hexadecimal


number 2B6 to decimal:
1. 2B6
2. Digit 6 is in the 16^0 position, digit B (11) is in
the 16^1 position, and digit 2 is in the 16^2
position.
3. 11 in hexadecimal is equivalent to 17 in
decimal.
4. Multiply each digit by its positional value:
6x16^0 + 17x16^1 + 2x16^2 = 694 So the
decimal representation of 2B6 is 694.
HOW TO CONVERT THE
FOLLOWING:

k. Hexadecimal to Binary: To convert a


hexadecimal number to binary, you can replace
each hexadecimal digit with its 4-bit binary
equivalent.
For example, let's convert the hexadecimal
number A3B to binary:
1. A3B
2. A in binary is 1010, 3 in binary is 0011, and B
in binary is 1011.
3. So the binary representation of A3B is
101000111011.
HOW TO CONVERT THE
FOLLOWING:

l. Hexadecimal to Octal: To convert a hexadecimal


number to octal, you can first convert the
hexadecimal number to binary and then convert
the binary number to octal.
For example, let's convert the hexadecimal number
1DE to octal:
1. Convert the hexadecimal number to binary:
1DE in hexadecimal is 0001 1101 1110 in binary.
2. Convert the binary number to octal: 001 110 111
110 in binary is 1676 in octal. So the octal
representation of 1DE is 1676.
ARITHMETIC OPERATION
OF NUMBER SYSTEM

a. Addition of Number System: To add two


numbers in any number system, we can follow the
same process as in decimal system, which is to add
the digits in each place value, and if the sum is
greater than or equal to the base of the number
system, we carry over the excess to the next place
value.
For example, let's add the numbers 1011 and 1101 in
binary:

1 0 1 1
+ 1 1 0 1
---------
10 0 0 0
So the sum of 1011 and 1101 in binary is 10000.
ARITHMETIC OPERATION
OF NUMBER SYSTEM

b. Subtraction of Number System: To subtract two


numbers in any number system, we can follow the
same process as in decimal system, which is to
subtract the digits in each place value, and if the
difference is negative, we borrow from the next
place value.
For example, let's subtract the numbers 1011 from
1101 in binary:

1 1 0 1
- 1 0 1 1
-----------
1 0 1 0

So the difference between 1101 and 1011 in binary is


1010.
ARITHMETIC OPERATION
OF NUMBER SYSTEM

c. Multiplication of Number System: To multiply


two numbers in any number system, we can follow
the same process as in decimal system, which is to
multiply the digits in each place value, and then
add the products, carrying over the excess to the
next place value as needed.
For example, let's multiply the numbers 1011 and
1101 in binary:

1 0 1 1
X 1 1 0 1
-----------
1 0 1 1
0 0 0 0 .
+ 1 0 1 1 ..
-------------
1 1 1 0 1 1
ARITHMETIC OPERATION
OF NUMBER SYSTEM

So the product of 1011 and 1101 in binary is 111011

d. Division of Number System: To divide two


numbers in any number system, we can follow the
same process as in decimal system, which is to
perform long division. We divide the dividend by
the divisor, and if the quotient is not an integer, we
can continue with long division to obtain the
quotient and remainder.
For example, let's divide the numbers 1011 by 11 in
binary:
ARITHMETIC OPERATION
OF NUMBER SYSTEM

1 0
11 | 1 0 1 1
1 1
-----
1 1
1 1
---
0

So the quotient of 1011 divided by 11 in binary is 11


with a remainder of 0.

You might also like