Binary numeral
system
Binary numerical system is a base of
programming. Machine was designed to manipulate with numbers. Binary system was
chosen because it is the easiest way to save numbers. If one capacitor contains
charge it means it is 1 else 0.
Let’s imaging we need to save some
numbers, and we do not have regular digits. For example, we can have one apple.
We want to save this number somehow. We will use one regular lamp to do it.

If no apple exists, then we have:

If we have one apple:

Hope it is clear.
Now we can have up to two apples. One lamp it is not enough
to save this number. So, let’s use two lamps.


There are two ways to save number with two lamps.
First way, number of turned on lamps equals number of apples
we have
1. If
one lamp turned on, we have one apple
2. If
two lamps turned on, we have two apples.
3. If
no lamp turned on, we do not have an apple.




On both we have only one lamp turned on, which means we have
one apple.
Second way, position of lamp should show another number.
One apple: 



Two apples: 



Lamp can have only two states: off and on. If lamp is on
then we have one apple, if we need to save a higher number, we should turn on
next lamp and turn off current. So, lamp in next position represent number two.
If we want to save number three, we can use first lamp:


If we want to save number four, we need to have extra
lamp:



Now we have one on lamp and two off lams. It is means we can
add extra three combinations based from previous paragraph.
Each extra lamp represent number that twice (because binary
system) higher than previous.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
128
|
64
|
32
|
16
|
8
|
4
|
2
|
1
|
No comments:
Post a Comment