Computer Systems Servicing
NC II
DECIMAL & BINARY CONVERSION
Decimal Number System
The number system that represents a number in terms of 0
to 9 digits is a decimal number system. A decimal number
system has ten digits, i.e., 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. The
base of a number in this system is 10.
Binary Number System
A number system that expresses a number in terms of 0 and
1 digits is a binary number system. A binary system has
only two digits, i.e., 0 and 1. The base of a number in this
system is 2. In a binary number system, a number is
expressed in terms of powers of 2.
Decimal to Binary
Conversion
IPv4 Address Structure
● An IP address is a 32-bit long value
● In binary, it is a 32-bit long string of zeroes and ones:
○ Example: 1100 0000 . 1010 1000 . 0000 0100 . 0000 0010
○ It consist of four octets, or four 8-bits of 1’s and 0’s separated by dot
○ Each octet is between 0000 0000 and 1111 1111
● In decimal, it consists of four decimal numbers separated by dot
○ Example: 192 . 168 . 4 . 2
○ Each decimal number is between 0 and 255
Decimal to Binary Conversion
Convert 120 to binary
128 64 32 16 8 4 2 1
BINARY 0 1 1 1 1 0 0 0
64 + 32 + 16 + 8 = 120
Binary to Decimal
Conversion
Binary to Decimal Conversion
Convert to Decimal:
1010 1100 . 0001 0000 . 0000 0001 . 0000 0100
1 2 3 4
128
128
128
128
64
32
16
64
32
16
64
32
16
64
32
16
8
4
2
1
8
4
2
1
8
4
2
1
8
4
2
1
1 0 1 0 1 1 0 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0
128+32+8+4 = 172 16 1 4
Answer: 172.16.1.4
1 = “on” or “count it”
0 = “off” or “don’t count it”
COMMON SUBNET MASK
128 64 32 16 8 4 2 1
128 1 0 0 0 0 0 0 0
192 1 1 0 0 0 0 0 0
224 1 1 1 0 0 0 0 0
240 1 1 1 1 0 0 0 0
248 1 1 1 1 1 0 0 0
252 1 1 1 1 1 1 0 0
254 1 1 1 1 1 1 1
255 1 1 1 1 1 1 1 1
Summary
● Base two: 0 or 1
● Base Ten: 0123456789
● Values 2^x
○ 128 64 32 16 8 4 2 1
● On or Off
Thank You!