Sie sind auf Seite 1von 8

Number systems

The decimal numeral system (also called base ten or occasionally denary)
has ten as its base.
It is the numerical base most widely used in everyday life or on a daily
basis.
This is called the decimal numbering system or, alternatively, the base-10
numbering system.
The decimal numbering system is built using ten different symbols, each
of which represents a quantity from zero to nine.
Therefore, ten possible digits can be used: 0 through 9. (The base-10
numbering system gets its name from the fact that only ten digits are
possible in the system.)
An important part of any numbering system is the use of positions in
which the numerical symbols can be placed.
Each position confers a different quantity to the number being
represented in that position.
Therefore, the number 10 in the decimal system represents the quantity
ten.
There is a 1 in the tens position and a 0 in the ones position.
This can also be represented as (110) + (01).
Now consider the number 541. This number uses the hundreds position as
well as the tens and ones positions.
It can be represented as (5100) + (410) + (11).
In English, you could state this number as five hundred plus forty plus
one.
Every written number has a least-significant digit and a most-significant
digit.
The least-significant digit is the one farthest to the right, and the mostsignificant digit is the one farthest to the left.
For binary numbers, people also talk about the least- and most-significant
bits, but its the same idea.
Humans have come to favor the base-10 system, probably because we
have ten fingers and thus tend to think in tens.
Computers, on the other hand, have only two digits with which they can
work1 and 0so they need to use a different numbering system.
The natural numbering system for a computer to use would therefore be
the base-2 numbering system, and, in fact, thats what they do use.
This system is called the binary numbering system.
Computers use only 1s and 0s at their most basic level because they
understand only two states: on and off. In the binary numbering system,
a 1 represents on, and a 0 represents off.
Recall that in the decimal numbering system, the position of each number
is important. It is the same in the binary numbering system, except that
each position doesnt correspond to powers of 10, but instead to powers
of 2.
Here are the values of the lowest eight positions used in the binary
numbering system:
128 64 32 16 8 4 2 1
So, suppose that you encounter the following binary number: 1010110 1
You would follow the same steps that you use to understand a decimal
numbering system number. In this example, the binary number
1

represents 128 + 32 + 8 + 4 + 1, or 173 in the decimal system.


You can also write (or calculate) this number as follows: (128 1) + (64
0) + (32 1) + (16 0) + (8 1) + (4 1) + (2 0) + (1 1)
So, two main things separate the decimal numbering system from the
binary numbering system: The binary system uses only 1s and 0s to
represent every value. The value of numerals in the different positions
varies.
You might be wondering how you can tell whether youre reading a binary
number or a decimal number. For instance, if youre reading a book about
computers and you see the number 10101, how do you know whether its
supposed to represent ten thousand one hundred and one or twenty-one?
There are several ways that you can tell:
Usually, binary numbers are shown with at least eight positions (a full
byte), even if the leading digits are 0s.
If youre looking at a bunch of numbers and see only 1s and 0s, its a
pretty good bet that they are binary numbers.
Binary numbers dont use the decimal point to represent fractional
values, so 10100.01 should be assumed to be a decimal system number.
Decimal numbers should use commas as you were taught in school. So,
the number 10,100 should be read as ten thousand one hundred, whereas
the number 10100 should be read as the binary number for the quantity
twenty.
Sometimes people put the letter b at the end of a binary number,
although this convention isnt widely followed.

Changing from decimal to binary.

The decimal (base ten) numeral system has ten possible values
(0,1,2,3,4,5,6,7,8, or 9) for each place-value.
In contrast, the binary (base two) numeral system has two possible
values, often represented as 0 or 1, for each place-value.
To avoid confusion while using different numeral systems, the base of
each individual number may be specified by writing it as a subscript of the
number.
For example, the decimal number 156 may be written as 156 10 and read
as "one hundred fifty-six, base ten".
The binary number 10011100 may be specified as "base two" by writing it
as 100111002.
Since the binary system is the internal language of electronic computers,
serious computer programmers should understand how to convert from
decimal to binary.

Converting from decimal to binary


Steps
Divide the number by 2 till you get a 0
Save the remainders
Convert 156 a decimal number into binary

Short division by two with remainder


Convert the decimal number 15610 to binary. Write the decimal number as
the dividend inside an upside-down "long division" symbol. Write the base of the
destination system (in our case, "2" for binary) as the divisor outside the curve
of the division symbol.

Write the integer answer (quotient) under the long division symbol, and
write the remainder (0 or 1) to the right of the dividend.

1. 3Continue downwards, dividing each new quotient by two and writing

the remainders to the right of each dividend. Stop when the quotient is 0.

2. 4

3.

Starting with the bottom remainder, read the sequence of


remainders upwards to the top. You should have 10011100. This is the
binary equivalent of the decimal number 156. Or, written with base
subscripts: 15610 = 100111002

This method can be modified to convert from decimal to any base.

The divisor is 2 because the desired destination is base 2.

If the desired destination is a different base, replace the 2 in the method


with the desired base. For example, if the desired destination is base 8,
replace the 2 with 9.

The final result will then be in the desired base.

Converting from binary to decimal


100110112
= ((128*1) + (64*0) + (32*0) + (16*1) + (1*8) + (0*4) + (1*2) +
(1*1))
= (128+16+8+0+2+1)
= 15510

Steps
1. For this example, let's convert the binary number 100110112 to decimal.

List the powers of two from right to left. Start at 20, evaluating it as "1".
Increment the exponent by one for each power. Stop when the amount of
elements in the list is equal to the amount of digits in the binary number. The
example number, 10011011, has eight digits, so the list, to eight elements,
would look like this: 128, 64, 32, 16, 8, 4, 2, 1

Write first the binary number below the list.

2. 3

Draw lines, starting from the right, connecting each consecutive digit of
the binary number to the power of two that is next in the list above it.
Begin by drawing a line from the first digit of the binary number to the first
power of two in the list above it. Then, draw a line from the second digit of the
binary number to the second power of two in the list. Continue connecting each
digit with its corresponding power of two.

Move through each digit of the binary number. If the digit is a 1, write its
corresponding power of two below the line, under the digit. If the digit is a 0,
write a 0 below the line, under the digit.

3. 5

Add the numbers written below the line. The sum should be 155. This is the
decimal equivalent of the binary number 10011011. Or, written with base
subscripts:

4. 6

Repetition of this method will result in memorization of the powers of


two, which will allow you to skip step 1.

Das könnte Ihnen auch gefallen