You are on page 1of 25

Information Sheet N0.

Lesson 2 NUMBER SYSTEMS

Introduction:
This lesson contains the discussion of different number systems and
its significance. Learners will also encounter how to convert one number
system to another.

Learning Outcome:
At the end of the lesson, the learners should be able to determine the
place value of each digit in a number system and to convert one number
system to another.

Information/Content:

1. )Decimal Number System


 Is a way of writing numbers.
 Any number ,from huge quantities to tiny fractions using only the ten
basic symbols 0,1,2,3,4,5,6,7,8,9.
 The word decimal comes from the word decem ,the latin word for ten. It
is a base ten system.
 It is also called Hindu-Arabic System, which was developed by a Hindu
mathematician in India more than thousand of years ago.
The value of the symbols depends on the place it occupies.
Ex.
a.)7392= 7 thousands plus 3 hundreds plus 9 tens plus 2 ones
=7X 103 + 3X102 + 9X101 +2 X100
b.) 542.25= 5 hundreds plus 4 tens + 2 ones plus 2 tenths plus 5 hundredths
= 5X102 + 4X101 + 2X100 + 2X10-1 + 5X10-5

Applications of Decimal System.


1.))used in dealing with money, weight, length, counting etc.
2.) If the Base value of a number system is 10, then it is called Decimal
number system which has most important role in the development of
science and technology. This is the weighted (or positional) number
representation, where value of each digit is determined by its position (or
their weight) in a number

2.) Binary Number System


 A method of representing numbers in which only two digits 0 and 1
are used.
 A system based on powers of 2, in contrast to decimal system which is
based on powers of ten.
 The successive units are powers of 2.

Place Value of Binary Number Systems

Examples:
a.)11101 = 1X24 + 1x23 1x22 + 0x21 +1 X 20

b.)11010.11= 1x24 +1x23 +0x22 +1x21 +0x20 +1x2-1 +1x2-2


Applications of Binary Number System:
1.)used in computer technology. All computer language and programming is
based on the 2-digit number system used in digital encoding. Digital Encoding
is the process of taking data and representing it with discreet bits of
information.
2.)The binary number system is an alternative to the decimal (10-base) number
system that we use every day. Binary numbers are important because using
them instead of the decimal system simplifies the design of computers and
related technologies.

Why do we need to convert the decimal value to binary numbers?


Computers use voltages and since voltages changes often, no specific voltage is
set for each number in the decimal system. For this reason, binary is measured
as a two-state system i.e. on or off. Also, to keep calculations simple and
convert into binary online, computers use the binary number system.

Conversion of Number Systems:

1.)Conversion from decimal to binary


 The Conversion is done by separating the integer part of the number
from the fractional part of the number. The integer part of the number
are those numbers to the left of the decimal point while the fractional
part are those numbers to the right of the decimal point.
Ex. 673.23_____________673 is the integer part while .23 is the
fractional part.

Ex. Convert the decimal number 41 to binary.


Steps: a.) Divide the integer part of the number by 2 and then write the
remainder.
Q= 41/2 = 20 R=1
b.) Divide the quotient from step 1 by 2 and then write the
remainder.
Q = 20/2 =10 R=0
c.)Divide the quotient from step 2 by 2 and then write the
remainder.
Q= 10/2 =5 R=0
d.) Repeat the process of dividing the quotient in each step by 2
then write the remainder until the quotient becomes zero.
Q=5/2=2 R=1
Q= 2/2=1 R=0
Q=1/2= 0 R=1
e.) Read and write all the remainders starting from the bottom to
the top. The result is
the binary equivalent of the integer part of the decimal
number.
Answer= 101001
Therefore: the decimal 41 is equal to 101001 in binary.

2.) Conversion from Binary to Decimal


Ex.1 Convert 1011010 to decimal
Steps a.) Write each digit as a powers of two depending on its place value.
1011010= 1x26 +0X25 +1X24 + 1X23 +0X22 + 1X21 +0X20
b.) Multiply each digit of each place value.
1011010= 1X64 + 0X32 +1X16 +1X8 +0X4 +1X2 +0X1 : where 20=1
c.) Add all the products at step b
1011010=64+0+16+8++0+2+0
1011010 ( in binary) = 90 (in decimal)
Ex.2 Convert 11010.11 to decimal
Step a.) 11010.11 = 1X24 + 1X23 + 0X 22 +1X21 +0X20 + 1X2-1 +1X2-2
Step b.)11010.11 = 1X 16 +1X 8 +0X4 + 1X2 + 0X1 + 1X 0.5 + 1 X 0.25
Step c.) 11010.11 = 16+8 +0 +2 +0 + 0.5 + 0.25
Step d.) 11010.11( in binary) = 26.75 (in decimal)
Name:_____________________ Score:________________
Course /Year/Section:_________ Date: ________________

