Chapter 1 - Understand Numbering System

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

UNDERSTAND NUMBERING SYSTEM

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

DECIMAL Base-10. Decimal number consisting 10 numbers we use in everyday life (0-9)

Base-2. Binary describes a numbering scheme in which there are only two
BINARY
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 represent a particular


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

DEFINE DATA ORGANIZATION

DATA IN BITS
Nibble 4 bits
Bytes 8 bits
Words 16 bits
Double words 32 bits

*You need to convert data into bits before proceed to other data.

 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

1
 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 non-ambiguous 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.

EXAMPLES:

1. Convert 12 bits in term of nibble. 2. Convert 2 words in term of nibble.


12 2×16
= =
4 4

= 3 nibbles = 8 nibbles

3. Convert 12 nibbles in term of bytes. 4. Convert 20 of bytes in term of double words.


12×4 20×8
= =
8 32

= 6 bytes = 5 double words

2
TRY NOW:

1. Convert 64 bits in term of bytes. 2. Convert 2 nibble in term of words.

CONVERSION SYSTEM

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.

EXAMPLES:

Convert 1011002 to base-10. Convert 011102 to base-10.

1011002 011102
= (1 × 25 ) + (0 × 24 ) + (1 × 23 ) + = (1 × 23 ) + (1 × 22 ) + (1 × 21 ) +
(1 × 22 ) + (0 × 21 ) + (0 × 20 ) (0 × 20 )
= 32 + 0 + 8 + 4 + 0 + 0 = 8 + 4 + 2 + 0
= 441010 = 1410

3
TRY NOW:

1. Convert 1100102 to base-10. 2. Convert 0111012 to base-10.

OCTAL TO DECIMAL

EXAMPLES:

1. Convert 278 to base-10. 2. Convert 125708 to base-10.

278 125708
= (2 × 81 ) + (7 × 80 ) = (1 x 84) + (2 x 83) + (5 x 82) + (7 x 81) +
= 16 + 7 (0 x 80)
= 23 = 4096 + 1024 + 320 + 56 + 0
= 549610

3. John offers to give you 478 cookies, and Jane offers to give you 4310 cookies. Whose offer do you
take?
For 478 ,
= (4x81) + (7x80 )
= (4x8) + (7x1)
= 32 + 7
= 3910

4
TRY NOW:

1. Convert 3338 to base-10. 2. Convert 14068 to decimal number.

HEXADECIMAL TO DECIMAL
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. Continue the sequence with alphabet A to F.

Base-16 digit value


0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
A 10
B 11
C 12
D 13
E 14
F 15

5
EXAMPLES:

1. Convert 19FDE16 to decimal number 2. Convert 5216 to decimal number

= (1 x 164) + (9 x 163) + (F x 162) + = (5x161) + (2x160)


(D x 161) + (E x 160) = 80 + 2
= (1 x 164) + (9 x 163) + (15 x 162) + = 8210

(13 x 161) + (14 x 160)

= 65536+ 36864 + 3840 + 208 + 14

= 10646210

TRY NOW:

1. Convert 9E5C16 to base-10. 2. Convert BB16 to decimal number.

6
DECIMAL TO BINARY
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. 2. Convert 3310 to base-2.

2 156 2 33
2 78 R=0 2 16 R=1
2 39 R=0 2 8 R=0
2 19 R=1 2 4 R=0
2 9 R=1 2 2 R=0
2 4 R=1 2 1 R=0
2 2 R=0 - R=1
2 1 R=0
- R=1

Therefore 15610 = 100111002. Therefore 3310 = 1000012

TRY NOW:
1. Convert 9710 to base-2. 2. Convert 1610 to binary number.

7
DECIMAL TO OCTAL

EXAMPLES:

1. Convert 5910 to base-8. 2. Convert 241810 to octal number.

8 59 8 2418
8 7 R=3 8 302 R=2
- R=7 8 37 R=6
8 4 R=5
- R=4

Therefore 5910 = 738. Therefore 241810 = 45628

TRY NOW:

1. Convert 33310 to base-8. 2. Convert 1120410 to octal number.

8
DECIMAL TO HEXADECIMAL

EXAMPLES:

1. Convert 313210 to base-16. 2. Convert 9910 to hexadecimal number .

16 3132 16 99
16 195 R=12 16 6 R=3
16 12 R=3 - R=6
- R=12

Therefore 313210 = (12)3(12)16 = C3C16 Therefore 9910 = 6316

TRY NOW:

1. Convert 17910 to base-16. 2. Convert 601310 to hexadecimal number.

9
We need to do all the procedures (multiplication and division) when converting binary, octal, and
hexadecimal into one another. Decimal is your pit-stop.

BINARY TO OCTAL
Convert 001100011002 to octal number.

METHOD 1
 binary to decimal
= (1x28) + (1x27) + (0x26) + (0x25) + (0x24) + (1x23) + (1x22) + (0x21) + (0x20)
= 256 + 128 + 0 + 0 + 0 + 8 + 4 + 0 + 0
= 39610

 decimal to binary
8 396
8 49 R=4
8 6 R=1
- R=6

So the desired octal equivalent of the binary number is 6148

METHOD 2
 using binary table for octal.

Step 1: Split digits into 3 per group, start from the back.
000 110 001 100

Step 2: Form the binary table for octal.

000 0
001 1
010 2
011 3
100 4
101 5
110 6
111 7

Step 3: State the answer.


Therefore, the answer is 06148 = 6148.

10
TRY NOW:

1. Convert 100112 to base-8. 2. Convert 11011010 to octal number.

3. Convert 11012 to base-8. 4. Convert 100111010 to octal number.

11
BINARY TO HEXADECIMAL
Convert 010101112 to a hexadecimal number.

METHOD 1
 binary to decimal
= (0x27) + (1x26) + (0x25) + (1x24) + (0x23) + (1x22) + (1x21) + (1x20)
= 0 + 64 + 0 + 16 + 0 + 4 + 2+ 1
= 8710

 decimal to hexadecimal
16 87
16 5 R=7
- R=5

So the desired octal equivalent of the binary number is 578

METHOD 2
 using binary table for hexadecimal.

Step 1: Split digits into 4 per group, start from the back.
0101 0111

Step 2: Form the binary table for octal.


0000 0
0001 1
0010 2
0011 3
0100 4
0101 5
0110 6
0111 7
1000 8
1001 9
1010 A
1011 B
1100 C
1101 D
1110 E
1111 F
Step 3: State the answer.
Therefore, the answer is 5716 .

12
TRY NOW:

1. Convert 10012 to base-16. 2. Convert 1101010 to hexadecimal number.

3. Convert 1111012 to base-16. 4. Convert 11010 to hexadecimal number.

13
OCTAL TO BINARY
Convert 348 to binary number.

METHOD 1
 octal to decimal
= (3x81) + (4x80)
= 24 + 4
= 2810

 decimal to hexadecimal
2 28
2 14 R=0
2 7 R=0
2 3 R=1
2 1 R=1
- R=1

So the desired octal equivalent of the binary number is 111002

METHOD 2
 using binary table for octal.

Step 1: Split into single digit.


3 4

Step 2: Form the binary table for octal.

000 0
001 1
010 2
011 3
100 4
101 5
110 6
111 7

Step 3: Find the correct value for the digit. State the answer.
Therefore, the answer is 0111002 = 111002.

14
TRY NOW:

1. Convert 278 to base-2. 2. Convert 3338 to binary number.

3. Convert 4148 to base-2. 4. Convert 11058 to binary number.

15
OCTAL TO HEXADECIMAL

Convert 5018 to hexadecimal number.

METHOD 1

 octal to decimal  decimal to hexadecimal


= (5x82)+ (0x81) + (1x80) 16 321
= 320 + 0 + 1
16 20 R=1
= 32110
16 1 R=4
- R=1

So the desired octal equivalent of the binary


number is 14116

METHOD 2

Step 1: Split into single digit. Step 5: Form the binary table for hexadecimal.
5 0 1
0000 0
Step 2: Form the binary table for octal. 0001 1
0010 2
000 0 0011 3
001 1 0100 4

