Chapterبەش 2 · Lectureوانە 2.4

Binary, Octal and Hex Shortcutsڕێگا کورتەکانی دووانی، هەشتی و شانزەیی

Convert between binary, octal and hexadecimal without any division: 3 bits per octal digit, 4 bits per hex digit, groups that start at the binary point, and octal ⇄ hex through binary.

گۆڕین لە نێوان ، و بێ هیچ دابەشکردنێک: 3 بۆ هەر ، 4 بۆ هەر ، دەستەگەلێک کە لە دەست پێدەکەن و ⇄ لە ڕێگەی .

13 min read14 خولەک خوێندنەوە · 14 stepsهەنگاو

What you will learnچی فێر دەبیت

  • Explain why one octal digit equals 3 bits and one hex digit equals 4 bits.
  • Convert octal and hex numbers to binary digit by digit.
  • Convert binary numbers, also with a fraction, to octal and hex by grouping from the binary point.
  • Convert between octal and hex through binary and check the result in decimal.
  • ڕوونی بکەیتەوە بۆچی یەک یەکسانە بە 3 و یەک یەکسانە بە 4 .
  • ژمارەی و بە بگۆڕیت بۆ .
  • ژمارەی ، کەرتداریشیان، بە دەستەکردن لە بگۆڕیت بۆ و .
  • لە ڕێگەی لە نێوان و بگۆڕیت و ئەنجامەکە بە بپشکنیت.

Why binary, octal and hex fit togetherبۆچی دووانی، هەشتی و شانزەیی لەگەڵ یەک دەگونجێن

In the conversion lessons you changed numbers by dividing and multiplying. That works for every pair of bases. Between binary, octal and hexadecimal there is a much faster way: no division and no multiplication, only grouping bits.

لە وانەکانی گۆڕیندا ژمارەکانت بە دابەشکردن و لێکدان گۆڕی. ئەو ڕێگایە بۆ هەموو جووتێک لە کار دەکات. بەڵام لە نێوان ، و ڕێگایەکی زۆر خێراتر هەیە: نە دابەشکردن و نە لێکدان، تەنها دەستەکردنی .

The reason is simple: 8 and 16 are powers of 2.

هۆکارەکەی سادەیە: 8 و ⁦16⁩ توانێکی 2ن.

8=2316=248 = 2^3 \qquad\qquad 16 = 2^4

So one octal digit is worth exactly 3 bits and one hex digit exactly 4 bits. Three bits have exactly 8 patterns (000 to 111), one for each octal digit 0–7. Four bits have exactly 16 patterns (0000 to 1111), one for each hex digit 0–F.

کەواتە یەک ڕێک بەهای 3 و یەک ڕێک بەهای 4 دەگرێت. سێ ڕێک 8 شێوەیان هەیە (⁦000⁩ تا ⁦111⁩)، یەکێک بۆ هەر لە 0 تا 7. چوار ڕێک ⁦16⁩ شێوەیان هەیە (⁦0000⁩ تا ⁦1111⁩)، یەکێک بۆ هەر لە 0 تا F.

Quick checkپشکنینی خێراWhy can one hex digit replace exactly four bits?بۆچی یەک دەتوانێت ڕێک جێگەی چوار بگرێتەوە؟

Groups of four: nibbles and bytesدەستەی چوار: نیبڵ و بایت

A digit and its group of bits are two names for the same value. A group of 4 bits has its own name, a , and two hex digits describe exactly one . This is why programmers write long bit patterns in hex: 16 bits become only 4 characters. Nibbles, bytes and the larger groups called words are compared in Nibbles and words.

و دەستە دوو ناون بۆ هەمان بەها. دەستەی 4 ناوێکی تایبەتی هەیە: . دوو ڕێک یەک دەنووسن. بۆیە بەرنامەنووسان شێوە درێژەکانی بە دەنووسن: ⁦16⁩ تەنها دەبنە 4 . ، و ئەو دەستە گەورەترانەی پێیان دەوترێت لە نیبڵەکان و وشەکان بەراورد کراون.

Phone numbers in groupsژمارەی مۆبایل بە دەستە

Nobody reads a phone number as 07501234567. We write it in groups, 0750  123  45670750\;123\;4567, so it is easy to read, compare and remember. Hex does the same for bits, and it goes one step further: each group of four bits is replaced by one symbol. The 16 bits 0110  0101  0010  10110110\;0101\;0010\;1011 become simply 652B.

کەس ژمارەی مۆبایل بەم شێوەیە ناخوێنێتەوە: ⁦07501234567⁩. بە دەستە دەینووسین، 0750  123  45670750\;123\;4567، تا خوێندنەوە و بەراوردکردن و لەبەرکردنی ئاسان بێت. هەمان کار بە دەکات و هەنگاوێکیش زیاتر دەڕوات: هەر دەستەیەکی چوار بە یەک هێما دەگۆڕێت. ⁦16⁩ 0110  0101  0010  10110110\;0101\;0010\;1011 تەنها دەبنە ⁦652B⁩.

Where the analogy stops workingسنووری ئەم نموونەیە

