Number Systems New
Number Systems New
Number Systems New
Number Systems
We
humans use decimal number system as the basis for our daily
computing activities. But how about Computers? Do they use
decimals too?
No. Computers use different number system, called binary.
Decimal
Binary
5 . 4
10 1
1/10 weights
The weight of each position determines how much the digit in that position
contributes to the value of the number.
For example, because the 2 in 25.4 occupies the 10s position ( i.e., the position
with weight 10), it contributes 2 x 10 = 20 to the value of the number. The value
of a decimal number is the sum of each digit times its weight. Thus the value of
25.4 is:
2 x 10 + 5 x 1 + 4 x 1/10
In
We
Binary
+1x1
+ 1 x = 11.5
Hexadecimal
256 16
For
Another
examples are:
The complement of 1 in binary;
( 2 1) 1 = 0 complement = 0
the complement of 3 in hexadecimal;
( 16 1) 3 = C complement = C
Computer
Common
The
When
But
Decimal
Equivalent
1,000 (thousand)
Actual Memory
sizes
1024
1,000,000
(millions)
1,000,000,000
(billions)
1,048,576
1,073,741,824
1 carry
28
+39
67
b.1 borrow
34
- 8
26
c.
211
3000
2
2998
borrow
Binary
- addition
111 carries
01100
+11110
101010
12
30
42
Binary
- subtraction
2 borrow
101
+ 011
010
5
3
2
Hexadecimal
- addition
1 carry
A9
+ 19
C2
169
25
194
Hexadecimal
- addition
16 borrow
A5
+ 2B
7A
165
43
122
0
10 /
9
10 / 90
10 / 905
Answer: 905
9 remainders
0
5
0
2
2
2
2
Answer: 1011
/
/
/
/
1
2
5
11
1 remainders
0
1
1
0 1 remainders
16 / 1
14 = E
16 / 30
Answer: E1
To
Example:
.6875
x
1
2
.3750
x
0
2
.7500
x
1
2
.5000
x
1
2
0000
answer:
0.1011
To convert
Multiple repetition
Example:
.1
x 2
0
.2
x 2
.4
answer:
No matter how many times we multiply, we will never get a zero fractional part
x 2
0
.8
x 2
.6
x 2
.2
x 2
.4
There is nothing wrong with this procedure. It simply tells us that 0.1 decimal is
equal to the infinite-length binary fraction.