Topic 1 Numbering Systems

Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

VOLUME 1 [NUMBERING SYSTEM]

NUMBERING
SYSTEM

UNDERSTAND NUMBERING SYSTEM


 DEFINE NUMBERING SYSTEM: DECIMAL, BINARY, OCTAL
AND HEXADECIMAL.

Base-10. Decimal number consisting 10 numbers we use in


DECIMAL
everyday life (0-9)
Base-2. Binary describes a numbering scheme in which there
BINARY
are only two possible values for each digit: 0 and 1.

OCTAL Base-8 number system, and uses the digits 0 to 7.

Base-16. Number system that uses 16 unique symbols to


HEXADECIMAL
represent a particular value. Those symbols are 0-9 and A-F.

 CONVERT BINARY TO DECIMAL AND DECIMAL TO BINARY

NOTES
BINARY TO DECIMAL
Since binary is a base-2 system, each digit represents an increasing power of 2, with the
rightmost digit representing 20, the next representing 21, then 22, and so on. To determine
the decimal representation of a binary number simply take the sum of the products of the
binary digits and the powers of 2 which they represent.

MATHEMATICS FOR COMPUTING 1


VOLUME 1 [NUMBERING SYSTEM]

EXAMPLES

1. Convert 1011002 to base-10.

2. Convert 011102 to base-10.

LET’S TRY!

1. Convert 1100102 to base-10.

2. Convert 0111012 to base-10.

MATHEMATICS FOR COMPUTING 2


VOLUME 1 [NUMBERING SYSTEM]

DECIMAL TO BINARY

NOTES
Write the decimal number as the dividend inside an upside-down "long division" symbol.
Write the base of the destination system (in our case, "2" for binary) as the divisor
outside the curve of the division symbol.

EXAMPLES

1. Convert 15610 to base-2.

MATHEMATICS FOR COMPUTING 3


VOLUME 1 [NUMBERING SYSTEM]

2. Convert 3310 to base-2.

LET’S TRY!

1. Convert 9710 to binary 2. Convert 1610 to binary


number. number.

MATHEMATICS FOR COMPUTING 4


VOLUME 1 [NUMBERING SYSTEM]

 DEFINE DATA ORGANIZATION

 BITS
o A single numerical unit in the binary number system.
o the basic and physical unit of information in computing and
digital communications
o Bit is short form for BInary digit.
o Computer communicate in binary language which is denoted by 0s and 1s
o can also be interpreted as logical values (true/false, yes/no), algebraic signs (+/−),
or activation states (on/off).
o The symbol for binary digit is either simply bit or lowercase b

 NIBBLES
o Four bits in series, or half an 8-bit byte.
o A nibble is used to represent hexadecimal in binary.

 BYTE/OCTET
o A series of eight bits.
o Since a byte is not eight bits in all computer systems, octet provides a
nonambiguous term.
o 1 character occupies 8 bits of memory.
o can represent a character or a special symbol in a character code.
o The unit symbol for the byte was designated as the upper-case letter B

 WORDS
o A defined and specific number of digits grouped together.
o A collection of characters which is 16 bits in size.

 DOUBLE WORDS
o Twice the length of a single computer word.
o A double word is typically 32 bits long.

MATHEMATICS FOR COMPUTING 5


VOLUME 1 [NUMBERING SYSTEM]

EXAMPLES WRITE THE FOLLOWING DATA


IN TERMS OF NIBBLES.

1. 12 bits
12
=
4
1 nibble = 4 bits
= 3 nibbles

2. 2 words
2×16
= 1 word = 16 bits
4
1 nibble = 4 bits
= 8 nibbles

LET’S TRY!

1. Express 4 words in term


of byte

2. Express 34 bytes in term


of bit

3. Express 16 bits in term of


word

MATHEMATICS FOR COMPUTING 6


VOLUME 1 [NUMBERING SYSTEM]

UNDERSTAND OCTAL NUMBERING SYSTEM


 CONVERT OCTAL TO DECIMAL AND DECIMAL TO OCTAL

OCTAL TO DECIMAL

CONVERT THE FOLLOWINGS


EXAMPLES OCTAL NUMBER TO DECIMAL
NUMBER.

1. 278

2. 125708

4. John offers to give you 478 cookies, and Jane offers to give you
4310 cookies. Whose offer do you take? If you want, go ahead and
generate the graphic for 478 graphic with the first tool.

MATHEMATICS FOR COMPUTING 7


VOLUME 1 [NUMBERING SYSTEM]