Spaces in a phone number change nothing. Here each group becomes a new digit, so the groups must start at the right place (the binary point). Groups that start in the wrong place give a different number.

بۆشایی لە ژمارەی مۆبایلدا هیچ ناگۆڕێت. بەڵام لێرەدا هەر دەستەیەک دەبێتە نوێ، بۆیە دەبێت دەستەکان لە شوێنی دروستەوە دەست پێبکەن (). ئەگەر لە شوێنی هەڵەوە دەست پێبکەن، ژمارەیەکی تر دەردەچێت.

Quick checkپشکنینی خێراSpaces in a phone number can go anywhere. Why must groups of bits start at the binary point?بۆشایی لە ژمارەی مۆبایلدا دەتوانێت لە هەر شوێنێک بێت. بۆچی دەبێت دەستەکانی لە دەست پێبکەن؟

The only table you needتاکە خشتەیەک کە پێویستت پێیەتی

Every shortcut in this lesson uses one small table. You do not need to learn it by heart: the bit weights are 4  2  14\;2\;1 for octal and 8  4  2  18\;4\;2\;1 for hex, so you can always rebuild a row by adding weights.

هەموو ڕێگا کورتەکانی ئەم وانەیە یەک خشتەی بچووک بەکاردەهێنن. پێویست ناکات لەبەری بکەیت: کێشی بۆ 4  2  14\;2\;1ـە و بۆ 8  4  2  18\;4\;2\;1، بۆیە هەمیشە دەتوانیت هەر ڕیزێک بە کۆکردنەوەی کێشەکان دروست بکەیتەوە.

Octal digits stop at 7 (— means: no octal digit). Hex continues with A=10\text{A} = 10 up to F=15\text{F} = 15. لە 7دا دەوەستن (— واتە نییە). بە A=10\text{A} = 10 تا F=15\text{F} = 15 بەردەوام دەبێت.
ValueبەهاOctal digit = 3 bits = 3 Hex digit = 4 bits = 4
00=0000 = 0000=00000 = 0000
11=0011 = 0011=00011 = 0001
22=0102 = 0102=00102 = 0010
33=0113 = 0113=00113 = 0011
44=1004 = 1004=01004 = 0100
55=1015 = 1015=01015 = 0101
66=1106 = 1106=01106 = 0110
77=1117 = 1117=01117 = 0111
8—8=10008 = 1000
9—9=10019 = 1001
10—A=1010\text{A} = 1010
11—B=1011\text{B} = 1011
12—C=1100\text{C} = 1100
13—D=1101\text{D} = 1101
14—E=1110\text{E} = 1110
15—F=1111\text{F} = 1111
  • The largest 3-bit group is 111=4+2+1=7111 = 4+2+1 = 7, the largest octal digit.
  • The largest 4-bit group is 1111=8+4+2+1=15=F1111 = 8+4+2+1 = 15 = \text{F}, the largest hex digit.
  • Always write all the bits of a group, also the zeros on its left: 2 is 010 in octal and 0010 in hex.
  • گەورەترین دەستەی 3 111=4+2+1=7111 = 4+2+1 = 7ـە، کە گەورەترین .
  • گەورەترین دەستەی 4 1111=8+4+2+1=15=F1111 = 8+4+2+1 = 15 = \text{F}ـە، کە گەورەترین .
  • هەمیشە هەموو دەستەیەک بنووسە، سفرەکانی لای چەپیشی: 2 لە ⁦010⁩ـە و لە ⁦0010⁩.
Quick checkپشکنینی خێراWhich group of four bits is the hex digit C?کام دەستەی چوار Cـیە؟

Octal to binary: three bits for each digitهەشتی بۆ دووانی: سێ بیت بۆ هەر تاکژمارەیەک

To change an octal number into binary, replace each octal digit with its 3-bit group. Nothing else is needed, because every octal digit is worth exactly three bits.

بۆ گۆڕینی ژمارەیەکی بۆ ، هەر بە دەستە 3 بگۆڕە. هیچی تر پێویست نییە، چونکە هەر ڕێک بەهای سێ دەگرێت.

7526↓↓↓↓111101010110(7526)8=(111 101 010 110)2\begin{array}{cccc} 7 & 5 & 2 & 6 \\ \downarrow & \downarrow & \downarrow & \downarrow \\ 111 & 101 & 010 & 110 \end{array}\qquad (7526)_8 = (111\,101\,010\,110)_2

Each digit drops down into three bits. The middle zeros stay: 2 is 010, never just 10.

هەر دادەبەزێت و دەبێتە سێ . سفرەکانی ناوەڕاست دەمێننەوە: 2 دەبێتە ⁦010⁩، هەرگیز تەنها ⁦10⁩ نا.

Check: (7526)8=7⋅512+5⋅64+2⋅8+6=3926(7526)_8 = 7\cdot512 + 5\cdot64 + 2\cdot8 + 6 = 3926 and (111101010110)2=3926(111101010110)_2 = 3926 too. Zeros at the far left of the answer may be dropped at the end, because they add nothing: (13)8=001 011=(1011)2(13)_8 = 001\,011 = (1011)_2.

