How a computer adds 2 + 2کۆمپیوتەر چۆن ٢ + ٢ کۆ دەکاتەوە؟
A cannot see the number 2. It sees only : electricity on (1) or off (0). Press 2 + 2 = on the and follow the numbers as through the of an , until the answer 4 appears.
ناتوانێت ژمارە ٢ ببینێت. تەنیا دەبینێت: کارەبا هەیە (1) یان نییە (0). لەسەر ٢ + ٢ = دابگرە و بەدوای ژمارەکاندا بچۆ کە وەک بە ناو دەڕۆن، تا وەڵامی ٤ دەردەکەوێت.
Counting with two digitsژماردن بە دوو ژمارە
In each place is worth ten times the one to its right: 1, 10, 100. In each place is worth two times: 1, 2, 4, 8. So 0010 means 0×8 + 0×4 + 1×2 + 0×1 = 2.
لە هەر خانەیەک دە ئەوەندەی خانەی لای ڕاستی بەهای هەیە: 1، 10، 100. لە هەر خانەیەک دوو ئەوەندە: 1، 2، 4، 8. بۆیە 0010 واتە 0×8 + 0×4 + 1×2 + 0×1 = 2.
| Decimal | Binary |
|---|---|
1 | 0001 |
2 | 0010 |
3 | 0011 |
4 | 0100 |
5 | 0101 |
8 | 1000 |
The four rules of adding bitsچوار یاسای کۆکردنەوەی بیت
- 0 + 0 = 0
- 0 + 1 = 1 and 1 + 0 = 1
- 1 + 1 = 10: write 0 and carry 1 to the next place, just like 5 + 5 = 10 in decimal.
- 1 + 1 + 1 (with a ) = 11: write 1 and carry 1.
- 0 + 0 = 0
- 0 + 1 = 1 و 1 + 0 = 1
- 1 + 1 = 10: 0 بنووسە و 1 بگوازەرەوە بۆ خانەی دواتر، ڕێک وەک 5 + 5 = 10 لە .
- 1 + 1 + 1 (لەگەڵ ) = 11: 1 بنووسە و 1 بگوازەرەوە.
A adds two bits with one (the sum) and one (the carry). A also adds the carry that comes in, so it uses two of each and an . That is exactly the circuit in this lab.
دوو بیت کۆ دەکاتەوە بە یەک (کۆکە) و یەک (). ئەو کۆ دەکاتەوە کە دێتە ناوی، بۆیە دوو دانە لە هەر یەکێکیان و بەکار دەهێنێت. ئەمە ڕێک ئەو سووڕەیە کە لەم تاقیگەیەدایە.
Read more: binary addition, adders, the AND gate, the OR gate and gates made of transistors.
زیاتر بخوێنەوە: کۆکردنەوەی دووانی، کۆکەرەوەکان، گەیتی AND، گەیتی OR و گەیتەکان لە ترانزیستۆر.