Chapterبەش 3 · Lectureوانە 3.5
Adding and Subtracting Signed Numbersکۆکردنەوە و لێدەرکردنی ژمارە نیشانەدارەکان
How a computer adds and subtracts positive and negative numbers with one ordinary adder: the four cases of 2's-complement addition, why the final carry is discarded, subtraction as adding the 2's complement, and how to recognise overflow.
چۆن و بە یەک ئاسایی کۆ دەکاتەوە و لێک دەردەکات: چوار حاڵەتی کۆکردنەوە بە ، بۆچی دوایین فڕێ دەدرێت، لێدەرکردن وەک زیادکردنی و چۆن دەناسیتەوە.
What you will learnچی فێر دەبیت
- Add two signed 8-bit numbers in 2's complement and read the answer.
- Explain why the final carry can be discarded.
- Subtract by adding the 2's complement of the subtrahend.
- Decide whether an addition has overflowed, with the sign rule and the carry rule.
- دوو 8 بیتی بە کۆ بکەیتەوە و وەڵامەکە بخوێنیتەوە.
- ڕوون بکەیتەوە بۆچی دوایین فڕێ دەدرێت.
- بە زیادکردنی لێدەرکراوەکە لێدەرکردن بکەیت.
- بە یاسای نیشانە و یاسای بڕیار بدەیت ئایا کۆکردنەوەیەک داوە.
One adder for every signیەک کۆکەرەوە بۆ هەموو نیشانەیەک
In Signed numbers you learned to store negative numbers in 2's complement. Now comes the reward: to add two signed numbers, the computer simply adds the bit patterns in ordinary binary addition — sign bits included — with no special rules for the signs.
لە ژمارە نیشانەدارەکان فێر بوویت بە هەڵبگریت. ئێستا سوودەکەی دەردەکەوێت: بۆ کۆکردنەوەی دوو ، تەنها پێکهاتەی بە کۆکردنەوەی دووانیی ئاسایی کۆ دەکاتەوە — — بەبێ هیچ یاسایەکی تایبەت بۆ نیشانەکان.
Write both numbers in 2's complement with the same number of bits (8 bits in this lesson). Negative numbers: invert every bit of the positive number, then add 1.
هەردوو ژمارەکە بە و بە هەمان ژمارەی بنووسە (لەم وانەیەدا 8 ). : هەموو پێچەوانە بکەرەوە، پاشان 1 زیاد بکە.
Add them column by column from the right, like unsigned binary numbers.
ستوون بە ستوون لە ڕاستەوە کۆیان بکەرەوە، وەک ژمارەی بێنیشانە.
If a 9th bit (a final carry) appears on the left, discard it. The 8 bits that remain are the answer.
ئەگەر نۆیەم (دوایین ) لە لای چەپ دەرکەوت، فڕێی بدە. ئەو هەشت دەمێننەوە وەڵامەکەن.
Read the answer: sign bit 0 → positive; sign bit 1 → negative (use the weight).
وەڵامەکە بخوێنەرەوە: 0 ← موجەب؛ 1 ← سالب ( بە بژمێرە).
The four casesچوار حاڵەتەکە
When two signed numbers are added, there are four cases. The method is the same for all of them; only the result looks different.
کاتێک دوو کۆ دەکرێنەوە، چوار حاڵەت هەیە. ڕێگاکە بۆ هەموویان یەکە؛ تەنها ئەنجامەکە جیاواز دەردەکەوێت.
- Both numbers positive.
- A positive and a negative number, the positive one larger in magnitude.
- A positive and a negative number, the negative one larger in magnitude.
- Both numbers negative.
- هەردوو ژمارەکە موجەبن.
- و ، موجەبەکە گەورەترە.
- و ، سالبەکە گەورەترە.
- هەردوو ژمارەکە سالبن.
Remember the range: 8 bits hold to . Every number and every answer in this lesson must fit in that range; the overflow screen shows what happens when it does not.
سنوورەکان لەبیر بێت: 8 تەنها تا هەڵدەگرن. هەموو ژمارە و وەڵامێکی ئەم وانەیە دەبێت لە نێوان ئەم دوو سنوورەدا بێت؛ شاشەی سەرڕێژبوون پیشان دەدات چی ڕوو دەدات کاتێک جێی نابێتەوە.
The four casesچوار حاڵەتەکە
Case 1: both numbers positiveحاڵەتی 1: هەردوو ژمارەکە موجەبن
Two positive numbers are added exactly like unsigned numbers. Example: .
دوو ڕێک وەک کۆ دەکرێنەوە. نموونە: .
The sign bit of the answer is 0, so it is positive: .
وەڵامەکە 0ـە، کەواتە موجەبە: .
The four casesچوار حاڵەتەکە
Case 2: positive number is largerحاڵەتی 2: ژمارە موجەبەکە گەورەترە
Example: . The positive number (15) has a larger magnitude than the negative one (6), so the answer is positive. Watch the animation: first is made, then the two patterns are added.
نموونە: . (15) لە (6) گەورەترە، بۆیە وەڵامەکە موجەبە. سەیری جووڵەکە بکە: سەرەتا دروست دەکرێت، پاشان دوو پێکهاتەکە کۆ دەکرێنەوە.