پشکنین: (7526)8=7⋅512+5⋅64+2⋅8+6=3926(7526)_8 = 7\cdot512 + 5\cdot64 + 2\cdot8 + 6 = 3926 و (111101010110)2(111101010110)_2ـیش هەر ⁦3926⁩ـە. سفرەکانی تەواو لای چەپی وەڵامەکە لە کۆتاییدا دەتوانرێت لاببرێن، چونکە هیچ زیاد ناکەن: (13)8=001 011=(1011)2(13)_8 = 001\,011 = (1011)_2.

Quick checkپشکنینی خێراWhat is (52)8(52)_8 in binary?(52)8(52)_8 بە چەندە؟

Binary to octal: groups of three, starting at the pointدووانی بۆ هەشتی: دەستەی سێیی، لە خاڵەکەوە

Going the other way, cut the bits into groups of three and turn each group into one octal digit. The only thing to be careful about is where the groups start.

بۆ پێچەوانەکەی، بکە بە دەستەی سێ‌سێ و هەر دەستەیەک بکە بە یەک . تاکە شت کە دەبێت ئاگات لێی بێت شوێنی دەستپێکردنی دەستەکانە.

  1. Find the . In a whole number it sits after the last bit on the right.

    بدۆزەرەوە. لە ژمارەیەکی بێ کەرتدا دوای دوایین لە لای ڕاستەوەیە.

  2. From the point, make groups of three: going left for the whole part, going right for the fraction part.

    لە خاڵەکەوە دەستەی سێ‌سێ دروست بکە: بۆ بەشی تەواو بەرەو چەپ، بۆ بەشی بەرەو ڕاست.

  3. If the last group on the left is short, add zeros on its left. If the last group of the fraction is short, add zeros on its right. These zeros do not change the value (one or two zeros are always enough).

    ئەگەر دوایین دەستەی لای چەپ کورت بوو، سفر بخە لای چەپی. ئەگەر دوایین دەستەی بەشی کورت بوو، سفر بخە لای ڕاستی. ئەم سفرانە بەهاکە ناگۆڕن (یەک یان دوو سفر هەمیشە بەسە).

  4. Replace every group with its octal digit and keep the point where it was.

    هەر دەستەیەک بە خۆی بگۆڕە و خاڵەکە لە شوێنی خۆیدا بهێڵەوە.

Quick checkپشکنینی خێراYou convert (10.1)2(10.1)_2 to octal. Where do the zeros go?(10.1)2(10.1)_2 دەگۆڕیت بۆ . سفرەکان دەچنە کوێ؟

Grouping in threes: two worked examplesدەستەکردن بە سێ‌سێ: دوو نموونەی چارەسەرکراو

Two worked examples of grouping bits in threes from the binary point. First: 111.1011 is grouped as 111 . 101 100, where two zeros are added at the right end of the fraction, giving 7.54 in octal. Second: 1011.01 is grouped as 001 011 . 010, with two zeros added at the left and one zero at the right, giving 13.2 in octal. The added zeros are highlighted.دوو نموونەی چارەسەرکراوی دەستەکردنی بیتەکان بە سێ‌سێ لە خاڵە دووانییەکەوە. یەکەم: 111.1011 دەبێتە 111 . 101 100، دوو سفر لە کۆتایی لای ڕاستی بەشی کەرت زیاد کراون و ئەنجام 7.54ـی هەشتییە. دووەم: 1011.01 دەبێتە 001 011 . 010، دوو سفر لە لای چەپ و یەک سفر لە لای ڕاست زیاد کراون و ئەنجام 13.2ـی هەشتییە. سفرە زیادکراوەکان ڕەنگیان جیاوازە.
Groups grow outwards from the binary point. Added zeros (orange) sit on the outside, where they cannot change the value.دەستەکان لە بەرەو دەرەوە دروست دەبن. سفرە زیادکراوەکان (پرتەقاڵی) لە لای دەرەوەن، لەوێ بەهاکە ناگۆڕن.CêIT

In the first example the fraction .1011 has four bits: the first group is 101 and the single 1 left over becomes 100. So (111.1011)2=(7.54)8(111.1011)_2 = (7.54)_8. Both are worth 7.6875 in decimal.

لە نموونەی یەکەمدا بەشی .⁦1011⁩ چوار هەیە: دەستەی یەکەم ⁦101⁩ـە و ئەو 1ـەی دەمێنێتەوە دەبێتە ⁦100⁩. کەواتە (111.1011)2=(7.54)8(111.1011)_2 = (7.54)_8. هەردووکیان لە ⁦7.6875⁩ـن.

Quick checkپشکنینی خێراWhat is (11010.1)2(11010.1)_2 in octal?(11010.1)2(11010.1)_2 بە چەندە؟

Hex to binary: four bits for each digitشانزەیی بۆ دووانی: چوار بیت بۆ هەر تاکژمارەیەک

Hex works exactly like octal, only with groups of four. Replace each hex digit with its 4-bit group. Change a letter to its value first: A=10=1010\text{A} = 10 = 1010.

