Sie sind auf Seite 1von 53

ENCODING SYSTEM

ESSENCE OF LEARNING THESE NUMBER SYSTEMS

 Computers and networking equipment


such as router switches work with binary
digits (bits)
 Bits can be either a binary 1 or binary 0
that can be represents as absence,
logical false, no (0) or presence, logical
true, yes (1)
THE BINARY NUMBER SYSTEM
 Binary Number system is used in the
design and implementation of
computer’s hardware and software
 It is a base 2 number system while
decimal is a base 10 number system.
 The base 2 number system is what all
computers and data communications
used to communicate and process data.
DECIMAL NUMBER SYSTEM
 Can be expressed as the sum of each
digit times a power of ten in expanded
notation.
 With decimal fraction, this can be
expressed also in expanded notation.
However, the value at the right side of the
decimal point are the negative power of
ten.
 A numbering system that uses the base 10
and uses the numbers 0, 1, 2, 3, 4, 5, 6, 7,
8, 9.
OCTAL NUMBER SYSTEM
 The octal number system was adapted
because of the difficulty of dealing with
long strings of binary 0s and 1s in
converting them into decimals.
 It is a base 8 number system and is used to
conserve memory storage location of the
computer system by grouping the binary
digits into three. Meaning, 3 bits is
equivalent to 1 octal number.
HEXADECIMAL NUMBER
SYSTEM
 We have to take note that the computer
system has done many conversion
process involving a binary to decimal
number conversions and vise-versa to
store, retrieve, manage and control our
data program or software.
 In computer networking, hexadecimal
number system is applied as the physical
address of the LAN-card which is called
MAC (Media Access Control) address.
HEXADECIMAL NUMBER
SYSTEM
 It provides another convenient and simple
method for expressing values represented
by binary numerals.
 It uses the base 16 to shorten the binary
series since one (1) hexadecimal digit is
equivalent to four (4) binary digits.
 The following table gives a comparison
between decimal and hexadecimal
number systems.
HEXADECIMAL NUMBER SYSTEM

Decimal Hexa Decimal Hexa

0 0 10 A
1 1 11 B
2 2 12 C
3 3 13 D
4 4 14 E
5 5 15 F
6 6
7 7
8 8
9 9
DECIMAL NUMBER SYSTEM TABLE
1000s 100s 10s 1s Places
103 102 101 100 Powers
1000 100 10 1 Values

1000s 100s 10s 1s Places


103 102 101 100 Powers
1000 100 10 1 Values
2 5 Number

The number 25 is treated as


(2)(10) + (5) (1) = 25.
The Decimal System is what we use but
the computer uses a different number
system called binary system.
DECIMAL NUMBER SYSTEM
 Examples
1. 7642 = 7 x 103 + 6 x 102 + 4 x 101 + 2 x 100
= 7 x 1000 + 6 x 100 + 4 x 10 + 2 x 1 7000
600
40
2
= 7642
2. 28.36 = 2 x 101+ 8 x 100 + 3 x 10 -1 + 6 x 10 -2
= 2 x 10 + 8 x 1+ 3/10 + 6/100 20
= 20 + 8 + 0.30 + 0.06 8
= 28.36 .30
.06
28.36
BINARY TO DECIMAL NUMBER
CONVERSION
 Binarynumbers can be converted into
decimal number using an expanded
notation in base 2 instead of base 10 (in
the case of decimal number)
BINARY NUMBER SYSTEM

 Binary is defined as a numbering system


that uses zero (0) and one (1).

16s 8s 4s 2s 1s Places
24 23 22 21 20 Powers
16 8 4 2 1 Values
BINARY TO DECIMAL NUMBER
CONVERSION
 Examples
2 1=2
1. 1 0

421=6
2. 1 1 0

8 4 2 1 = 15
3. 1 1 1 1
BINARY TO DECIMAL NUMBER
CONVERSION
 Examples
8 4 2 1=
1.) 1 0 1 1

8 4 2 1=
2.) 1 0 0 1

16 8 4 2 1=
3. 1 0 1 1 0
SEATWORK: Binary to Decimal
Convert these binary numbers
to decimal numbers:
1. 112
2. 1012
3. 1112
4. 10002
5. 101112
6. 111112
BINARY - OCTAL CONVERSION

 When converting binary to octal


equivalent, the binary number is first
partitioned into 3-bit sequences,
beginning on the right, and then
replaced by its octal equivalent.

 Zeros
may be added to make the
number of digits a multiple of four.
BINARY TO OCTAL CONVERSION
 Example
1. 011101 = 358 in octal number; 2910 in decimal
(011) (101) 32 16 8 4 2 1 = 29
0 1 1 1 0 1
3 5
2. 1110010 = 1628 in octal number; 11410 in decimal
(001) (110) (010)