010 2 0101 5
0110 6
011 3
0111 7
100 4
1000 8
101 5 1001 9
110 6 1010 A
111 7 1011 B
1100 C
Step 3: Find the correct value for the digit. State 1101 D
the answer. 1110 E
Therefore, the answer is 1010000012 . 1111 F

Step 4: Split digit into 4 per group, from the back. Step 6: State the answer.
0001 0100 0001 Therefore, the answer is 14116 .

16
TRY NOW:

1. Convert 278 to base-16. 2. Convert 3338 to hexadecimal number.

3. Convert 4148 to base-16. 4. Convert 11058 to hexadecimal number.

17
HEXADECIMAL TO BINARY
Convert 5216 to a binary number.

METHOD 1
 hexadecimal to decimal
= (5x161) + (2x160)
= 80 + 2
= 8210

 decimal to binary
2 82
2 41 R=0
2 20 R=1
2 10 R=0
2 5 R=0
2 2 R=1
2 1 R=0
- R=1

So the desired octal equivalent of the binary number is 10100102

METHOD 2
 using binary table for hexadecimal.
0000 0
Step 1: Split digits into 4 per group, start from the back. 0001 1
5 2 0010 2
0011 3
Step 2: Form the binary table for hexadecimal.
0100 4
0101 5
0110 6
0111 7
1000 8
1001 9
1010 A
1011 B
1100 C
1101 D
Step 3: State the answer. 1110 E
Therefore, the answer is 010100102 = 10100102. 1111 F

18
TRY NOW:

1. Convert 1CC16 to base-2. 2. Convert D216 to binary number.

3. Convert 39B16 to base-2. 4. Convert 10516 to binary number.

19
HEXADECIMAL TO OCTAL
Convert 2B7116 to octal number.

METHOD 1  decimal to octal

 hexadecimal to decimal 8 11121


= (2x163)+ (11x162) + (7x161) + (1x160) 8 1390 R=1
= 8192 + 2816 + 112 + 1 8 173 R=6
= 1112110 8 21 R=5
8 2 R=5
- R=2

So the desired octal equivalent of the binary


number is 255618

METHOD 2
Step 3: Find the correct value for the digit. State
Step 1: Split into single digit. the answer.
2 B 7 1 Therefore, the answer is 00101011011100012 .

Step 4: Split digits into 3 per group


Step 2: Form the binary table for hexadecimal.
0000 0 010 101 101 110 001
0001 1
0010 2 Step 5: Form the binary table for octal.
0011 3
0100 4 000 0
0101 5 001 1
0110 6 010 2
0111 7
011 3
1000 8
100 4
1001 9
1010 A
101 5
1011 B 110 6
1100 C 111 7
1101 D
1110 E
Step 6: State the answer.
1111 F
Therefore, the answer is 255618 .

20
TRY NOW:

1. Convert 1CC16 to base-8. 2. Convert 107D16 to octal number.

3. Convert 39B16 to base-8. 4. Convert 1A516 to octal number.


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

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
TRY NOW:

i. 110010 + 00111 ii. 011100101 + 11000111

iii. 1110111 + 0100001 iv. 10011 + 11001


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

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
TRY NOW:

i. 110010 - 00111 ii. 11100101 - 01000111

iii. 1110111 - 0100001 iv. 11111 - 11001


Rules of Binary Multiplication
 0x0=0
 0x1=0
 1x0=0
 1 x 1 = 1, and no carry or borrow bits

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
TRY NOW:

i. 1010 x 0011 ii. 11011 x 101

iii. 100101 x 000101 iv. 1110111 x 000100


EXERCISES
ANSWERS
1. Convert the followings binary number to decimal number:
a) 112
a) 310
b) 1012 b) 510
c) 0010012 c) 910
d) 1000112 d) 3510

2. Convert the followings octal number to decimal number: a) 45910


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

3. Convert the followings hexadecimal number to decimal number:


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

4. Convert the followings decimal number:


a) 1110112
a) 5910 to binary number b) 100002
b) 1610 to binary number c) 14078
c) 77510 to octal number d) 20208
e) 3CE316
d) 104010 to octal number f) F409F16
e) 1558710 to hexadecimal number
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
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

BINARY OCTAL TO HEXADECIMAL


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

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)

You might also like