Self-Check No.2.1

NUMBER SYSTEMS

Direction:
1.)Convert the following decimal numbers to binary. Show your
solution/computation.
Decimal Binary
1.)1231 1.)
2.) 175.175 2.)
3.) 10000 3.)
4.) 225 4.)
5.)1998 5.)
2.) Convert the following binary numbers to decimal. Show your
solution/computation.
Binary Decimal
1.)101110 1.)
2.) 1110101.11 2.)
3.) 110110100 3.)
4.) 11.111111 4.)
5.) 111111.11 5.)

REFERENCES:
Digital Design ,2nd edition ,1991 , by M. Morris Mano
https://www.khanacademy.org>math
https://delightlylinux.wordpress.com
https://www.mathisfun.com>binary
OCTAL AND HEXADECIMAL NUMBER SYSTEMS

Introduction:

This lesson contains the discussion of Octal and Hexadecimal number


systems and its significance. Learners will also encounter how to convert from
binary , octal and hexadecimal number system.

Learning Outcome:
At the end of the lesson, the learners should be able to convert binary,
octal and hexadecimal and vice versa .

Information/Content:

1.)Octal Number System


 Is the base -8 number system and uses the digits 0 to 7.
 It is made from binary numerals by grouping consecutive binary digits
into groups of three starting from the binary point and proceeding to the
left and to the right .
 The corresponding octal digit is then assigned to each group.
 The octal numeral system, or oct for short, is the base-8 number system,
and uses the digits 0 to 7. Octal numerals can be made from binary
numerals by grouping consecutive binary digits into groups of three
(starting from the right).

Applications of Octal Number System.

Octal became widely used in computing when systems such as the


UNIVAC 1050, PDP-8, ICL 1900 and IBM mainframes employed 6-bit,
12-bit, 24-bit or 36-bit words. Octal was an ideal abbreviation of binary
for these machines because their word size is divisible by three (each
octal digit represents three binary digits).

UNIVAC (Universal Automatic Computer) was a line of electronic digital


stored-program computers starting with the products of the Eckert–
Mauchly Computer ..

The PDP-8 is a 12-bit minicomputer that was produced by Digital


Equipment Corporation (DEC). It was the first commercially successful
minicomputer, with over 50,000 units being sold over the model's
lifetime.
The ICT 1900 was a word-addressing machine using a register-to-
memory architecture with eight accumulator registers. Three of the
accumulators could be used as modifier (index) registers. The word
length was 24 bits, which could be used as four six-bit characters;
instructions were provided for copying single characters to and from
memory.

What are IBM mainframes used for?


At their core, mainframes are high-performance computers with large
amounts of memory and processors that process billions of simple
calculations and transactions in real time. The mainframe is critical to
commercial databases, transaction servers, and applications that require
high resiliency, security, and agility.

A mainframe computer, informally called a mainframe or big iron, is a


computer used primarily by large organizations for critical applications,
bulk data processing (such as the census and industry and consumer
statistics, enterprise resource planning, and large-scale transaction
processing).

Are IBM mainframes still used?


Mainframes are still hard at work doing the jobs they have traditionally
done. More than 70% of Fortune 500 enterprises continue to use
mainframes for their most crucial.

Is ATM a mainframe computer?


If you ever used an automated teller machine (ATM) to interact with your
bank account, you used a mainframe. ... Because of these design
strengths, the mainframe is often used by IT organizations to host the
most important, mission-critical applications.
Conversion from decimal to Octal:
-Since Octal uses eight symbols as 0,1,2,3,4,5,6,7, the base is eight. To convert
a decimal number to Octal continuously by eight until the quotient is zero.
Examples:
1.)Convert a decimal number 153 to Octal.

2.)Follow the Steps

Decimal/8 Quotient Remainder


153/8 19 1
19/8 2 3
2/8 0 2