Middle row: every bit of inverted (the 1's complement). Bottom row: add 1.
ڕیزی ناوەڕاست: هەموو پێچەوانە کراونەتەوە (). ڕیزی خوارەوە: 1 زیاد بکە.
A 9th bit appears; discard it. The answer 00001001 = .
نۆیەم دەردەکەوێت؛ فڕێی بدە. وەڵام 00001001 = = .
The four casesچوار حاڵەتەکە
Case 3: negative number is largerحاڵەتی 3: ژمارە سالبەکە گەورەترە
Example: . Now the negative number has the larger magnitude, so the answer is negative. First make :
نموونە: . ئێستا گەورەترە، بۆیە وەڵامەکە سالبە. سەرەتا دروست بکە:
Middle row: every bit of inverted (the 1's complement). Bottom row: add 1.
ڕیزی ناوەڕاست: هەموو پێچەوانە کراونەتەوە (). ڕیزی خوارەوە: 1 زیاد بکە.
No 9th bit this time. The sign bit is 1, so the answer is negative: = .
ئەمجارە نۆیەم نییە. 1ـە، کەواتە وەڵامەکە سالبە: .
The four casesچوار حاڵەتەکە
Case 4: both numbers negativeحاڵەتی 4: هەردوو ژمارەکە سالبن
Example: . Make both negative numbers first, and check each one with the weight.
نموونە: . سەرەتا هەردوو دروست بکە و هەریەکەیان بە ـی بپشکنە.
| Numberژمارە | Positiveموجەب | Invertپێچەوانە | Add 11 زیاد بکە | Checkپشکنین |
|---|---|---|---|---|
00011001 | 11100110 | 11100111 | ||
00010011 | 11101100 | 11101101 |
11100111 + 11101101 = 1 11010100. Discard the 9th bit: 11010100 = = . Two negative numbers gave a negative answer, as they should.
11100111 + 11101101 = 1 11010100. نۆیەم فڕێ بدە: 11010100 = . دوو وەڵامێکی سالبیان دا، وەک پێویستە.
Why may we throw the carry away?بۆچی دەتوانین گواستراوەکە فڕێ بدەین؟
It seems strange to throw a bit away. Here is why it is correct. An 8-bit pattern stores as 11111010, which as an unsigned number is . So adding really adds :
فڕێدانی سەیر دیارە. ئەمە هۆکاری ڕاستبوونیەتی. پێکهاتەیەکی 8 بیتی وەک 11111010 هەڵدەگرێت کە وەک ـە. کەواتە زیادکردنی لە ڕاستیدا زیاد دەکات:
The 9th bit has the weight 256. Dropping it removes exactly that 256, and 9 is left. On the 2's complement wheel this is one full turn: you end where you should.
نۆیەم بە 256 دەژمێردرێت. لابردنی ڕێک ئەو 256ـە لادەبات و 9 دەمێنێتەوە. لەسەر بازنەی تەواوکەری دوو ئەمە یەک خولی تەواوە: لە شوێنی دروستدا دەوەستیت.
Think of the 256 patterns as 256 shops around a big roundabout. Adding a number means walking forward. Walking 250 shops forward lands on the same shop as walking 6 shops back. Going once all the way round (256 shops) changes nothing — that full lap is the carry you drop.
وای دابنێ 256 پێکهاتەکە 256 دوکانن بە دەوری فولکەیەکی گەورەدا. زیادکردنی ژمارەیەک واتە ڕۆیشتن بۆ پێشەوە. ڕۆیشتنی 250 دوکان بۆ پێشەوە دەتگەیەنێتە هەمان ئەو دوکانەی کە بە گەڕانەوەی 6 دوکان بۆ دواوە دەیگەیتێ. یەک جار سووڕانەوەی تەواو (256 دوکان) هیچ ناگۆڕێت — ئەو خولە تەواوە ئەو کە فڕێی دەدەیت.
Where the analogy stops workingسنووری ئەم نموونەیە
The roundabout has no "too far": you can walk round forever. Numbers can: if the true answer is bigger than or smaller than it lands on the wrong shop. That is overflow (later in this lesson).
فولکەکە «زۆر دوور»ی نییە: دەتوانیت هەتاهەتایە بسووڕێیتەوە. بەڵام ژمارەکان هەیانە: ئەگەر وەڵامی ڕاستەقینە لە گەورەتر یان لە بچووکتر بێت، دەگاتە دوکانی هەڵە. ئەمە (دواتر لەم وانەیەدا).
Subtraction: add the 2's complementلێدەرکردن: تەواوکەری دوو زیاد بکە
Subtracting B is the same as adding −B. So a computer never needs a separate subtractor:
لێدەرکردنی B هەمان زیادکردنی ـە. بۆیە هەرگیز پێویستی بە ئامێرێکی جیای لێدەرکردن نییە:
Take the 2's complement of the number you subtract (the subtrahend): invert every bit and add 1. This changes its sign, whatever the sign was.
ئەو ژمارەیە وەربگرە کە لێی دەردەکەیت (لێدەرکراو): هەموو پێچەوانە بکەرەوە و 1 زیاد بکە. ئەمە نیشانەکەی دەگۆڕێت، هەر نیشانەیەک بووبێت.
Add it to the first number.
بیخە سەر ژمارەی یەکەم.
Discard any final carry.
هەر دوایین هەبوو فڕێی بدە.
If the subtrahend is negative, its 2's complement is positive: subtracting a negative number adds a positive one, e.g. .
ئەگەر لێدەرکراوەکە سالب بێت، موجەبە: لێدەرکردنی وەک زیادکردنی ، بۆ نموونە .
Subtraction: add the 2's complementلێدەرکردن: تەواوکەری دوو زیاد بکە
Four worked subtractionsچوار لێدەرکردنی شیکراوە
00001000−0000001100001000−00000011. 2's complement of
00000011: invert →11111100, add 1 →11111101(). Then00001000+11111101=1 00000101→ discard the carry →00000101= ..
00000011: پێچەوانە ←11111100، 1 زیاد بکە ←11111101(). پاشان00001000+11111101=1 00000101← فڕێ بدە ←00000101= .00001100−1111011100001100−11110111: subtracting a negative number is adding a positive one. 2's complement of
11110111: invert →00001000, add 1 →00001001(). Then00001100+00001001=00010101= .: لێدەرکردنی وەک زیادکردنی .
11110111: پێچەوانە ←00001000، 1 زیاد بکە ←00001001(). پاشان00001100+00001001=00010101= .11100111−0001001111100111−00010011. The 2's complement of
00010011is11101101(), so this is exactly case 4: the answer is11010100= ..
00010011دەکاتە11101101()، کەواتە ئەمە ڕێک حاڵەتی 4ـە: وەڵامەکە11010100= .10001000−1110001010001000−11100010: again, subtracting a negative number is adding a positive one. 2's complement of
11100010: invert →00011101, add 1 →00011110(). Then10001000+00011110=10100110= = .: دیسان لێدەرکردنی وەک زیادکردنی .
11100010: پێچەوانە ←00011101، 1 زیاد بکە ←00011110(). پاشان10001000+00011110=10100110= .
Overflow: when the answer does not fitسەرڕێژبوون: کاتێک وەڵامەکە جێی نابێتەوە
8 bits hold only to . What is ? The true answer, 150, does not fit. The adder still produces 8 bits — and they are wrong:
8 تەنها تا هەڵدەگرن. چەندە؟ وەڵامی ڕاستەقینە (150) جێی نابێتەوە. هەر 8 دەدات — و هەڵەن:
An error in which the true result of a calculation does not fit in the available bits. In 2's-complement addition it happens when two numbers with the same sign give a result with the other sign.
هەڵەیەکە کە تێیدا ئەنجامی ڕاستەقینەی هەژمارێک لە جێی نابێتەوە. لە کۆکردنەوەی ڕوو دەدات کاتێک دوو ژمارەی هاونیشانە ئەنجامێک دەدەن کە نیشانەکەی پێچەوانەیە.
Two positive numbers cannot add up to a negative number, so the answer is clearly wrong. This is overflow. The same happens below : gives 1 01101010 → 01101010 = .
دوو ناتوانن کۆیان سالب بێت، بۆیە وەڵامەکە بە ئاشکرا هەڵەیە. ئەمە . هەمان شت لە خوار ـەوە ڕوو دەدات: دەکاتە 1 01101010 ← 01101010 = .
Overflow: when the answer does not fitسەرڕێژبوون: کاتێک وەڵامەکە جێی نابێتەوە
Two ways to spot overflowدوو ڕێگا بۆ ناسینەوەی سەرڕێژبوون
- Sign rule: overflow can happen only when both numbers have the same sign. It has happened if the answer has the other sign.
- Carry rule: look at the sign-bit column. Overflow has happened if the carry into it differs from the carry out of it.
- یاسای نیشانە: تەنها کاتێک ڕوو دەدات کە هەردوو ژمارەکە هەمان نیشانەیان هەبێت. ئەگەر وەڵامەکە نیشانەی پێچەوانەی هەبێت، ڕووی داوە.
- یاسای : سەیری ستوونی بکە. ئەگەر بۆ ناوی جیاواز بێت لە بۆ دەرەوەی، ڕووی داوە.
Why can two numbers with different signs never overflow? Their sum always lies between them, and both of them already fit.
بۆچی دوو ژمارە بە نیشانەی جیاواز هەرگیز نادەن؟ کۆکەیان هەمیشە لە نێوانیاندایە و هەردووکیان پێشتر جێیان بووەتەوە.
An old stadium scoreboard has two digit panels for each team. After 99 goals, one more goal shows 00. The board is not broken; the true score simply needs a third digit that the board does not have.
تابلۆیەکی کۆنی یاریگا بۆ هەر تیمێک دوو پانێڵی هەیە. دوای 99 گۆڵ، گۆڵێکی تر 00 پیشان دەدات. تابلۆکە تێک نەچووە؛ ئەنجامی ڕاستەقینە تەنها پێویستی بە سێیەمە کە تابلۆکە نییەتی.
Where the analogy stops workingسنووری ئەم نموونەیە
In 2's complement the wrap does not go to 0 but across the line between and , so the wrong answer even has the wrong sign. That is what makes the sign rule work.
لە سووڕانەوەکە ناچێتە سەر 0، بەڵکو بە سەر هێڵی نێوان و دا دەپەڕێتەوە، بۆیە وەڵامە هەڵەکە تەنانەت نیشانەکەشی هەڵەیە. ئەمەیە کە یاسای نیشانە کارپێدەکات.
Overflow: when the answer does not fitسەرڕێژبوون: کاتێک وەڵامەکە جێی نابێتەوە
A carry out is not overflowگواستراوەی دەرەوە سەرڕێژبوون نییە
Do not confuse the discarded carry with overflow. In the examples of this lesson a 9th bit appeared several times and every answer was right. The table compares the carry into the sign column with the carry out of it. For unsigned numbers the rule is different: there the carry out of the leftmost bit is the overflow (When the answer does not fit).
فڕێدراو و تێکەڵ مەکە. لە نموونەکانی ئەم وانەیەدا چەند جار نۆیەم دەرکەوت و هەموو وەڵامەکان ڕاست بوون. خشتەکە بۆ ناو ستوونی نیشانە لەگەڵ بۆ دەرەوەی بەراورد دەکات. بۆ یاساکە جیاوازە: لەوێدا دەرەوەی لای چەپترین خۆی (کاتێک وەڵامەکە جێی نابێتەوە).
| Sumکۆکردنەوە | Carry into sign bit بۆ ناو | Carry out بۆ دەرەوە | 8-bit answerوەڵامی 8 بیتی | Correct?ڕاستە؟ |
|---|---|---|---|---|
| 1 | 1 | yesبەڵێ | ||
| 0 | 0 | yesبەڵێ | ||
| 1 | 1 | yesبەڵێ | ||
| 1 | 1 | yesبەڵێ | ||
| 1 | 0 | no: overflowنەخێر: | ||
| 0 | 1 | no: overflowنەخێر: |
An exam question: پرسیارێکی تاقیکردنەوە:
A midterm asked: express each number as an 8-bit signed number and add: . Here is the full working.
پرسیارێکی تاقیکردنەوەی نیوەی وەرز: هەر ژمارەیەک وەک 8 بیتی بنووسە و کۆیان بکەرەوە: . ئەمە هەموو هەژمارەکەیە.
- Sign-magnitude formsشێوەکانی نیشانە و نرخی ڕووت
=
00011011→ sign-magnitude10011011. =00100101→ sign-magnitude10100101.=
00011011←10011011. =00100101←10100101. - 2's complement formsشێوەکانی تەواوکەری دوو
: invert
00011011→11100100, add 1 →11100101. : invert00100101→11011010, add 1 →11011011.:
00011011پێچەوانە بکەرەوە ←11100100، 1 زیاد بکە ←11100101. :00100101پێچەوانە بکەرەوە ←11011010، 1 زیاد بکە ←11011011. - Addکۆ بکەرەوە
11100101+11011011=1 11000000.11100101+11011011=1 11000000. - Read the answerوەڵامەکە بخوێنەرەوە
Discard the 9th bit:
11000000= = . Both inputs negative, answer negative, carries into and out of the sign bit both 1: no overflow.نۆیەم فڕێ بدە:
11000000= . هەردوو ژمارەکە سالبن، وەڵامەکەش سالبە و ناو و دەرەوەی هەردووکیان 1ن: نییە.
Exercisesڕاهێنانەکان
Add in 8-bit 2's complement: (a) (b) (c) (d) .
بە 8 بیتی کۆیان بکەرەوە: (أ) (ب) (ج) (د) .
Show answerوەڵامەکە پیشان بدە
- (a)
00000111+00000100=00001011= - (b)
00001111+11111010=1 00001001→00001001= - (c)
00010000+11101000=11111000= - (d) =
11111011(from00000101→11111010→11111011), =11110111(from00001001→11110110→11110111);11111011+11110111=1 11110010→11110010= =
- (أ)
00000111+00000100=00001011، واتە - (ب)
00001111+11111010=1 00001001؛ فڕێ بدە:00001001، واتە - (ج)
00010000+11101000=11111000، واتە - (د) =
11111011(لە00000101←11111010←11111011)، =11110111(لە00001001←11110110←11110111)؛11111011+11110111=1 11110010←11110010= =
Subtract (8-bit 2's complement): (a) 00001000 − 00000011 (b) 00001100 − 11110111 (c) 11010111 − 00100011 (d) 10001000 − 11100010.
لێک دەریان بکە (بە 8 بیتی): (أ) 00001000 − 00000011 (ب) 00001100 − 11110111 (ج) 11010111 − 00100011 (د) 10001000 − 11100010.
Show answerوەڵامەکە پیشان بدە
- (a) :
00001000+11111101=1 00000101→ - (b) :
00001100+00001001=00010101→ - (c) : 2's complement of
00100011is11011101();11010111+11011101=1 10110100→10110100= = - (d) :
10001000+00011110=10100110→
- (أ) :
00001000+11111101=1 00000101؛ فڕێ بدە: - (ب) :
00001100+00001001=00010101، واتە - (ج) :
00100011دەکاتە11011101()؛11010111+11011101=1 10110100←10110100= = - (د) :
10001000+00011110=10100110، واتە
Add in 8-bit 2's complement and say whether the answer overflows: (a) (b) (c) . (d) In 4 bits: .
بە 8 بیتی کۆیان بکەرەوە و بڵێ ئایا وەڵامەکە دەدات: (أ) (ب) (ج) . (د) بە 4 : .
Hintئاماژە
Same signs in, other sign out → overflow.
نیشانەی وەک یەک بۆ ناوەوە و نیشانەی پێچەوانە بۆ دەرەوە ← .
Show answerوەڵامەکە پیشان بدە
- (a)
01111000+00001010=10000010= . Two positives gave a negative: overflow (). - (b)
01011010+11011000=1 00110010→00110010= . Different signs: no overflow. - (c)
10000000+11111111=1 01111111→01111111= . Two negatives gave a positive: overflow (). - (d)
0101+0100=1001= in 4 bits. Overflow: 4 bits hold only … .
- (أ)
01111000+00001010=10000010= . دوو موجەب سالبیان دا: (). - (ب)
01011010+11011000=1 00110010←00110010= . نیشانەی جیاواز: نییە. - (ج)
10000000+11111111=1 01111111←01111111= . دوو سالب موجەبیان دا: (). - (د)
0101+0100=1001= بە 4 . : 4 تەنها … هەڵدەگرن.
Common mistakesهەڵە باوەکان
| Mistakeهەڵە | Fixچارەسەر |
|---|---|
Adding numbers of different widths, e.g. 1011 + 00000110.کۆکردنەوەی ژمارە بە پانیی جیاواز، بۆ نموونە 1011 + 00000110. | Write both numbers with the same number of bits before you add.پێش کۆکردنەوە هەردوو ژمارەکە بە هەمان ژمارەی بنووسە. |
| Keeping the 9th bit and reading a 9-bit answer.هێشتنەوەی نۆیەم و خوێندنەوەی وەڵامێکی 9 بیتی. | Discard the final carry; the answer has 8 bits.دوایین فڕێ بدە؛ وەڵامەکە 8 . |
| Thinking a carry out means the answer is wrong.وا بزانیت دەرەوە واتە وەڵامەکە هەڵەیە. | Check overflow with the sign rule or the carry rule, not with the carry out alone. بە یاسای نیشانە یان یاسای بپشکنە، نەک تەنها بە دەرەوە. |
| Subtracting by taking the 2's complement of the first number.لێدەرکردن بە وەرگرتنی ژمارەی یەکەم. | Complement the number you take away (the subtrahend), then add. ئەو ژمارەیە وەربگرە کە لێی دەردەکەیت (لێدەرکراو)، پاشان کۆی بکەرەوە. |
| Adding sign-magnitude patterns bit by bit.کۆکردنەوەی پێکهاتەکانی بە . | Turn negative numbers into 2's complement first.سەرەتا بگۆڕە بۆ . |
Reading a negative answer like 11010100 as 212 or .خوێندنەوەی وەڵامێکی سالبی وەک 11010100 بە 212 یان . | Use the weight: . بە بژمێرە: . |
Summaryپوختە
- In 2's complement, signed numbers are added like unsigned numbers, sign bits included.
- Discard any carry out of the leftmost bit: it is one full turn of 256 (for 8 bits).
- The four cases (both positive, positive larger, negative larger, both negative) all use the same method.
- : take the 2's complement of the subtrahend and add.
- Overflow: the true answer is outside … . It happens only with same-sign inputs; the answer then has the wrong sign, and the carries into and out of the sign bit differ.
- لە وەک کۆ دەکرێنەوە، .
- هەر لە لای چەپترین دەرچوو فڕێی بدە: یەک خولی تەواوی 256ـە (بۆ 8 ).
- چوار حاڵەتەکە (هەردووکیان موجەب، موجەب گەورەتر، سالب گەورەتر، هەردووکیان سالب) هەموویان هەمان ڕێگا بەکار دەهێنن.
- : لێدەرکراوەکە وەربگرە و کۆی بکەرەوە.
- : وەڵامی ڕاستەقینە لە دەرەوەی … ـە. تەنها لەگەڵ ژمارەی هاونیشانە ڕوو دەدات؛ ئەو کاتە وەڵامەکە نیشانەی هەڵەی هەیە و ناو و دەرەوەی جیاوازن.
Why does a computer not need a subtractor circuit?بۆچی کۆمپیوتەر پێویستی بە سووڕێکی لۆجیکیی تایبەت بە لێدەرکردن نییە؟
Because , and is just the 2's complement of , made by inverting the bits and adding 1. The same adder does the rest.
چونکە و تەنها Bـیە کە بە پێچەوانەکردنەوەی و زیادکردنی 1 دروست دەبێت. هەمان ئەوەی تر دەکات.
Can overflow in 8 bits?ئایا بە 8 بیت سەرڕێژبوون دەدات؟
No. The signs differ, so the sum () lies between the two numbers and always fits.
نەخێر. نیشانەکان جیاوازن، بۆیە کۆکە () لە نێوان دوو ژمارەکەدایە و هەمیشە جێی دەبێتەوە.
Videoڤیدیۆ
Watch a videoسەیری ڤیدیۆیەک بکە
A video that viewers liked a lot and praised in their comments, chosen for this lesson.ڤیدیۆیەک کە بینەران زۆریان پێ خۆش بووە و لە کۆمێنتەکانیاندا ستایشیان کردووە، بۆ ئەم وانەیە هەڵبژێردراوە.
Why computers use 2's complement: sign-and-magnitude spoils ordinary addition, while 2's complement lets one adder add signed numbers and flag overflow.
هۆی بەکارهێنانی : کۆکردنەوەی ئاسایی تێک دەدات، بەڵام بە یەک کۆ دەکات و دەدۆزێتەوە.
Starts at 2:50 (binary additions with signs); 5:31 two's complement; 10:21 a worked example.
لە 2:50ـەوە دەست پێ دەکات (کۆکردنەوەی بە )؛ 5:31 ؛ 10:21 نموونەیەکی شیکراوە.
Lesson complete!وانەکە تەواو بوو!
Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.
Key termsزاراوە سەرەکییەکان
Binary Coded Decimal (BCD)کۆدی دەیی دووانی
Related lecturesوانە پەیوەندیدارەکان
References and further readingسەرچاوەکان و خوێندنەوەی زیاتر
- Wikipedia: Two's complement (addition, subtraction and overflow)
- Wikipedia: Signed number representations
- MIT OpenCourseWare 6.004 Computation Structures (Spring 2017): signed integers and two's complement (video transcript)
- University of Delaware CPEG 222, Programmed Introduction to MIPS Assembly, ch. 8: overflow detection
This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.