02-Number System and Conversion
02-Number System and Conversion
CONVERSION
350151- Digital Circuit
Choopan Rattanapoka
Introduction
(Base 10)
Binary (Base 2)
Octal
(Base 8)
Hexadecimal
(Base 16)
Number System
Decimal System
digit
Most Significant
Digit
decimal point
Least
Significant Digit
Binary System
bit
Most Significant
Bit
binary point
Least
Significant Bit
3501
(base-10)
1 X 100 =
0 X 101 =
5 X 102 =
500
3 X 103 =
3000
Binary-to-Decimal Conversion
1101
(base-2)
1 X 20 =
0 X 21 =
1 X 22 =
1 X 23 =
8 + 4 + 0 + 1 = 13
11012= 1310
Octal-to-Decimal Conversion
5217
(base-8)
7 X 80 = 7x1
1 X 81 = 1x8
2 X 82 = 2x64 = 128
5 X 83 = 5x512 = 2560
2560 + 128 + 8 + 7 = 2703
52178 = 270310
Hexadecimal-to-Decimal Conversion
1ACF
(base-16)
15 X 160 =15x1
15
12 X 161 =12x16
192
. 581
(base-10)
5 X 10-1 = 5x0.1
= 0.5
Binary-to-Decimal Conversion
. 101
(base-2)
1 X 2-1 = 1x0.5
= 0.5
0 X 2-2 = 0x0.25 = 0
1 X 2-3 = 1x0.125 = 0.125
0.5 + 0 + 0.125 = 0.625
0.1012
0.62510
Octal-to-Decimal Conversion
. 25
(base-8)
2 X 8-1 = 2x0.125
= 0.25
5 X 8-2 = 5x0.015625 =
0.017825
0.25 + 0.017825 = 0.267825
0.258
0.26782510
Hexadecimal-to-Decimal Conversion
. F5
(base-16)
15 X16-1 = 15x0.0625 =
0.9375
5 X16-2 = 5x0.00390625
= 0.01953125
0.9375 + 0.01953125 = 0.95703125
0.F516
0.9570312510
Exercise 1
11100.1001
111111
100000.0111
Decimal-to-Binary Conversion
(positional number)
250
2
2
250
125
2 62
2 31
2 15
2 7
2 3
1
25010 = 1 1 1 1 1 0 1 02
Remainder
Remainder
Remainder
Remainder
Remainder
Remainder
Remainder
0
1
0
1
1
1
1
Decimal-to-Octal Conversion
250
8
8
250
31
3
Remainder
Remainder
25010 = 3728
2
7
Decimal-to-Hexadecimal Conversion
250
16
250
15
Remainder
25010 = 15 1016 ?
= FA16
10
Decimal-to-Binary Conversion
(fractional number)
0 . 4375
0.4375 x 2
0.8750 x 2
0.75 x 2
0.5
x2
=
=
=
=
0.8750
1.75
1.5
1.0
0.437510 = 0.01112
Decimal-to-Octal Conversion
0 . 4375
0.4375 x 8
0.5
x8
= 3.5
= 4.0
0.437510 = 0.348
Decimal-to-Hexadecimal Conversion
0 . 4375
0.4375 x 16
= 7.0
0.437510 = 0.716
0.782
0.782 x 2
0.564 x 2
0.128 x 2
0.256 x 2
0.512 x 2
0.024 x 2
0.048 x 2
0.192 x 2
0.384 x 2
0.768 x 2
=
=
=
=
=
=
=
=
=
=
1.564
1.128
0.256
0.512
1.024
0.048
0.096
0.384
0.768
1.536
Exercise 2
38
22.5
764.375
Example
372.348 =
Convert
250.437510
Positional number
Fractional number
250 / 16 = 15 remainder 10
250 FA16
0.4375 * 16 = 7.0
0.4375 0.716
372.348 = FA.716
Exercise 3 (TODO)