M. Amer Iqbal Qureshi



tải về 3.06 Mb.
Chế độ xem pdf
trang10/132
Chuyển đổi dữ liệu09.12.2022
Kích3.06 Mb.
#53945
1   ...   6   7   8   9   10   11   12   13   ...   132
Amer Iqbal - Teach Yourself PIC Microcontrollers for Absolute Beginners-Microtronics Pakistan (2001)

World of numbers 
Mathematics is such a good science! Everything 
is so logical and is as simple as that. The whole 
universe can be described with ten digits only. 
But, does it really have to be like that? Do we 
need exactly ten digits? Of course not, it is only 
a matter of habit. Remember the lessons from 
the school. For example, what does the number 
764 mean: four units, six tens and seven hundreds. Simple! Could it be described in a bit more complicated 
way? Of course it could: 4 + 60 + 700. Even more complicated? Naturally: 4*1 + 6*10 + 7*100. Could this 
number look a bit more “scientific”? The answer is yes: 4*10^0 + 6*10^1 + 7*10^2. What does it actually 
mean? Why do we use exactly these numbers: 100, 101 and 102 ? Why is it always about the number 10? 
That is because we use ten different digits (0, 1, 2, ... 8, 9). In other words, because we use base-10 number 
system, i.e. decimal number system. It is easier to work with decimal numbers, however computers can not 
do so, they use only two digits, 0 and 1. these are represented within a computer by presence or absence of 
volts on a specific line. 
Binary number system 
What would happen if only two digits would be used- 0 and 1? Or if we would not know to determine 
whether something is 3 or 5 times greater than something else? Or if we would be restricted when 
comparing two sizes, i.e. if we could only state that something exists (1) or does not exist (0)? Nothing 
Fig. 4 Different methods of representing a decimal number 


Teach Yourself PIC Microcontrollers | www.electronicspk.com | 12 
special would happen, we would keep on using numbers in the same way, but they would look a bit 
different. For example: 11011010. How many pages of a book does the number 11011010 include? In order 
to learn that, follow the same logic like in the previous example, but in inverse order. Have in mind that all 
this is about mathematics with only two digits- 0 and 1, i.e. base-2 number system (binary number system). 
Clearly, it is the same number represented in two different ways. The only difference is in the number of 
digits necessary for writing some number. One digit (2) is used to write the number 2 in decimal system, 
whereas two digits (1 and 0) are used 
to write that number in binary system. 
Do you now agree with the first 
sentence in this text? Welcome to the 
world of binary arithmetic! Do you 
have any idea where it is used? 
E x c e p t i n g s t r i c t l y c o n t r o l l e d 
laboratory conditions, the most 
complicated electronic circuits cannot 
with accuracy determine difference 
between two sizes (two voltage 
values, for example) if they are too 
small (lower than several volts). The 
reasons for that are electrical noises 
and something quite uncertainly called “realistic working environment” (unpredictable changes of power 
supply voltage, temperature changes, tolerance to values of built in components etc.). Imagine a computer 
which would operate upon decimal numbers by recognizing 10 digits in the following way: 0=0V, 1=5V, 
2=10V, 3=15V, 4=20V... 9=45V !? Did anybody say batteries? Far simpler solution is the use of binary 
logic where 0 indicates that there is no voltage and 1 indicates that there is voltage. Simply, it is easier to 
write 0 or 1 instead of “there is no voltage” or “there is voltage”. It is so called logic zero (0) and logic one 
(1) which electronics perfectly cope with and easily performs all those endlessly complex mathematical 
operations. It is apparently electronics which in reality applies mathematics in which all numbers are 
represented by two digits only and in which it is only important to know whether there is voltage or not. Of 
course, we are talking about digital electronics. 

tải về 3.06 Mb.

Chia sẻ với bạn bè của bạn:
1   ...   6   7   8   9   10   11   12   13   ...   132




Cơ sở dữ liệu được bảo vệ bởi bản quyền ©hocday.com 2024
được sử dụng cho việc quản lý

    Quê hương