ڕێک وەک کار دەکات، تەنها بە دەستەی چوارچواری. هەر بە دەستە 4 بگۆڕە. سەرەتا پیتەکە بکە بە بەهاکەی: A=10=1010\text{A} = 10 = 1010.

10A4↓↓↓↓0001000010100100(10A4)16=(0001 0000 1010 0100)2\begin{array}{cccc} 1 & 0 & \text{A} & 4 \\ \downarrow & \downarrow & \downarrow & \downarrow \\ 0001 & 0000 & 1010 & 0100 \end{array}\qquad (\text{10A4})_{16} = (0001\,0000\,1010\,0100)_2

The three zeros at the far left can be dropped: the same number is 1000010100100 in binary (4260 in decimal).

سێ سفرەکەی تەواو لای چەپ دەتوانرێت لاببرێن: هەمان ژمارە بە ⁦1000010100100⁩ـە (لە ⁦4260⁩).

Notice the digit 0 in the middle: it becomes 0000, a full group of four zeros. Leaving it out would move every bit on its left by four places and change the number completely.

سەرنجی 0 بدە لە ناوەڕاستدا: دەبێتە ⁦0000⁩، دەستەیەکی تەواوی چوار سفر. ئەگەر لای ببەیت، هەموو لای چەپی چوار شوێن دەجووڵێن و ژمارەکە بە تەواوی دەگۆڕێت.

Quick checkپشکنینی خێراWhat is (2F)16(\text{2F})_{16} in binary?(2F)16(\text{2F})_{16} بە چەندە؟

How To Easily Convert Hexadecimal To Binary And To Decimal TutorialNullChef · Englishئینگلیزی · 204K viewsبینین · 4.8K likesلایک

Hex to binary: replace each hex digit by its four bits, then read the whole number.

بۆ : هەر بە چوار بگۆڕە، پاشان هەموو ژمارەکە بخوێنەوە.

Chapters: 1:26 basic example, 3:34 advanced example; it then turns the bits into decimal.

بەشەکان: ⁦1:26⁩ نموونەیەکی سادە، ⁦3:34⁩ نموونەیەکی قورستر؛ پاشان دەگۆڕێت بۆ .

Binary to hex: groups of fourدووانی بۆ شانزەیی: دەستەی چوارچواری

Cut the bits into groups of four, starting at the binary point (at the right end of a whole number), add zeros to complete the last group, and replace each group with its hex digit. With four-bit groups you may need up to three zeros.

بکە بە دەستەی چوارچواری، لە دەست پێبکە (لە سەری ڕاستی ژمارەی بێ )، بۆ تەواوکردنی دوایین دەستە سفر زیاد بکە و هەر دەستەیەک بە خۆی بگۆڕە. لە دەستەی چوار لەوانەیە تا سێ سفرت پێویست بێت.

Animation. The 15 bits 110010100101011 are shown in a row. A bracket of four bits moves in from the right: 1011 becomes B, 0010 becomes 2, 0101 becomes 5, and the last three bits 110 get one zero in front, 0110, and become 6. The result reads 652B in hex. Then the same bits are regrouped in threes: 110 010 100 101 011, which read 62453 in octal.
Animation. The 15 bits 110010100101011 are shown in a row. A bracket of four bits moves in from the right: 1011 becomes B, 0010 becomes 2, 0101 becomes 5, and the last three bits 110 get one zero in front, 0110, and become 6. The result reads 652B in hex. Then the same bits are regrouped in threes: 110 010 100 101 011, which read 62453 in octal.
The same 15 bits read in fours give hex 652B, and read in threes give octal 62453. Both are 25899 in decimal.هەمان ⁦15⁩ بە چوارچوار دەبنە ⁦652B⁩ـی و بە سێ‌سێ دەبنە ⁦62453⁩ـی . هەردووکیان لە ⁦25899⁩ـن.CêIT
(110010100101011)2  →  0110⏟6  0101⏟5  0010⏟2  1011⏟B  →  (652B)16(110010100101011)_2 \;\rightarrow\; \underbrace{0110}_{6}\;\underbrace{0101}_{5}\;\underbrace{0010}_{2}\;\underbrace{1011}_{\text{B}} \;\rightarrow\; (\text{652B})_{16}

The lecture's example: 15 bits, so the left group gets one added zero.

نموونەکەی وانەکە: ⁦15⁩ ، بۆیە دەستەی لای چەپ یەک سفری بۆ زیاد دەکرێت.

A fraction works the same way, with zeros added on the right of the last fraction group: (1011.01)2=1011 . 0100=(B.4)16(1011.01)_2 = 1011\,.\,0100 = (\text{B.4})_{16}, and both are 11.25.

بەشی بە هەمان شێوەیە و سفرەکان دەخرێنە لای ڕاستی دوایین دەستەی : (1011.01)2=1011 . 0100=(B.4)16(1011.01)_2 = 1011\,.\,0100 = (\text{B.4})_{16} و هەردووکیان ⁦11.25⁩ـن.

Quick checkپشکنینی خێراHow many zeros must you add to (1001101)2(1001101)_2 to make complete hex groups?چەند سفر دەبێت بۆ (1001101)2(1001101)_2 زیاد بکەیت تا دەستە تەواو بن؟