DECIMAL TO OCTAL
CONVERT THE FOLLOWINGS
EXAMPLES DECIMAL NUMBER TO OCTAL
NUMBER.

1. 15010

2. 5910

3. 241810

MATHEMATICS FOR COMPUTING 8


VOLUME 1 [NUMBERING SYSTEM]

LET’S TRY!

1. Convert the followings octal number to decimal number.


i. 278 ii. 3338 iii. 14148

2. Convert the followings decimal number to octal number.


i. 2710 ii. 33310 iii. 191410

MATHEMATICS FOR COMPUTING 9


VOLUME 1 [NUMBERING SYSTEM]

 CONVERT OCTAL TO BINARY AND BINARY TO OCTAL

BINARY TO OCTAL

EXAMPLES CONVERT 001100011002 TO


OCTAL NUMBER.

METHOD 1
Step 1:
Consider any binary number. A binary number consists of only 0's and 1's.
e.g 00110001100
Step 2:
Group all the bits in the binary number, as a set of 3 bits. Start from the right
(back)!!!
If any bit remains ungrouped in a set of 3 bits then you can add a leading '0' to it
on the left, to make it a perfect set.
000 110 001 100
Step 3:
Separate each digit and multiply with the rightmost digit representing 20, the
next representing 21, then 22, and so on.
000 110 001 100
0x22 0x21 0x20 1x22 1x21 0x20 0x22 0x21 1x20 1x22 0x21 0x20

Step 4:
Replace each 3-bit binary number set to its equivalent octal number.
000 110 001 100
0+0+0 4+2+0 0+0+1 4+0+0
0 6 1 4
Step 5:
Hence the number obtained after replacing is the equivalent octal number, OR
6148.

MATHEMATICS FOR COMPUTING 10


VOLUME 1 [NUMBERING SYSTEM]

METHOD 2

Step 1: Convert binary to decimal


00110001100

Step 2: Convert decimal to octal

MATHEMATICS FOR COMPUTING 11


VOLUME 1 [NUMBERING SYSTEM]

OCTAL TO BINARY

EXAMPLES CONVERT 348 TO OCTAL


NUMBER.

 FIRST METHOD (but you have to MEMORIZE the binary table)

Now the binary equivalent of 3 is 011 and 4 is 100. So the desired binary equivalent
of the octal number is 111002

 SECOND METHOD
Convert octal to decimal, and then convert decimal to binary.

Step 1: Convert octal to decimal

Step 2: Convert decimal to binary

MATHEMATICS FOR COMPUTING 12


VOLUME 1 [NUMBERING SYSTEM]

LET’S TRY!

1. Convert the followings binary number to octal number.


i. 100112 ii. 11102 iii. 001101102

2. Convert the followings octal number to binary number.


i. 278 ii. 3338 iii. 04148

MATHEMATICS FOR COMPUTING 13


VOLUME 1 [NUMBERING SYSTEM]

UNDERSTAND HEXADECIMAL NUMBERING SYSTEM

Hexadecimal numbers uses digits from 0-15. Since we are working with base-16, we
have 16 digits. We've run out of digits, but we still need six more. Perhaps we could use
something like a circled 10?

 CONVERT HEXADECIMAL TO DECIMAL AND DECIMAL TO


HEXADECIMAL

 HEXADECIMAL TO DECIMAL

.
EXAMPLES Convert 19FDE16 to decimal number

Hexadecimal No. Decimal Number

19FDE16

MATHEMATICS FOR COMPUTING 14


VOLUME 1 [NUMBERING SYSTEM]

DECIMAL TO HEXADECIMAL

SOLUTION EXAMPLES CONVERT 313210 TO


HEXADECIMAL NUMBER.

LET’S TRY!

1. Convert the followings hexadecimal number to decimal number.


i. 9E5C16 ii. 07A116 iii. BB16

MATHEMATICS FOR COMPUTING 15


VOLUME 1 [NUMBERING SYSTEM]

2. Convert the followings decimal number to hexadecimal number.


i. 9910 ii. 126510 iii. 1818510

MATHEMATICS FOR COMPUTING 16


VOLUME 1 [NUMBERING SYSTEM]

1.3.2 CONVERT HEXADECIMAL TO BINARY AND BINARY TO


HEXADECIMAL

 HEXADECIMAL TO BINARY

FIRST METHOD (but you have to remember the binary table!)

i. (1E3)16 = (1(14)3)16 = (0001 1110 0011)2

ii. (0A2B)16 = (0(10)2(11))16 = (0000 1010 0010 1011)2