1 6 2
SEATWORK
1. 1001001112
2. 11011011102
3. 1011100112
BINARY - HEXADECIMAL CONVERSION

 When converting binary to


hexadecimal equivalent, the binary
number is first partitioned into 4-bit
sequences, beginning on the right,
and then replaced by its
hexadecimal equivalent.

 Zeros
may be added to make the
number of digits a multiple of four.
BINARY - HEXADECIMAL CONVERSION

 Examples
1. 1011101100100112 = ( ? ) 16
Grouping the bits into fours:
0101 1101 1001 00112
5 13 9 3
5 D 9 3

= 5D9316
BINARY - HEXADECIMAL CONVERSION

 Examples
1. 1011010110110010112 = ( ? ) 16
Grouping the bits into fours:
0010 1101 0110 1100 10112
2 13 6 12 11
2 D 6 C B

= 2D6CB16
BINARY - HEXADECIMAL
CONVERSION
 Exercises
1. 1110001110011102 = ( ? ) 16
2. 11111011001111101012 = ( ? ) 16
DECIMAL TO BINARY CONVERSION
A direct conversion, known as the remainder
method, is also possible.
 By this method, the decimal number and
each successive quotient is divided by 2 and
noting the remainders.
 The sequence of remainders, in reverse order,
gives the hexadecimal equivalent.
DECIMAL TO BINARY NUMBER
CONVERSION
 Examples
Divide Quotient Remainder
1. 1410 = 14/2 7 0
7/2 3 1
3/2 1 1
1/2 0 1

= 1110

1.
DECIMAL TO BINARY NUMBER
CONVERSION
 Examples
Divide Quotient Remainder
1. 910 = 9/2 4 1
4/2 2 0
2/2 1 0
1/2 1

= 1001

1.
DECIMAL TO BINARY NUMBER
CONVERSION
 Examples
Divide Quotient Remainder
1. 12010 = 120/2 60 0
60/2 30 0
30/2 15 0
15/2 7 1
7/2 3 1
3/2 1 1
1/2 0 1

= 1111000

1.
SEATWORK: Decimal to Binary
Convert these decimal numbers
to binary numbers:
1. 65
2. 90
3. 35
4. 85
5. 127
DECIMAL TO OCTAL CONVERSION
A direct conversion, known as the remainder
method, is also possible.
 By this method, the decimal number and
each successive quotient is divided by 8 and
noting the remainders.
 The sequence of remainders, in reverse order,
gives the hexadecimal equivalent.
DECIMAL TO OCTAL CONVERSION
 Examples
1. 1010 = 10/8 1 2
= 1/8 0 1
= 128

2. 13610 = 136/8 17 0
= 17/8 2 1
= 2/8 0 2
= 2108
DECIMAL TO OCTAL CONVERSION
 Examples

3. 149010 = 1490/8 186 2


= 186/8 23 2
= 23/8 2 7
= 22/8 0 2
= 27228
DECIMAL TO HEXADECIMAL
CONVERSION
 One way to perform a decimal to
hexadecimal conversion is to go from decimal
to binary and then to hexadecimal.
 A direct conversion, known as the remainder
method, is also possible.
 By this method, the decimal number and
each successive quotient is divided by 16 and
noting the remainders.
 The sequence of remainders, in reverse order,
gives the hexadecimal equivalent.
DECIMAL TO HEXADECIMAL CONVERSION
 Examples
1. 5810
58/16 3 10 (or A)
3/16 0 3
Therefore: 5810 = 3A16

2. 36210
362/16 22 10 (or A)
22/16 1 6
1/16 0 1
Therefore: 36210 = 16A16
DECIMAL TO HEXADECIMAL CONVERSION
 Examples

3. 972010
9720/16 607 8
607/16 37 15 (or F)
37/16 2 5
2/16 0 2
Therefore: 972010 = 25F816
DECIMAL TO HEXADECIMAL CONVERSION
 Exercises

1. 167810

2. 23410
OCTAL TO BINARY
 Examples
1. 458 = ( ? )2 Since 48 = 1002 and
58 = 1012
Therefore:
458 = 100 1012

2. 7328 = ( ? )2 Since 78 = 1112,


38 = 0112
and 28 = 0102
Therefore:
7328 = 111 011 0102
OCTAL TO BINARY
Exercises
1. 1248 = ( ? )2
2. 3458 = ( ? )2
3. 4568 = ( ? )2
OCTAL TO BINARY
 Exercises
1. 1248 = ( 001 010 100 )2
1 2 4

2. 3458 = ( 011 100 101 )2


3 4 5

3. 4568 = ( 100 101 110 )2