Octal to hex and back: binary is the bridgeهەشتی بۆ شانزەیی و بە پێچەوانەوە: دووانی پردەکەیە

The lecture asks for octal ⇄ hex conversions but shows no method. There is no direct digit-for-digit rule, because an octal digit is 3 bits and a hex digit is 4 bits. Binary is the bridge: digits → bits → regroup → digits.

وانەکە داوای گۆڕینی ⇄ دەکات، بەڵام هیچ ڕێگایەک پیشان نادات. یاسایەکی ڕاستەوخۆی بە نییە، چونکە 3 و 4 . پردەکەیە: ← ← دووبارە دەستەکردن ← .

  1. Octal digits to bitsتاکژمارەکانی هەشتی بۆ بیتەکان

    Write each digit of (732)8(732)_8 as three bits.

    هەر (732)8(732)_8 بە سێ بنووسە.

    732↓↓↓111011010\begin{array}{ccc} 7 & 3 & 2 \\ \downarrow & \downarrow & \downarrow \\ 111 & 011 & 010 \end{array}
  2. Regroup in foursدووبارە بە چوارچوار دەستە بکە

    Forget the old groups. From the right, cut the same bits into groups of four and complete the last group with zeros.

    دەستە کۆنەکان لەبیر بکە. لە لای ڕاستەوە هەمان بکە بە دەستەی چوارچواری و دوایین دەستە بە سفر تەواو بکە.

    111011010  →  0001  1101  1010111011010 \;\rightarrow\; 0001\;1101\;1010
  3. Bits to hex digitsبیتەکان بۆ تاکژمارەکانی شانزەیی

    Read each 4-bit group as one hex digit.

    هەر دەستەیەکی 4 وەک یەک بخوێنەرەوە.

    0001⏟1  1101⏟D  1010⏟A  ⇒  (732)8=(1DA)16\underbrace{0001}_{1}\;\underbrace{1101}_{\text{D}}\;\underbrace{1010}_{\text{A}} \;\Rightarrow\; (732)_8 = (\text{1DA})_{16}

Hex to octal is the same road in the other direction: four bits per hex digit, then groups of three from the right. You could also go through decimal ((732)8=474=(1DA)16(732)_8 = 474 = (\text{1DA})_{16}), but that needs division; the binary bridge needs none, so use decimal only to check your answer.

بۆ هەمان ڕێگایە بە ئاڕاستەی پێچەوانە: چوار بۆ هەر ، پاشان دەستەی سێ‌سێ لە لای ڕاستەوە. دەتوانیت بە تێپەڕیت ((732)8=474=(1DA)16(732)_8 = 474 = (\text{1DA})_{16})، بەڵام ئەوە دابەشکردنی دەوێت؛ پردی هیچی ناوێت، بۆیە تەنها بۆ پشکنینی وەڵامەکەت بەکاربهێنە.

Quick checkپشکنینی خێراYou convert (A85)16(\text{A85})_{16} to octal through binary. Which grouping is right?(A85)16(\text{A85})_{16} لە ڕێگەی دەگۆڕیت بۆ . کام دەستەکردن دروستە؟

Where you meet hex and octal todayئەمڕۆ لە کوێ شانزەیی و هەشتی دەبینیت

These shortcuts are not only exam topics. Hex is everywhere a person must read bits, and octal survives in one famous place.

ئەم ڕێگا کورتانە تەنها بابەتی تاقیکردنەوە نین. لە هەر شوێنێکدا هەیە کە مرۆڤ دەبێت بخوێنێتەوە و لە شوێنێکی ناسراودا ماوەتەوە.

  • Colours on web pages. You met #FF8800 in Number systems. With this lesson's shortcut you can see its bits at once: red FF=1111  1111\text{FF} = 1111\;1111 (fully on), green 88=1000  100088 = 1000\;1000, blue 00=0000  000000 = 0000\;0000. Each pair of hex digits is one byte.
  • Characters. numbers every character in hex. The Kurdish letter ە is U+06D5, which is the bit pattern 0000  0110  1101  01010000\;0110\;1101\;0101.
  • Memory and errors. Memory addresses, error codes and network hardware addresses are printed in hex, because one hex digit shows exactly four bits.
  • File permissions (octal). On Linux, chmod 755 gives three octal digits for owner, group and others. Each digit is 3 bits: read (4), write (2), execute (1). So 7=1117 = 111 means rwx and 5=1015 = 101 means r-x.
  • ڕەنگەکانی . #FF8800ـت لە سیستەمە ژمارەییەکان بینی. بەم ڕێگا کورتە یەکسەر دەبینیت: سوور FF=1111  1111\text{FF} = 1111\;1111 (تەواو داگیرساو)، سەوز 88=1000  100088 = 1000\;1000، شین 00=0000  000000 = 0000\;0000. هەر جووتێک یەک .
  • . هەموو بە ژمارە دەکات. پیتی کوردیی ە ⁦U+06D5⁩ـە، واتە شێوەی 0000  0110  1101  01010000\;0110\;1101\;0101.
  • و هەڵەکان. ناونیشانەکانی ، کۆدی هەڵەکان و ناونیشانی ئامێرەکانی تۆڕ بە چاپ دەکرێن، چونکە یەک ڕێک چوار پیشان دەدات.
  • مۆڵەتی فایل (). لە Linuxـدا chmod 755 سێ دەدات بۆ خاوەن، گروپ و ئەوانی تر. هەر 3 : خوێندنەوە ⁦(4)⁩، نووسین ⁦(2)⁩، جێبەجێکردن ⁦(1)⁩. کەواتە 7=1117 = 111 واتە rwx و 5=1015 = 101 واتە r-x.
