Cryptography Reference
In-Depth Information
A.1.1 Decimal
Before explaining binary or hex, it is first necessary to understand some of the
principles behind the more familiar decimal numbers.
WRITING A NUMBER IN DECIMAL
Consider the number 359. What do each of 3, 5 and 9 actually represent? Observe
that:
359 = 300 + 50 + 9
=
(3 × 100) + (5 × 10) + (9 × 1)
10 2 )
10 1 )
10 0 )
=
(3
×
+
(5
×
+
(9
×
.
All we have done in these last three lines is to rewrite the number 359 in a form
that shows how it can be represented as a sum of multiples of powers of ten. This
is why our most familiar numbers are often referred to as decimal numbers: the
digits that we use to write them indicate the multiples of powers of ten that are
added together to make up the number. Observe two things:
1. The digits of a decimal number can take any of the values from 0 up to 9.
2. Every digit in a decimal number will be multiplied by some power of 10. The
powers of 10 start with 0 (the furthest digit to the right) and then increase from
right to left.
Decimal numbers are sometimes also referred to as base 10 numbers. This is
because the representation of the number in digits is 'based' on the powers of
10, as we have just seen. We normally do not bother indicating that a number is
written in base 10, since this tends to be assumed by default. However, because
we will be changing numbers from one base into another, we will often need to
indicate the base being used. To indicate that the number 359 is a decimal number
we will thus sometimes write it as 359 10 .
LEADING ZEROS
As a last remark about decimal (indeed, any number base), any number of 0's can
be put in front of a decimal number without changing its value. These are called
leading zeros . For example,
00013
=
013
=
13
.
This is consistent with our previous way of expressing decimal numbers since:
00013 = (0 × 10 4 ) + (0 × 10 3 ) + (0 × 10 2 ) + (1 × 10 1 ) + (3 × 10 0 )
0 + 0 + 0 + (1 × 10 1 ) + (3 × 10 0 )
=
(1 × 10 1 ) + (3 × 10 0 ) = 13 .
=
Search WWH ::




Custom Search