Specifications

Appendix B - Numeric Systems
Operations of addition, subtraction, division, and multiplication in a decimal numeric system are
used in a way that is already known to us, so we won't discuss it further.
B.2 Binary numeric system
Binary numeric system differs in many aspects from the decimal system we are used to in our
everyday lives. Its numeric basis is 2, and each number can have only two values, '1' or '0'.
Binary numeric system is used in computers and microcontrollers because it is far more suitable
for processing than a decimal system. Usually, binary number consists of binary digits 8, 16 or 32,
and it is not important in view of the contents of our book to discuss why. It will be enough for
now to adopt this information.
Example:
10011011 binary number with 8 digits
In order to understand the logic of binary numbers, we will consider an example. Let's say that we
have a small chest with four drawers, and that we need to tell someone to bring something from
one of the drawers to us. Nothing is more simple, we will say left side, bottom (drawer), and the
desired drawer is clearly defined. However, if we had to do this without the use of instructions like
left, right, beneath, above, etc., then we would have a problem. There are many solution to this
problem, but we should look for one that is most beneficent and practical! Lets designate rows
with A, and types with B. If A=1, it refers to the upper row of drawers, and for A=0, bottom row.
Similarly with columns, B=1 represents the left column, and B=0, the right (next picture). Now it
is already easier to explain from which drawer we need something. We simply need to state one of
the four combinations: 00, 01, 10 or 11. This characteristic naming of each drawer individually is
nothing but binary numeric representation, or conversion of common numbers from a decimal into
binary form. In other words, references like "first, second, third and fourth" are exchanged with
"00,01, 10 and 11".
What remains is for us to get acquainted with logic that is used with binary numeric system, or
how to get a numeric value from a series of zeros and ones in a way we can understand, of
course. This procedure is called conversion from a binary to a decimal number.
Example:
http://www.mikroelektronika.co.yu/english/product/books/PICbook/B_Dodatak.htm (2 of 6) [4/2/2003 16:19:30]