Quick checkپشکنینی خێراIn the web colour #00FF00, how much red is there?لە ڕەنگی وێبی #00FF00دا چەند سوور هەیە؟

Why do programmers use hexadecimal numbers?Jacob Sorber · Englishئینگلیزی · 71K viewsبینین · 2.8K likesلایک · Partبەشی 0:00–8:40 (ofلە 8:40)

Why programmers write hex: one hex digit is exactly four bits, so long binary values become short and readable.

بۆچی بەکار دەهێنن: یەک ڕێک چوار ، بۆیە ژمارە درێژەکانی کورت و ئاسان دەخوێنرێنەوە.

Chapters: 2:20 hexadecimal, 4:29 advantages, 5:14 when to use hex.

بەشەکان: ⁦2:20⁩ ، ⁦4:29⁩ سوودەکانی، ⁦5:14⁩ کەی بەکار بهێنیت.

Common mistakesهەڵە باوەکان

MistakeهەڵەExampleنموونەCorrectدروست
Grouping a fraction from its right endدەستەکردنی لە سەری ڕاستییەوە.1011→.001 011=.138.1011 \to .001\,011 = .13_8 ✗.1011→.101 100=.548.1011 \to .101\,100 = .54_8 ✓
Adding zeros on the right of a whole numberزیادکردنی سفر لە لای ڕاستی ژمارەی بێ 11101→111 010=72811101 \to 111\,010 = 72_8 ✗ (=58= 58)11101→011 101=35811101 \to 011\,101 = 35_8 ✓ (=29= 29)
Dropping the zeros inside a groupلابردنی سفرەکانی ناو دەستە(7526)8→111 101 10 110(7526)_8 \to 111\,101\,10\,110 ✗111 101 010 110111\,101\,010\,110 ✓
Writing 10–15 as two digitsنووسینی ⁦10⁩ تا ⁦15⁩ بە دوو 1010 0001→101161010\,0001 \to \text{101}_{16} ✗A116\text{A1}_{16} ✓
Wrong group size (3 bits for hex, 4 for octal)قەبارەی هەڵەی دەستە (⁦3⁩ بۆ ، 4 بۆ )1010 1000 0101→128581010\,1000\,0101 \to 1285_8 ✗101 010 000 101=52058101\,010\,000\,101 = 5205_8 ✓
Wrong base subscriptژمارەی بچووکی هەڵەی (652B)2(\text{652B})_2 ✗(652B)16(\text{652B})_{16} ✓

A quick self-check: an octal answer never contains 8 or 9, a hex answer may contain A–F, and converting back must give the bits you started with.

پشکنینێکی خێرا بۆ خۆت: وەڵامی هەرگیز 8 یان 9ـی تێدا نییە، وەڵامی لەوانەیە A تا Fـی تێدا بێت و گۆڕینەوەی بۆ دواوە دەبێت هەمان سەرەتا بدات.

Exercisesڕاهێنانەکان

These are all the conversion exercises of the lecture. Try each one on paper first, then open the answer. Every answer shows the groups, so you can find exactly where a mistake happened.

ئەمانە هەموو ڕاهێنانەکانی گۆڕینی وانەکەن. سەرەتا هەریەکەیان لەسەر کاغەز تاقی بکەرەوە، پاشان وەڵامەکە بکەرەوە. هەموو وەڵامێک دەستەکان پیشان دەدات، تا بزانیت هەڵەکە ڕێک لە کوێ ڕوویداوە.

Exerciseڕاهێنان1. Binary to octal1. دووانی بۆ هەشتی

Convert to octal: (a) 1101101 (b) 101111001 (c) 111.1011 (d) 10.111 (e) 100110011010.011

بگۆڕە بۆ : (أ) ⁦1101101⁩ (ب) ⁦101111001⁩ (ج) ⁦111.1011⁩ (د) ⁦10.111⁩ (هـ) ⁦100110011010.011⁩

Hintئاماژە

Start every group at the binary point; pad the left end of the whole part and the right end of the fraction.

هەموو دەستەیەک لە دەست پێبکە؛ سەری چەپی بەشی تەواو و سەری ڕاستی بەشی بە سفر تەواو بکە.