iii. (7E0C)16 = (7(14)0(12))16 = (0111 1110 0000 1100)2

SECOND METHOD
EXAMPLE: Convert 5216 to a binary number.

Step 1: Convert 5216 to decimal

Step 2: Convert decimal to binary

MATHEMATICS FOR COMPUTING 17


VOLUME 1 [NUMBERING SYSTEM]

 BINARY TO HEXADECIMAL

FIRST METHOD (but you have to remember the binary table!)

i. (1110)2 = E16
ii. (111001)2 = (0011 1001)2 =3916
iii. (10011100)2 = (1001 1100)2 =9C16

SECOND METHOD
Separate numbers into 4-digits in a group from the back.
If any bit remains ungrouped in a set of 3 bits then you can add a
leading '0' to it on the left, to make it a perfect set.

EXAMPLE: Convert 010101112 to a hexadecimal number


Step 1: Separate each digit and multiply with the rightmost digit representing
20, the next representing 21, then 22, and so on.

0101 0111
0x23 1x22 0x21 1x20 0x23 1x22 1x21 1x20

Step 2: Replace each 4-bits binary number set to its equivalent octal number.
0101 0111
5 7

 The answer is 5716

MATHEMATICS FOR COMPUTING 18


VOLUME 1 [NUMBERING SYSTEM]

THIRD METHOD
Convert binary to decimal, and then convert decimal to hexadecimal.

EXAMPLE: Convert 5716 to a binary number.

Step 1:

Step 2: Convert decimal to binary

MATHEMATICS FOR COMPUTING 19


VOLUME 1 [NUMBERING SYSTEM]

LET’S TRY!

1. Convert the followings hexadecimal number to binary number.


i. 1CC16 ii. D116 iii. 39B16

2. Convert the followings binary number to hexadecimal number.


i. 10012 ii. 110102 iii. 1010012

MATHEMATICS FOR COMPUTING 20


VOLUME 1 [NUMBERING SYSTEM]

 CONVERT HEXADECIMAL TO OCTAL AND OCTAL TO


HEXADECIMAL

Hexadecimal and octal cannot be converted directly into each another. You have
to convert each into DECIMAL before proceed to covert to the next one.

 OCTAL TO HEXADECIMAL
The easiest way is to convert Octal to decimal and then convert the decimal to
hexadecimal.

EXAMPLES
CONVERT 5018 TO
HEXADECIMAL NUMBER.

Step 1:
Convert decimal (multiply by 8)

Step 2:
Convert to hexadecimal (divide decimal number by 16)

MATHEMATICS FOR COMPUTING 21


VOLUME 1 [NUMBERING SYSTEM]

HEXADECIMAL TO OCTAL

The easiest way is to convert hexadecimal to decimal and then convert the decimal to
Octal.

EXAMPLES CONVERT 2B7116 TO OCTAL


NUMBER.

Step 1:
Convert to Decimal (multiply by 16)

Step 2:
Convert to Octal (divide decimal number by 8)

MATHEMATICS FOR COMPUTING 22


VOLUME 1 [NUMBERING SYSTEM]

LET’S TRY!

1. Convert the followings octal number to hexadecimal number.


i. 248 ii. 1368 iii. 35718

2. Convert the followings hexadecimal number to octal number.


i. 1CC16 ii. 107D116 iii. 39B16

MATHEMATICS FOR COMPUTING 23


VOLUME 1 [NUMBERING SYSTEM]

DEFINE BINARY ARITHMETIC

 UNDERSTAND BINARY ARITHMETIC OPERATIONS:


ADDITION, SUBTRACTION AND MULTIPLICATION

Rules of Binary Addition


 0+0=0
 0+1=1
 1+0=1
 1 + 1 = 0, and carry 1 to the next more significant bit
 1 + 1 + 1 = 1, and carry 1 to the next more significant bit

EXAMPLES SOLVE THE FOLLOWINGS:

i. 00011010 + 00001100
0 0 0 1 1 0 1 0
+ 0 0 0 0 1 1 0 0
0 0 1 0 0 1 1 0

i. 00011010 + 00001100

0 0 0 1 0 0 1 1
+ 0 0 1 1 1 1 1 0
0 1 0 1 0 0 0 1

i. 1110110 + 1010111

1 1 1 0 1 1 0
+ 1 0 1 0 1 1 1
1 1 0 0 1 1 0 1

MATHEMATICS FOR COMPUTING 24


VOLUME 1 [NUMBERING SYSTEM]

LET’S TRY!

Solve the followings:


i. 110010 + 00111
ii. 011100101 + 11000111
iii. 1110111 + 0100001
iv. 10011 + 11001

MATHEMATICS FOR COMPUTING 25


VOLUME 1 [NUMBERING SYSTEM]

Rules of Binary Subtraction


 0-0=0
 0 - 1 = 1, and borrow 1 from the next more significant bit
 1-0=1
 1-1=0 REMINDER: 10 – 1 = 1

EXAMPLES SOLVE THE FOLLOWINGS:

i. 00100101 - 00010001

00100101
- 00010001
00010100

ii. 00110011 – 00010110

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

iii. 1110110 – 1010111

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

MATHEMATICS FOR COMPUTING 26


VOLUME 1 [NUMBERING SYSTEM]

LET’S TRY!

Solve the followings:


i. 110010 - 00111
ii. 11100101 - 01000111
iii. 1110111 - 0100001
iv. 11111 - 11001

MATHEMATICS FOR COMPUTING 27


VOLUME 1 [NUMBERING SYSTEM]

Rules of Binary Multiplication


 0x0=0
 0x1=0
 1x0=0
 1 x 1 = 1, and no carry or borrow bits

EXAMPLES SOLVE THE FOLLOWINGS:

i. 00101001 × 00000110

0 0 1 0 1 0 0 1
x 0 0 0 0 0 1 1 0
0 0 0 0 0 0 0 0
0 0 1 0 1 0 0 1
0 0 1 0 1 0 0 1
0 0 1 1 1 1 0 1 1 0

ii. 00010111 × 00000011

0 0 0 1 0 1 1 1
x 0 0 0 0 0 0 1 1
0 0 0 1 0 1 1 1
0 0 0 1 0 1 1 1
0 0 1 0 0 0 1 0 1

MATHEMATICS FOR COMPUTING 28


VOLUME 1 [NUMBERING SYSTEM]

LET’S TRY!

Solve the followings:


i. 1010 x 0011
ii. 11011 x 101
iii. 100101 x 000101
iv. 1110111 x 000100

MATHEMATICS FOR COMPUTING 29


VOLUME 1 [NUMBERING SYSTEM]

EXERCISES

ANSWER

1. Convert the followings binary number to decimal number:


a) 112
b) 1012 a) 310
b) 510
c) 0010012 c) 910
d) 1000112 d) 3510

2. Convert the followings octal number to decimal number:


a) 7138
b) 15618 a) 45910
c) 021048 b) 88110
d) 128 c) 109210
d) 1010

3. Convert the followings hexadecimal number to decimal


number:
a) 11E 16 a) 28616
b) 15A116 b) 553710
c) 1126810
c) 02C0416 d) 479510
d) 12BB16

4. Convert the followings decimal number:


a) 5910 to binary number a) 1110112
b) 1610 to binary number b) 100002
c) 77510 to octal number c) 14078
d) 20208
d) 104010 to octal number e) 3CE316
e) 1558710 to hexadecimal number f) F409F16
f) 99958310 to hexadecimal number

5. Convert the followings:


a) 92 to octal number a) 118
b) 752 to hexadecimal number b) 1316
c) 158 to binary number c) 11012
d) 1008 to hexadecimal number d) 100000016
e) 24728
e) 53A16 to octal number f) 1110011002
f) 1CC16 to binary number

MATHEMATICS FOR COMPUTING 30


VOLUME 1 [NUMBERING SYSTEM]

CONCLUSION

TYPES CHANGE TO METHOD EXAMPLE

DECIMAL TO OCTAL
DECIMAL OTHER TYPES DIVIDED BY THEIR BASE
DIVIDE BY 8

OCTAL TO DECIMAL
OTHER TYPES DECIMAL MULTIPLIED BY THEIR BASE
MULTIPLY BY 8

CONVERT TO DECIMAL
BINARY OCTAL TO HEXADECIMAL
ANY OTHER TYPES FIRST AND THEN CONVERT
OCTAL OCTAL TO DECIMAL
EXCEPT DECIMAL DECIMAL TO THE TYPES
HEXADECIMAL DECIMAL TO HEXADECIMAL
NEEDED

YOU CAN USE CALCULATOR TO CHECK YOUR ANSWER BY CLICKING>>>>>

MODE MODE BASE CHOOSE TYPES OF TYPE YOUR NUMBER = CHOOSE TYPES OF
NUMBER (GREEN COLOUR) NUMBER THAT YOU WANT
TO CONVERT (GREEN
COLOUR)

MATHEMATICS FOR COMPUTING 31

You might also like