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

Introduction To Computing - Module 4 - Number Systems

Uploaded by

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

Introduction To Computing - Module 4 - Number Systems

Uploaded by

ItchyDitchy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 72

INTRODUCTION TO

COMPUTING
MBER SYSTEMS
MODULE 4

NUMBER SYSTEMS
• To define different number system and its applications
• To convert different number bases
• To compute for the sum and difference of binary,
octal, and hexadecimal numbers
• The study of number system will help us gain better
understanding of how computers perform computation.
• Binary number is the true language of computer since it is
operated into two state.
• The radix, or base, of
a number system is
the total number of
unique symbols
available in that
system.
• The largest valued
symbol always has a
magnitude of one less
than the radix.
• Decimal notation is the writing of numbers in the
base-ten numeral system, which uses various
symbols (called digits) for ten distinct values (0, 1, 2,
3, 4, 5, 6, 7, 8 and 9) to represent numbers.
• These digits are often used with a decimal separator
which indicates the start of a fractional part, and with
one of the sign symbols + (plus) or − (minus) to
indicate sign.
• The decimal system is a positional numeral system; it
has positions for units, tens, hundreds, etc.
• The position of each digit conveys the multiplier (a
power of ten) to be used with that digit—each position
has a value ten times that of the position to its right.
• The binary system works in exactly the same way, except
that its place value is based on the number two.
• In the binary system, we have the one's place, the two's
place, the four's place, the eight's place, the sixteen's
place, and so on.
• Each place in the number represents two times (2X's) the
place to its right.
• Binary number system has a base, or radix, of 2. Binary
numbers are composed of two symbols: 0 and 1.
Decimal Binary
0 0000 8 + 2 = 10
1 0001
2 0010
8 4 2 1
3 0011
4 0100 1010
5 0101
6 0110
Considering the digits that
7 0111
has a value of 1 and adding
8 1000
it number marker on the top
9 1001
10 1010
of each digits
• The octal number system has a base, or radix, of 8.
• Octal numbers are composed of eight symbols: 0, 1, 2,
3, 4, 5, 6, and 7.
• The hexadecimal number system has a base, or radix,
of 16. Hexadecimal numbers are composed of sixteen
symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F.
• Symbols A to F correspond to decimal numbers 10 to
15.
• Binary to Decimal , Octal, Hexadecimal
• Decimal to Binary, Octal, Hexadecimal
• Octal to Decimal, Binary, Hexadecimal
• Hexadecimal to Binary, Octal, Decimal
• Remember that Binary numbers are based on the radix of 2
while Decimal numbers are based on the radix of 10.
• Remember also that binary will only be represented in 1s and
0s.
• Steps in converting Binary to Decimal:
• Place a number marker on the top of the given digits, starting from 0 up
the last given digits—starting from the right to determine the exponent
to use.
• Consider all the 1s in the given digits and multiply it with the base
number of the given digits (which is base 2) and raised it with power of
the number corresponded in the number marker you placed on the top
of the given digits.
Place the number
1010102 = ?10 marker on the top of the
given digits, starting from
the right, starting from 0
5 4 3 2 1 0 up to the last given digit
= 101010 on the left.

= 1*25 + 1*23 + 1*21

= 32 + 8 + 2

= 4210
101.012 = ?10 1*2-2 will be
converted into 1*2½
which results into 0.25
If dealing with fraction in because you will be
binary the marker will
start at the right side of
= 101.01 dividing 1 / 4 which
comes from 1*2½
the decimal point and
starting with the -1 up to
the last given digit.
= 1*22 + 1*20 + 1*2-2

= 4 + 1 + 0.25

= 5.2510
• Since one octal digit is equivalent to three binary
digits, just group three binary digits, starting from the
least significant bit (right side).
• Append 0 to the most significant bit (left side), if the
grouping does not have enough to form three binary
digits.
• In short, you must complete the grouping of three
digits.
• If you will be having a fraction (decimal point), append
0 to the least most significant bit (right side) of the
given digits to complete the grouping of three bits.
• Steps in converting Binary to Octal:
• Group the given digits in three starting from the right
side.
• If the grouping is not complete, place 0 to complete the
grouping.
• Once you have grouped it into three digits, you starting
converting the binary digits into decimal values following
the concepts of binary digits (4, 2, 1) starting from the
right.
11010102 = ?8
3rd group 2nd group 1st group

Add 0 to the left, to


= 001 101 010
complete the
grouping 4 2 1 4 2 1 4 2 1
= 001 101 010
Simply add all
the number
= 1 5 28 markers
considering the
binary digits that
= 1528 has 1 on it.
1101.012 = ?8
2nd group 1st group 1st group
= 001 101 . 010
Add 0 to the right,
to complete the
grouping for the 4 2 1 4 2 1 4 2 1
fractional part of = 001 101 . 010
the given binary
Simply add all the
= 1 5 . 28 number markers
considering the
binary digits that
has 1 on it.
= 15.28
• Since one hexadecimal digit is equivalent to four
binary digits, just group four binary digits, starting
from the least significant bit (right side).
• Append 0 to the most significant bit (left side), if the
grouping does not have enough to form four binary
digits.
• In short, you must complete the grouping of four
digits.
• If you will be having a fraction (decimal point), append
0 to the least most significant bit (right side) of the
given digits to complete the grouping of three bits.
• Steps in converting Binary to Hexadecimal:
• Group the given digits in four starting from the right side.
• If the grouping is not complete, place 0 to complete the
grouping.
• Once you have grouped it into three digits, you starting
converting the binary digits into decimal values following
the concepts of binary digits (8, 4, 2, 1) starting from the
right.
11010102 = ?16
2nd group 1st group Simply add all the
= 0110 1010 number markers
considering the
Add 0 to the left, to binary digits that
8 4 21 8 4 2 1 has 1 on it.
complete the
grouping = 0110 1010

= 6 A16

= 6A16
1101.012 = ?16
Simply add all
1st group 1st group the number
= 1101 . 0100 markers
Add 0 to the right, considering the
to complete the binary digits
8 4 2 1 8 4 2 1
grouping that has 1 on it.
= 1101 . 0100

= D . 416

= D.416
• Converting a decimal number to a binary number is
done by successively dividing the decimal number by
2 on the left side of the radix.
• If you will have a fractional part of the given decimal,
successively multiplying the decimal number by 2 on
the right side of the radix.
• Steps in converting Decimal to Binary:
• Divide the given decimal number with the base number
you are converting it to, which is 2.
• Whatever the answer you will get in the division will be
divided again with the base (2) until you cannot divide the
answer anymore with 2.
• The remainder that you will get will be the one you
consider as your converted answer.
Remainder of the division, will
610 = ?2 only have two values since it is in
base 2, meaning you can only
have 1 or 0 as a remainder.

= 1102
remainder

= 6/2 0 In reading the


= 3/2 1 answer, you
should read it
= 1/2 1 upward.

= 0/2
6.62510 = ?2
You will be multiplying
only the decimal
numbers with base 2
= 110.1012 until you reach 0 in the
decimal place.

= .625*2
= 1.25*2 1 In reading the
= 0.25*2 0 answer, you
should read it
= 1.0 Stop here, because it
is already 0
1 downward.
• Converting a decimal number to an octal number is
done by successively dividing the decimal number by
8 on the left side of the radix.
• If you will have a fractional part of the given decimal,
successively multiplying the decimal number by 8 on
the right side of the radix.
Steps in converting Decimal to Octal:
• Divide the given decimal number with the base number
you are converting it to, which is 8.
• Whatever the answer you will get in the division will be
divided again with the base (8) until you cannot divide the
answer anymore with 8.
• The remainder that you will get will be the one you
consider as your converted answer.
6610 = ?8
Remainder of the division, will
only have 0-7 values since it is in
= 1028 base 8

remainder
= 66/8 2 In reading the
answer, you
= 8/8 0 should read it
= 1/8 1 upward.

= 0/8
66.62510 = ?8 You will be multiplying
only the decimal
numbers with base 8
until you reach 0 in the
= 102.58 decimal place.

= .625*8 In reading the


Stop here, because it answer, you
= 5. 0 is already 0 5 should read it
downward.
• Converting a decimal number to a hexadecimal
number is done by successively dividing the decimal
number by 16 on the left side of the radix
• If you will have a fractional part of the given decimal,
successively multiplying the decimal number by 16 on
the right side of the radix.
Steps in converting Decimal to Hexadecimal:
• Divide the given decimal number with the base number
you are converting it to, which is 16.
• Whatever the answer you will get in the division will be
divided again with the base (16) until you cannot divide
the answer anymore with 16.
• The remainder that you will get will be the one you
consider as your converted answer.
Remainder of the division, will only
28610 = ?16 have 0-9, A-F values since it is in
base 16

= 11E16 In reading the


remainder answer, you should
read it upward.
= 286/16 14
= 17/16 1 The value 14
should be
= 1/16 1 converted to
= 0/16 hexadecimal
format
286.62510 = ?16
You will be multiplying
only the decimal
= 11E.A16 numbers with base 8
until you reach 0 in the
decimal place.
= .625*16 In reading the
= 10.0 Stop here, because
it is already 0
10 answer, you
should read it
downward.
• Remember that Octal numbers are based on the radix of 8
while Decimal numbers are based on the radix of 10.
• Remember also that Octal will only be represented with
value 0-7.
• Steps in converting Octal to Decimal:
• Place a number marker on the top of the given digits, starting
from 0 up the last given digits—starting from the right to
determine the exponent to use.
• Considering all the given digits, multiply it with the base
number of the given digits (which is base 8) and raised it with
power of the number corresponded in the number marker
you placed on the top of the given digits.
Place the number
7618 = ?10 marker on the top of the
given digits, starting from
2 1 0 the right, starting from 0
up to the last given digit
= 761 on the left.

= 7*82 + 6*81 + 1*80


= 448+ 48 + 1

= 49710
761.188 = ?10 1*2-2 will be converted
into 1*2½ which results into
If dealing with fraction in 0.25 because you will be
2 1 0 -1 -2
octal, the marker will dividing 1 / 4 which comes
start at the right side of = 761.15 from 1*2½
the decimal point and
starting with the -1 up to
the last given digit. = 7*82 + 6*81 + 1*80 + 1*8-1 + 8*8-2
= 56+48+1+0.125+0.125

= 761.2510
Since one octal digit is equivalent to three binary digits,
just convert the individual octal digit into three binary
digits.
Steps in converting Octal to Binary:
• Convert each of the given octal number by simply using
the concept of (4, 2, 1).
• Place a binary 1 to correspond the given octal number.
7618 = ?2 Simply add all the
number markers
4 21
considering the binary
= 7 111 digits that has 1 on it, to
get the octal number
4 21 given.
= 6 110
4 2 1
= 1 001

= 111 110 0012


761.258 = ?2
4 21 4 21 4 2 1 4 2 1 4 2 1
= 111 110 001 . 010 101
7 6 1 2 5

= 111 110 001.0101012


• When converting an octal digit to a hexadecimal digit,
you must first convert the octal number to binary
number and group it by four and convert the grouped
digits to hexadecimal by using the concept of (8, 4, 2,
1).
• If the digits is not enough to form a grouping of four
then append 0 on the left side of the digits.
• If the given octal have fraction, then append 0 on the
right side of the given digits.
Steps in converting Octal to Hexadecimal:
• Convert the octal digits in binary by considering each
given digits and represent it in binary using the concept
(4, 2, 1).
• Once it is in binary, that’s the time you convert the binary
into hexadecimal, by grouping it into four.
7618 = ?16
7 6 1
= 111 110 001
1 F 1
= 0001 1111 0001

= 1F116
761.758 = ?16
7 6 1 7 5

= 111 110 001 . 111 101


1 F 1 F 4
= 0001 1111 0001 . 1111 0100

= 1F1.F416
• Since one hexadecimal digit is equivalent to four
binary digits, just convert the individual hexadecimal
digit into four binary digit
7AE316 = ?2

= 7 0111
A 1010
E 1110
3 0011

= 0111 1010 1110 00112


7AE.316 = ?2

= 7 0111
A 1010
E 1110
3 0011

= 0111 1010 1110 . 00112


• When converting a hexadecimal digit to an octal digit,
you must first convert the hexadecimal number to
binary number and group it by three and convert the
grouped digits to octal by using the concept of (4, 2,
1).
• If the digits is not enough to form a grouping of three
then append 0 on the left side of the digits.
• If the given hexadecimal have fraction, then append 0
on the right side of the given digits.
Steps in converting Hexadecimal to Octal:
• Convert the hexadecimal digits in binary by considering
each given digits
• Once converted to binary group the binary into three and
using the concept (4, 2, 1).
7AE316 = ?8

= 7 0111
A 1010
E 1110
3 0011
7 5 3 4 3
= 0 111 101 011 100 0112

= 753438
7AE.316 = ?8
= 7 0111
A 1010
E 1110
3 0011
= 0111 1010 1110 . 00112
3 6 5 6 1 4
= 011 110 101 110 . 001 1002

= 3656.148
• Each hexadecimal position is weighted with a power
of 16.
• Digits on the left side of the radix point has a positive
exponent while on the right side of the radix point has
a negative exponent.
• Converting a hexadecimal number to a decimal
number is done by successively multiplying the
decimal number by 16 on the left side of the radix
• If you will have a fractional part of the given decimal,
successively multiplying the decimal number by 16 on
the right side of the radix.
Steps in converting Hexadecimal to Decimal:
• Place a number marker on the top of the given number
for determining the exponent to be used.
• Get the individual digit and multiply it by the base number
(16) and raised it with the exponent corresponds to the
number marker you place on each digit, then to the
addition operation.
286A16 = ?10
3 2 1 0
= 286A

= 2*163 + 8*162 + 6*161 + A*160

= 1034610
286.A16 = ?10
2 1 0 -1
= 286.A

= 2*162 + 8*161 + 6*160 + A*16-1

= 646. 62510
Rules: Examples: 1 111 1
0+0=0 11011
11 1 1
0+1=1 11011 10101
1+0=1 + 1001 + 1001
1 + 1 = 0 carry 1 100100 111001
Rules: Example: Example:
0-0=0 2 1
002 02 2
0 - 1 = 1 (borrow 2) 11011 10001
1-0=1 + 1101 + 1101
1-1=0 1110 100
The are other ways of subtracting Binary Number:
• 1's complement
• Done by inverting the binary digits (e.g. 1 becomes 0, 0
becomes 1) in the subtrahend.
• 2's complement
• Done by finding the 1’s complement of a binary number in the
subtrahend then add 1.
• Generally used because it will only have one representation of a
value 0 compare to 1’s complement.
1's complement 2's complement

111001012 111001012
000110102 000110102
+ 12
000110112
Steps:
Using 1's complement 1. Find the 1’s complement
of the subtrahend.
1 1 11 The final carry 2. Change the subtraction
11011012 11011012 will be added to
operation to addition.
get the correct
- 110012 + 11001102 difference of
3. Solve for the sum of the
1 1
the two binary binary numbers.
The subtraction 10100112 numbers. 4. Add the final carry to the
operator becomes
addition + 12 computed sum to get the
correct difference.
10101002
You must make sure
that the number of
digits in the
subtrahend and
minuend are the same.
Steps:
Using 2's complement 1. Find the 2’s complement of the
The final carry
subtrahend.
is discarded. 1 1 11 11
2. Change the subtraction
11011012 11011012 operation to addition.
- 110012 + 11001112 3. Solve for the sum of the binary
numbers.
The subtraction 10101002 4. Discard the final (excess) carry.
operator becomes
addition
**The computed sum of the
original minuend and the 2’s
You must make sure
complement of the subtrahend
that the number of
digits in the minuend
is the difference.
and subtrahend are the
same.
Adding octal numbers are just like adding decimal
numbers. But when the sum is greater than 7, you must
make sure that you convert it to octal number first.

Note that Octal numbers are 0, 1, 2, 3, 4, 5, 6, 7, 10, 11….


Examples:
111
4 + 6 = 10, since 10 is greater
543 744 than 7, we have to
+ 14 + 56 convert it to its octal
equivalent
557 1022
10 ÷ 8 = 1 remainder 2, the
remainder will be
written as part of the
sum and the quotient
will be carried over
Subtraction of Octal numbers also follow how
subtraction of Decimal numbers is, but instead of
borrowing 10, you must borrow 8 from the next higher
significant digit.
Borrowed 8 from 5 Borrowed 8 from 2,
8+3=11
48 5 8 1 11
50258 60238
- 1128 - 41158
47138 17068
Addition and subtraction of Hexadecimal Numbers are
just like how we did with Octal Numbers, the same rules
in carrying and borrowing is applied, but note that the
base of Hexadecimal Numbers is 16.

Hexadecimal numbers are: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B,


C, D , E, F, 10, 11, 12….
1 Note that A = 10,
7 9 B 2 16 2 + 10 = 12,
+ 3 1 9 A In Hexadecimal, 12 is C
16
A B 4 C 16 B = 11,
11 + 9 = 20, 20 is greater than
15 so we need to
convert it to
Hexadecimal
20 ÷ 16 = 1 remainder 4, 4
becomes part of the
sum and 1 is carried.
Borrow 16 from 8 Borrow 16 from 1,
16 16 + 3 = 19
7 0 19
8 1 3 F16 Note that F = 15,
- 4 B 216 15 - 2 = 13,
in Hexadecimal, 13 is D
7 C 8 D16
• Docter, Q., Dulaney, E., & Skandier, T. (2016). CompTIA
+ Complete Study Guide (3rd Edition)
• Meyers, M. (2016). All In One CompTIA A+ Certification.
Mc Graw Hill.
• Pearson. (2016). Introduction to Computers and
Information Technology. Upper Saddle River, NJ:
Pearson.
• Tavani, H. T. (2016). Ethics and Technology. Wiley.
• White, R. (2015). How Computer Work: The Evolution of
Technology. IN: Que.

You might also like