Show answerوەڵامەکە پیشان بدە
NumberژمارەGroupsدەستەکانAnswerوەڵام
11011011101101001 101 101001\,101\,101(155)8(155)_8
101111001101111001101 111 001101\,111\,001(571)8(571)_8
111.1011111.1011111 . 101 100111\,.\,101\,100(7.54)8(7.54)_8
10.11110.111010 . 111010\,.\,111(2.7)8(2.7)_8
100110011010.011100110011010.011100 110 011 010 . 011100\,110\,011\,010\,.\,011(4632.3)8(4632.3)_8

In (c) and (d) the groups start at the point; in (e) the fraction .011 is already one full group.

لە (ج) و (د)دا دەستەکان لە خاڵەکەوە دەست پێدەکەن؛ لە (هـ)دا بەشی .⁦011⁩ خۆی دەستەیەکی تەواوە.

Exerciseڕاهێنان2. Octal to binary2. هەشتی بۆ دووانی

Convert to binary: (a) (13)8(13)_8 (b) (25)8(25)_8 (c) (140)8(140)_8 (d) (46)8(46)_8 (e) (723)8(723)_8 (f) (5624)8(5624)_8 (g) (7526)8(7526)_8

بگۆڕە بۆ : (أ) (13)8(13)_8 (ب) (25)8(25)_8 (ج) (140)8(140)_8 (د) (46)8(46)_8 (هـ) (723)8(723)_8 (و) (5624)8(5624)_8 (ز) (7526)8(7526)_8

Show answerوەڵامەکە پیشان بدە
NumberژمارەBits (3 per digit) (⁦3⁩ بۆ هەر )
(13)8(13)_8001 011001\,011
(25)8(25)_8010 101010\,101
(140)8(140)_8001 100 000001\,100\,000
(46)8(46)_8100 110100\,110
(723)8(723)_8111 010 011111\,010\,011
(5624)8(5624)_8101 110 010 100101\,110\,010\,100
(7526)8(7526)_8111 101 010 110111\,101\,010\,110

The zeros at the far left may be dropped at the end: for example (140)8=(1100000)2(140)_8 = (1100000)_2.

سفرەکانی تەواو لای چەپ لە کۆتاییدا دەتوانرێت لاببرێن: بۆ نموونە (140)8=(1100000)2(140)_8 = (1100000)_2.

Exerciseڕاهێنان3. Hex to binary3. شانزەیی بۆ دووانی

Convert to binary: (a) (10A4)16(\text{10A4})_{16} (b) (CF8E)16(\text{CF8E})_{16} (c) (9742)16(9742)_{16} (d) (6BD3)16(\text{6BD3})_{16}

بگۆڕە بۆ : (أ) (10A4)16(\text{10A4})_{16} (ب) (CF8E)16(\text{CF8E})_{16} (ج) (9742)16(9742)_{16} (د) (6BD3)16(\text{6BD3})_{16}

Show answerوەڵامەکە پیشان بدە
NumberژمارەBits (4 per digit) (⁦4⁩ بۆ هەر )
(10A4)16(\text{10A4})_{16}0001 0000 1010 01000001\,0000\,1010\,0100
(CF8E)16(\text{CF8E})_{16}1100 1111 1000 11101100\,1111\,1000\,1110
(9742)16(9742)_{16}1001 0111 0100 00101001\,0111\,0100\,0010
(6BD3)16(\text{6BD3})_{16}0110 1011 1101 00110110\,1011\,1101\,0011
Exerciseڕاهێنان4. Binary to hex4. دووانی بۆ شانزەیی

Convert to hex: (a) 110010100101011 (b) 111111000101101101001 (c) 1001111011110011100

بگۆڕە بۆ : (أ) ⁦110010100101011⁩ (ب) ⁦111111000101101101001⁩ (ج) ⁦1001111011110011100⁩

Show answerوەڵامەکە پیشان بدە
NumberژمارەGroupsدەستەکانAnswerوەڵام
1100101001010111100101001010110110 0101 0010 10110110\,0101\,0010\,1011(652B)16(\text{652B})_{16}
1111110001011011010011111110001011011010010001 1111 1000 1011 0110 10010001\,1111\,1000\,1011\,0110\,1001(1F8B69)16(\text{1F8B69})_{16}
100111101111001110010011110111100111000100 1111 0111 1001 11000100\,1111\,0111\,1001\,1100(4F79C)16(\text{4F79C})_{16}

(b) has 21 bits, so the left group needs three zeros; (c) has 19 bits, so it needs one.

(ب) ⁦21⁩ هەیە، بۆیە دەستەی لای چەپ سێ سفری پێویستە؛ (ج) ⁦19⁩ هەیە، بۆیە یەک سفری پێویستە.

Exerciseڕاهێنان5. Octal and hex5. هەشتی و شانزەیی

(a) (732)8(732)_8 to hex (b) (5624)8(5624)_8 to hex (c) (A85)16(\text{A85})_{16} to octal (d) (6BD)16(\text{6BD})_{16} to octal

(أ) (732)8(732)_8 بۆ (ب) (5624)8(5624)_8 بۆ (ج) (A85)16(\text{A85})_{16} بۆ (د) (6BD)16(\text{6BD})_{16} بۆ

Hintئاماژە

Go through binary: digits to bits, regroup from the right, bits to digits.

بە تێپەڕە: بۆ ، لە لای ڕاستەوە دووبارە دەستە بکە، بۆ .