3.)Read the remainder from bottom to top.


4.) Therefore:
(153)10 = (231)8

-To convert a fractional decimal number to Octal number system, multiply


each fractional decimal number by 8. Get the integer of the product and
separate from the fractional part of the product. Continuously , multiply the
fractional part by 8 up to seven significant figures for better accuracy of the
result.

Ex.Convert (0.513)10 to Octal.

Fractional Number x base 8 Product Integer part Fractional part


1.) Steps
0.513 x 8 4.104 4 0.104
0.104 x 8 0.832 0 0. 832
0.832 x 8 6.656 6 0.656
0.656 x 8 5.248 5 0.248
0.248 x 8 1.984 1 0.948
0.948 x 8 7.872 7 0.872

2.)Read the integer part of the product from top to bottom.


Therefore:
(0.513)10 = (0.406517)8

Ex. Convert (153.513)10 to Octal.


1.)Steps
- As solved in previous example,
(153)10= (231)8
(0.513)10 = ((0.406517)8
Therefore:
(153.513)10 = (231.406517)8
Conversion from Octal to Decimal:
Steps:
1.)Write each octal digit and multiply it to its power of eight that depends
upon its positon in the octal number.
2.) Write the sum of the products.
3.)The result is the decimal equivalent of the octal number.

Example:

1.) Convert the octal number ( 231.406517)8 to decimal.

Steps
1.)( 231.406517)8 =

=2 x 82 + 3 x 81 + 1 X 80 + 4 X 8-1 + 0 x 8-2 + 6 x 8-3 + 5 x 8-4 + 1 x 8-5


+ 7 x 8-6
= 2 x 64 + 3 x 81 + 1 x 1 + 4/81 + 0 + 6/83 + 5 /84 +1/85 + 7 / 86
=128 + 24 + 1 + 0.5 + 0.01171875 + 0.0012207031 +
0.000026702881
= (153.51296616)10
Conversion from binary to Octal:
Example 1: Convert the binary number 10110001101011.111100000110 to
Octal.
Step a.) Locate the binary point of the binary number.
b.) From the binary point, form a group of three digits each towards the
left . From the same binary point, form a group of three digits towards the
right. This is illustrated below.

010 110 001 101 011 . 111 100 000 110

c.) Look at the table and find the octal equivalent for each group of three digits
and assign the octal number to each group
010 110 001 101 011 . 111 100 000 110
2 6 1 5 3 7 4 0 6
d.) Write the binary number and its corresponding octal equivalent together
with its binary point.
10110001101011.111100000110( in binary ) = 26153.7406( in octal)

Example 2. Convert the binary 11010111 to Octal.


Step a.) Locate the binary point of the binary number. In this example . the
binary point is located at the rightmost side of the number.
b.)Then from the binary point, form a group of three digits towards the
left only since there are no more digits to the right.
011 010 111 .
c.) Look at the table and find the octal equivalent for each group of three
digits and assign the
octal number to each group .
011 010 111 .
3 2 7
d.) Write the binary number and its corresponding octal equivalent together
with its binary point.
11010111( in binary) = 327 ( in octal )

Conversion from Octal to binary


 The procedure in conversion from Octal to Binary is just the reverse
process from Conversion from Binary to Octal. In every Octal digit,
assign the corresponding three Binary digits.

Example 1 Convert the octal number 673.124 to Binary


Step 1. Assign each Octal digit with corresponding three Binary digits.
Note the place of the Octal point.

6 7 3 . 1 2 4
110 111 011 001 010 100
Step 2. Write the Octal number with the corresponding Binary number
and binary point.

673.124(Octal) = 110111011.001010100( In Binary)

2.) Hexadecimal Number System:


 often shortened to “hex” is a numeral system made up of 16
symbols(base 16).
 The symbols used in Hex are the decimal numbers 0,1,2,3,4,5,6,7,8,9
and the letters A,B,C,D,E,F.
 Hexadecimal is a base 16 numbering system which is made up of 16
digits: 0 – 9 and six more, which is A through F.
 Hexadecimal numerals are widely used by computer system designers
and programmers because they provide a human-friendly
representation of binary-coded values. Each hexadecimal digit
represents four bits (binary digits), also known as a nibble (or nybble),
which is half a byte.
Conversion from Decimal to Hexadecimal:

-Since Hexadecimal uses sixteen symbols as 0,1,2,3,4,5,6,7,8 and 9 and the


letters A,B,C,D,E,F, the base is sixteen. To convert a decimal number to
hexadecimal, divide the decimal number continuously by sixteen until the
quotient is zero.

Examples:
1.)Convert a decimal number 46,687 to Hexadecimal.

2.)Follow the Steps

Decimal/16 Quotient Remainder

46,687/16 2917 15
2917/16 182 5
182/16 11 6
11/16 0 11

3.)Read the remainder from bottom to top.


Take note that in hexadecimal number system,
A=10
B=11
C=12
D= 13
E= 14
F= 15
4.) Assign letters to remainders greater than or equal to 11.

(46,687)10 = (B65F)16
Converting Hexadecimal number to decimal number.

Conversion from Hexadecimal to Decimal number system:


Steps:
1.)Write each hexadecimal digit and multiply it to its power of sixteen that
depends upon its position in the hexadecimal number.
2.) Write the sum of the products.
3.)The result is the decimal equivalent of the hexadecimal number.

Example:

1.) Convert the hexadecimal number (B65F)16 to decimal.

Steps:

= B x 163 + 6 x 162 + 5 X 161 + F X 160

=11 x 16 x 16 x 16 + 6 X 16 X16 + 5 X16 + 15 x 1

= 45,056 + 1,536 + 80 + 15

=46,687

Therefore:

(B65F)16 = ( 46,687)10
Conversion from a binary number to hexadecimal
 To convert from binary to hexadecimal, locate the binary point.
 From the binary point ,form a group of 4 digits towards the left and
towards the right.
 Look at the table and find the corresponding hexadecimal digit for each
group.
 Write the binary number and its equivalent hexadecimal number.

Example 1. Convert 0010110001101011.11110010 to hexadecimal


number

Step a.) Locate the binary point.


b.) From the binary point, form a group of four digits each
towards the left . From the same binary point, form a group of four digits
towards the right. This is illustrated below.
0010 1100 0110 1011 . 1111 0010
c.) Look at the table and find the octal equivalent for each
group of four digits and assign
the hexadecimal number to each group .
0010 1100 0110 1011 . 1111 0010
2 C 6 B F 2
d.) Write the binary number and its corresponding
hexadecimal equivalent together
with its binary point
0010110001101011.11110010( in binary)
Name:_____________ Score
Course/Year/Section_________ Date: _

SELF –CHECK NO. 2.2

NUMBER SYSTEMS

Direction:

1.)Convert the following binary numbers to octal and hexadecimal. Show your
solution/computation.

Binary Octal Hexadecimal


1.)11010111
2.) 11100001
3.)1100.10111
4.) 1100100.11
5.) 1010101.1000101

2.)Convert the following decimal numbers to octal and hexadecimal. Show


your solution/computation.

Decimal Octal Hexadecimal


1.) 225
2.) 7562.45
3.) 1938.257
4.) 175.175
5.) 673.23

3.)Convert the following Octal numbers to decimal and hexadecimal. Show


your solution/computation. No Solution is equivalent to no answer.

Octal Decimal Hexadecimal


1.)5250
2.)1321
3.) 1753
4.) 623
5.) 1234

4.)

Hexadecimal Decimal Octal


1.) 2AC5
2.) F3A7C2
3.) A56E
4.) BA23C
5.) AF12

REFERENCES:

Digital Design ,2nd edition ,1991 , by M. Morris Mano


https://www.khanacademy.org>math
https://delightlylinux.wordpress.com
https://www.mathisfun.com>binary
http://en.m.wikipedia.org>wiki
Complements:
- Are used in digital computers for simplifying the subtraction operation and
for logical manipulation.

Two types of Complements:


1.) Radix complement –which is referred as the r’s complement.
2.) Diminished radix complement – which is referred as the (r-1)’s
complement.

For Decimal numbers, r=10


1.) Radix Complement,R=10 ,10’s complement
- Can be formed by leaving all least significant zeroes unchanged
,subtracting the first non zero least significant digit from 10 and
subtracting and subtracting all higher significant digits from 9.
- Example: Find the 10’s complement of 012398.
Solution:
1000000
- 012398
987602

2.) Diminished radix complement =(r-10)= (10-1)’ s= 9’s complement


