Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
3 5 0 1 . 5 1
digit
Most Significant Least
Digit decimal point Significant Digit
Binary System
1 1 0 1 . 0 1
bit
Most Significant Least
Bit binary point Significant Bit
Decimal Number Quantity
(
(positional
l number)
b )
3501 (base-10)
1 X 100 = 1
0 X 101 = 0
5 X 102 = 500
3 X 103 = 3000
1101 (base-2)
1 X 20 = 1
0 X 21 = 0
1 X 22 = 4
1 X 23 = 8
8 + 4 + 0 + 1 = 13
11012= 1310
Octal-to-Decimal
Octal to Decimal Conversion
5217 (base-8)
7 X 80 = 7x1
7 1 = 7
1 X 81 = 1x8 = 8
2 X 82 = 2x64 = 128
5 X 83 = 5x512 = 2560
2560 + 128 + 8 + 7 = 2703
52178 = 270310
Hexadecimal-to-Decimal
Hexadecimal to Decimal Conversion
15 X 160 =15x1
15 1 = 15
5 X 10-11 = 5x0.1
5 01 = 0.5
05
8 X 10-22 = 8x0.01
8x0 01 = 0.08
0 08
1 X 10-3 = 1x0.001 = 0.001
. 101 (base-2)
1 X 2-11 = 1x0.5
1 05 = 0.5
05
0 X 2-22 = 0x0.25
0x0 25 = 0
1 X 2-3 = 1x0.125 = 0.125
0.1012 = 0.62510
Octal-to-Decimal
Octal to Decimal Conversion
. 25 (base-8)
2 X 8-11 = 2x0.125
2 0 125 = 0.25
0 25
5 X 8-2 = 5x0.015625
5 0 015625 =
0.017825
0.258 = 0.26782510
Hexadecimal-to-Decimal
Hexadecimal to Decimal Conversion
. F5 (base-16)
15 X16-11 = 15x0.0625 =
0.9375
5 X16-2 = 5x0.00390625
5 0 00390625
= 0.01953125
0.F516 = 0.9570312510
Exercise 1
11100.1001
111111
100000.0111
100000 0111
Decimal-to-Binary Conversion
(
(positional
l number)
b )
250 25010 = 1 1 1 1 1 0 1 02
2 250
2 125 Remainder 0
2 62 Remainder 1
2 31 Remainder 0
2 15 R
Remainder
i d 1
2 7 Remainder 1
2 3 Remainder 1
1 Remainder 1
Decimal-to-Octal
Decimal to Octal Conversion
250
8 250
8 31 Remainder 2
3 Remainder 7
25010 = 3728
Decimal-to-Hexadecimal
Decimal to Hexadecimal Conversion
250
16 250
15 Remainder 10
25010 = 15 1016 ?
= FA16
Decimal-to-Binary Conversion
(f
(fractional
l number)
b )
0 . 4375
0.4375
0 4375 x 2 = 0.8750
0 8750
0.8750 x 2 = 1.75
0 75 x 2
0.75 = 15
1.5
0.5 x2 = 1.0
0 437510 = 0.0111
0.4375 0 01112
Decimal-to-Octal
Decimal to Octal Conversion
0 . 4375
0.4375
0 4375 x 8 = 3.5
35
0.5 x8 = 4.0
0 437510 = 0.34
0.4375 0 348
Decimal-to-Hexadecimal
Decimal to Hexadecimal Conversion
0 . 4375
0 4375 x 16
0.4375 = 7.0
70
0 437510 = 0.7
0.4375 0 716
Exercise 2
38
22.5
764.375
764 375
Base X – to – Base Y Conversion
372.348 = FA.716
Exercise 3 (TODO)
5A.B16
C) G
Grayy
D) Excess - 3
rr’ss Complement
Eg
Eg.
(r-1)’s
(r 1) s Complement
Given a positive number N in base r with an integer
part of n digits and a fraction part of m digits, the
(r – l)’s complement of N is defined as r r N
n m
1’ss Complement
1
2’ss Complement
2
Concept Check
Signed Number Concept
Signed Number Concept Cont…
Concept Check
Solution
Solution
Solution
Subtraction with rr’ss Complement
The subtraction of two positive numbers (M-N), both
of base r, may be done as follows:
Add the minuend M to the r’s complement of the
subtrahend N.
Inspect the result obtained in step 1 for an end carry:
If an end carry occurs, discard it.
If an end carry does not occur, take the r’s complement of
the number obtained in step 1 and place a negative sign in
front.
Subtraction with (r
(r-1)’s
1) s Complement
The subtraction of two positive numbers (M-N), both
of base r, may be done as follows:
Add the minuend M to the (r-1)’s complement of the
subtrahend N.
Inspect the result obtained in step 1 for an end carry:
If an end carry occurs, add 1 to the least significant digit
(end-around carry).
If an end carry does not occur, take the (r-1)’s complement
off the
h number
b obtained
b d in step 1 and
d place
l a negative sign
in front.
Overflow Condition
To Be Continued...
Continued