4 5 6
OCTAL TO BINARY CONVERSION

Exercises
1. 5678
2. 3458
3. 731 8
DECIMAL TO OCTAL CONVERSION
 Exercises
1. 12410 = 124/8 15 4
= 15/8 1 7
= 1/8 0 1
= 1748

2. 34510 = 345/8 43 1
= 43/8 5 3
= 5/8 0 5
= 5318
DECIMAL TO OCTAL CONVERSION
 Examples
1. 1010 = 10/8 1 2
= 1/8 0 1
= 128

2. 13610 = 136/8 17 0
= 17/8 2 1
= 2/8 0 2
= 2108
DECIMAL TO HEXADECIMAL
CONVERSION
 One way to perform a decimal to
hexadecimal conversion is to go from decimal
to binary and then to hexadecimal.
 A direct conversion, known as the remainder
method, is also possible.
 By this method, the decimal number and
each successive quotient is divided by 16 and
noting the remainders.
 The sequence of remainders, in reverse order,
gives the hexadecimal equivalent.
DECIMAL TO HEXADECIMAL CONVERSION
 Examples
1. 5810
58/16 3 10 (or A)
3/16 0 3
Therefore: 5810 = 3A16

2. 36210
362/16 22 10 (or A)
22/16 1 6
1/16 0 1
Therefore: 36210 = 16A16
DECIMAL TO HEXADECIMAL CONVERSION
 Examples

3. 972010
9720/16 607 8
607/16 37 15 (or F)
37/16 2 5
2/16 0 2
Therefore: 972010 = 25F816
DECIMAL TO HEXADECIMAL CONVERSION
 Exercises

1. 167810

2. 23410
HEXADECIMAL – DECIMAL CONVERSION
• Multiply each digit by its positional value
and then obtain the sum.
• This time we use powers of 16 for the
weights.
• You should not be confused by the use of
hexadecimal digits A to F.
• When performing any arithmetic operation,
merely convert hexadecimal digits to their
equivalent counterpart.
HEXADECIMAL – DECIMAL CONVERSION
• Examples
1. 4B616 = 4x16 2 + 11x16 1 + 6x16 0
= 1024 + 176 + 6
=120610
2. BC516 = 11x16 2 + 12x16 1 + 5x16 0
= 2816 + 192 + 5
=301310
3. 413916 = 4x16 3 + 1x16 2 + 3x16 2 + 9x16 0
= 16384 + 256 + 48 + 9
=1669710
HEXADECIMAL TO DECIMAL
CONVERSION
• Exercises

1. 78E16

2. 2F416
HEXADECIMAL – DECIMAL CONVERSION

• Examples
1. 78E16 = 7x16 2 + 8x16 1 + 14x16 0
= 1792 + 128 + 14
= 193410
2. 2F416 = 2x16 2 + 15x16 1 + 4x16 0
= 512 + 240 + 4
=75610
HEXADECIMAL - BINARY CONVERSION
Hexa Binary Hexa Binary

0 0000 A 1010
1 0001 B 1011
2 0010 C 1100
3 0011 D 1101
4 0100 E 1110
5 0101 F 1111
6 0110
7 0111
8 1000
9 1001
HEXADECIMAL – BINARY CONVERSIONS
1. 3BD616 = (?)2
3 = 0011
B = 1011 (11)
D = 1101 (13)
6 = 0110
= 0011 1011 1101 0110 2 or 11 1011 1101 0110 2

2. 2FD16 = (?)2
2 = 0010
F = 1111 (15)
D = 1101 (13)
= 0010 111 1101 2 or 10 111 1101 2
HEXADECIMAL – BINARY CONVERSIONS
EXERCISES
1. 4FE16 = (?)2
2. AE16 = (?)2
3. EFD16 = (?)2
SUMMARY
SUMMARY
TO BASE
FROM
BASE 2 8 16 10
Group binary digits Group binary digits Expand number and
2 by 3, convert by 4, convert convert base 2 digits
to base 10

Convert each octal Convert to base 2, Expand number and


8 digit to 3 binary then to base 8 convert to base 8
digits digits to base 10

Convert each Convert to base 2, Expand number and


16 hexadecimal digit then to base 8 convert base 16
to 4 binary digits digits to base 10

Divide number Divide number Divide number


10 repeatedly by 2; repeatedly by 8; repeatedly by 16,
use remainder as use remainder as use remainder as
an answer an answer an answer
BINARY TO DECIMAL
NUMBER CONVERSION DECIMAL TO BINARY
NUMBER CONVERSION
1. 10011100 1. 123
2. 11110011 2. 234
3. 1010101 3. 56
4. 11001100 4. 49
5. 1101110 5. 98

Das könnte Ihnen auch gefallen