-referred as the 9’s complement since (r-1)’s= (10-1)’s=9’s complement
-is obtained by subtracting each digit from 9.
Example: Find the 9’s complement of 012398

999999
012398
987601

Example: Find the 9’s complement 0f 546700

999999
546700
453299
For Binary Numbers, r=2
1.)Radix Complement, r=2, 2’s complement
-is obtained by leaving the two least significant 0’s and the first 1
unchanged, and then replacing 1’s with 0’s and 0’s with 1’swith the other
most significant digits.
Example: Find the 2’s complement of 1101100
Answer= 0010100
Example : Find the 2’s complement of 0110111
Answer= 1001001

2.)Diminished radix complement, (2-1)’s= 1’s complement


-is formed by changing 1’s to 0’s and 0’s to 1’s
Example: Find the 1’s complement of 1011000
Answer=0100111

Example: Find the 1’s complement of 0101101


Answer= 1010010

SUBTRACTION WITH COMPLEMENTS:


-is used when subtraction is implemented with digital computer.
EXAMPLE:
Using 10’s complement ,subtract 72532- 3250
Solution:
Step 1: Let M= 72532
N= 03250
Step 2: Get the 10’s complement of N;
100000
03250
96750
Step 3: Add M and the 10’s complement of N
72532
96750
169282
Step 4: Discard the end carry which is 1.
Step 5: Answer = 69282
Example 2: Using 10’s complement, subtract 3250- 72532
Step 1: Let M= 03250
N= 72532
Step 2: Get the 10’s complement of N=72532
100000
72532
27468
Step 3: Add M=03250 and the 10’s complement of N
03250
+ 27468
SUM= 30718
Step 4: If there is no end carry, then Answer =-( 10’s
complement of SUM.)
100000
30718
69282
Step 5: Answer = - 69282

Example: Given the two binary numbers X=1010100 and


Y= 1000011 ,perform the following subtraction using the 2’s
complement
a.) X-Y
b.) Y-X

Step 1: Let X= 1010100


Y= 1000011
Step 2: Get the 2’s complement of Y
Y’= 0111101
Step 3: Add X and Y’
1010100
+ 0111101
SUM=10010001
Step 4:Discard the end carry if there is one.
Step 5: X-Y = 0010001
b.)Y-X
Step 1: Let Y= 1000011
X=1010100
Step 2: Get the 2’s complement of X
X’= 0101100
Step 3: Add Y and X’
Y=1000011
+ X’=0101100
SUM=1101111
Step 4: Since no end carry, Answer = -(2’s complement of SUM)
SUM’= 0010001
Step 5: Y-X = -0010001

Example : Repeat the example above using 1’s complement


a.) X-Y
Step 1: Let X= 1010100
Let Y= 1000011
Step 2: Get the 1’s complement of Y
Y’= 0111100
Step 3: Add X and Y’
X= 1010100
Y’= 0111100
SUM =10010000
Step 4: Bring down the end carry and add;
0010000
+ 1
0010001
Step 5: X-Y =0010001

b.) Y-X using 1’s complement


Step 1: Let Y= 1000011
X= 1010100
Step 2: Get the 1’s complement of X
X’=0101011
Step 3:Add Y and X’

Y= 1000011
+ X’=0101011
SUM=1101110
Step 4: Since no end carry in the SUM, Get the 1’s
complement of SUM.
SUM’ = 0010001
Step 5: Then Y-X = - SUM’
Y-X= -0010001
NAME: DATE:
COURSE & SECTION : SCORE:

ACTIVITY

1.) Perform subtraction with the following unsigned decimal


numbers by taking the 10’s and 9’s complement of the
subtrahend. Show complete solution on a yellow paper.
No Solution is equivalent to no answer.

NUMBERS(X-Y) USING 10’S USING 9’S


COMPLEMENT COMPLEMENT
1.)5250-1321
2.)1753-8640
3.)20-100
4.)1200-250

2.)Perform the subtraction with the following unsigned


binary numbers by taking the 2’s and 1’s complement of the
subtrahend. Show complete solution in a yellow paper. No
solution is equivalent to no answer.

BINARY(X-Y) USING 1’S USING 2’S


COMPLEMENT COMPLEMENT
1.)11010-10000
2.)11010 – 1101
3.)100- 110000
4.)1010100-
1010100

You might also like