Show answerوەڵامەکە پیشان بدە
NumberژمارەBits, then regrouped، پاشان دووبارە دەستەکراو
(732)8(732)_8111 011 010→0001 1101 1010111\,011\,010 \to 0001\,1101\,1010
(5624)8(5624)_8101 110 010 100→1011 1001 0100101\,110\,010\,100 \to 1011\,1001\,0100
(A85)16(\text{A85})_{16}1010 1000 0101→101 010 000 1011010\,1000\,0101 \to 101\,010\,000\,101
(6BD)16(\text{6BD})_{16}0110 1011 1101→011 010 111 1010110\,1011\,1101 \to 011\,010\,111\,101
NumberژمارەAnswerوەڵام
(732)8(732)_8(1DA)16(\text{1DA})_{16}
(5624)8(5624)_8(B94)16(\text{B94})_{16}
(A85)16(\text{A85})_{16}(5205)8(5205)_8
(6BD)16(\text{6BD})_{16}(3275)8(3275)_8

Decimal check: 474, 2964, 2693 and 1725 on both sides.

پشکنین بە : هەردوو لا ⁦474⁩، ⁦2964⁩، ⁦2693⁩ و ⁦1725⁩ـن.

Summaryپوختە

  • One octal digit = 3 bits (8=238 = 2^3); one hex digit = 4 bits (16=2416 = 2^4).
  • To binary: replace each digit with its full group of bits (keep inner zeros).
  • From binary: group from the binary point outwards, pad with zeros on the outside, replace each group with a digit.
  • Octal ⇄ hex: go through binary and regroup.
  • Hex is how people read bytes today: colours, characters, memory addresses.
  • یەک = 3 (8=238 = 2^3)؛ یەک = 4 (16=2416 = 2^4).
  • بۆ : هەر بە دەستە تەواوەکەی بگۆڕە (سفرەکانی ناوەوە بهێڵەوە).
  • لە : لە بەرەو دەرەوە دەستە بکە، سفر بخە لای دەرەوە و هەر دەستەیەک بە بگۆڕە.
  • ⇄ : بە تێپەڕە و دووبارە دەستە بکە.
  • ئەو ڕێگایەیە کە ئەمڕۆ خەڵک پێ دەخوێننەوە: ڕەنگ، ، ناونیشانی .
Review questionsپرسیارەکانی پێداچوونەوە
Why is converting binary to hex easier than binary to decimal?بۆچی گۆڕینی دووانی بۆ شانزەیی ئاسانترە لە دووانی بۆ دەیی؟

Because 16 is a power of 2: every 4 bits make exactly one hex digit, so you only group and read. 10 is not a power of 2, so decimal needs the full sum of weights.

چونکە ⁦16⁩ توانێکی 2ـیە: هەر 4 ڕێک یەک دروست دەکەن، بۆیە تەنها دەستە دەکەیت و دەیخوێنیتەوە. ⁦10⁩ توانێکی 2 نییە، بۆیە کۆی تەواوی کێشەکانی دەوێت.

Where do the padding zeros go in 1011.01 → octal?لە ⁦1011.01⁩ ← هەشتیدا سفرە زیادکراوەکان دەچنە کوێ؟

Two zeros on the left of the whole part (001  011001\;011) and one on the right of the fraction (010): 13.2.

دوو سفر لە لای چەپی بەشی تەواو (001  011001\;011) و یەک سفر لە لای ڕاستی بەشی ⁦(010): 13.2⁩.

Videoڤیدیۆ

Watch a videoسەیری ڤیدیۆیەک بکە

A video that viewers liked a lot and praised in their comments, chosen for this lesson.ڤیدیۆیەک کە بینەران زۆریان پێ خۆش بووە و لە کۆمێنتەکانیاندا ستایشیان کردووە، بۆ ئەم وانەیە هەڵبژێردراوە.

Numbering Systems conversion Binary to Decimal, Octal, Hexadecimal and Vice versahiwa school · Kurdish (Sorani)کوردی (سۆرانی) · 3.5K viewsبینین · 80 likesلایک · Partبەشی 20:06–26:42 (ofلە 26:42)

Kurdish lecture: decimal to binary, octal and hex by repeated division and multiplication, and binary to octal and hex by grouping.

وانەیەکی کوردی: گۆڕینی بۆ ، و بە دابەشکردن و لێکدانی دووبارە، هەروەها بۆ و بە کۆمەڵکردنی .

Kurdish. Chapters 20:06 binary-octal (groups of 3 from the point, add zeros), 22:59 binary-hex.

بە کوردی. بەشەکان: ⁦20:06⁩ و (کۆمەڵەی سێ لە ، بە زیادکردنی سفر)، ⁦22:59⁩ و .

Lesson complete!وانەکە تەواو بوو!

Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.

Key termsزاراوە سەرەکییەکان

Next lessonوانەی داهاتوو

Binary Addition and Subtractionکۆکردنەوەی دووانی و لێدەرکردنی دووانی

References and further readingسەرچاوەکان و خوێندنەوەی زیاتر

This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.