Chapterبەش 2 · Lectureوانە 2.1
Number Systems and Place Valueسیستەمە ژمارەییەکان و بەهای خانەیی
How place value works in any base; decimal, binary, octal and hexadecimal side by side; bits, nibbles, bytes and words, MSB and LSB; why N bits give patterns; and counting in binary.
چۆن لە هەر کار دەکات؛ ، ، و لە تەنیشت یەکەوە؛ ، ، و ، MSB و LSB؛ بۆچی N شێوە دەدات؛ و ژماردن بە .
What you will learnچی فێر دەبیت
- Explain place value and write any number as a sum of digit × power of the base.
- Name the base and the digits of decimal, binary, octal and hexadecimal, and use base subscripts.
- Describe bits, nibbles, bytes and words, and number the bits of a word from LSB to MSB.
- Work out how many patterns N bits give and the largest value they can hold.
- Count in binary, octal and hexadecimal.
- ڕوون بکەیتەوە و هەر ژمارەیەک وەک کۆی × بنووسیت.
- و ، ، و بناسیت و بەکاربهێنیت.
- ، ، و وەسف بکەیت و لە LSBـەوە تا MSB ژمارە بکەیت.
- بزانیت N چەند شێوە دەدات و گەورەترین نرخێک کە هەڵیدەگرێت چەندە.
- بە ، و بژمێریت.
One number, four ways to write itیەک ژمارە، چوار شێوەی نووسین
What is 10? In everyday life it is ten. But is two, is eight and is sixteen. The digits are the same; the decides what they mean.
10 چییە؟ لە ژیانی ڕۆژانەدا دەیە. بەڵام دووە، هەشتە و شازدەیە. هەمان شتن؛ دیاری دەکات واتایان چییە.
Computers work in binary, people think in decimal, and programmers often write octal or hexadecimal because they are short ways of writing binary. This chapter teaches the four and how to move between them. After it, and the chapters that follow, you will be able to:
بە کار دەکەن، خەڵک بە بیر دەکەنەوە و بەرنامەسازەکان زۆرجار یان دەنووسن، چونکە شێوەی کورتی نووسینی . ئەم بەشە چوار و چۆنیەتیی گواستنەوە لە نێوانیاندا فێر دەکات. دوای ئەم بەش و بەشەکانی دواتر دەتوانیت:
- write values in decimal, binary, octal and hexadecimal (and later in BCD);
- convert values between these systems;
- add, subtract and multiply in binary (chapter Binary Arithmetic and Signed Numbers);
- describe other codes such as Gray, BCD and ASCII (chapter Digital Codes).
- نرخەکان بە ، ، و بنووسیت (و دواتر بە کۆدی دەیی دووانی)؛
- نرخەکان لە نێوان ئەم سیستەمانەدا بگۆڕیت؛
- بە کۆ بکەیتەوە، لێ دەربکەیت و لێک بدەیت (بەشی ژمێرکاریی دووانی و ژمارە نیشانەدارەکان)؛
- کۆدەکانی تر وەک کۆدی گرەی، کۆدی دەیی دووانی و ASCII وەسف بکەیت (بەشی کۆدە ).
Place value: where a digit stands mattersبەهای خانەیی: شوێنی تاکژمارە گرنگە
The value of one place in a number, also called its weight. In base b the places are worth …, , , and, after the point, , , …
بەهای یەک خانەیە لە ژمارەیەکدا، کە پێی دەگوترێت کێشی خانەکە. لە bـدا بەهای خانەکان بریتییە لە …، ، ، و دوای خاڵەکە ، ، …
In 2598 the digit 5 does not mean five: it means five hundreds, because of the place where it stands. In a every place has a weight, its place value, and each place is worth base times the place on its right. In decimal the weights are 1, 10, 100, 1000 … — the powers of 10.
لە 2598دا 5 واتای پێنج نییە: واتە پێنج سەد، لەبەر ئەو شوێنەی تێیدایە. لە هەر خانەیەک کێشێکی هەیە، کە . بەهای هەر خانەیەک جار بەهای خانەی لای ڕاستیەتی. لە کێشەکان بریتین لە 1، 10، 100، 1000 و هتد، واتە 10.
After the point the powers are negative: , .
دوای خاڵەکە سالبن: و .
Place value: each position is worth a power of the base, so the same idea works for base 10, base 2 and others.
: هەر شوێنێک بەقەد بەهای هەیە، بۆیە هەمان بیرۆکە بۆ 10، 2 و ئەوانی تریش کار دەکات.
Chapters 0:48 positional notation, 1:43 base systems, 2:20 other bases; skips intro and outro.
بەشەکان: 0:48 ، 1:43 ، 2:20 تر؛ پێشەکی و کۆتاییەکەی پەخش ناکرێن.
Place value: where a digit stands mattersبەهای خانەیی: شوێنی تاکژمارە گرنگە
The general formulaیاسا گشتییەکە
The same rule works for every base. Write the base as r (for radix, another word for base). A number with n digits before the point and m digits after it is worth:
هەمان یاسا بۆ هەموو کار دەکات. بە r بنووسە (لە radixـەوە، ناوێکی تری ). ژمارەیەک کە n پێش خاڵەکە و m دوای خاڵەکەی هەیە، بەهاکەی ئەمەیە:
Each digit d is multiplied by its place value, a power of r, and all the products are added.
هەر d لە دەدرێت ( rـە) و هەموو لێکدانەکان کۆ دەکرێنەوە.
Two facts follow. A base-r system needs exactly r digits, from 0 to : a digit with the value r would already be written “10”. And “10” in any base means the base itself: , , .
دوو ڕاستی لێرەوە دەردەکەون. سیستەمێک کە rـە، ڕێک r پێویستە، لە 0 تا : کە بەهاکەی r بێت پێشتر بە «10» دەنووسرێت. هەروەها «10» لە هەر واتە خودی : ، ، .
Place value: where a digit stands mattersبەهای خانەیی: شوێنی تاکژمارە گرنگە
Where place value comes fromبەهای خانەیی لە کوێوە هاتووە
Decimal, binary, octal and hexadecimalدەیی، دووانی، هەشتی و شانزەیی
| Systemسیستەم | Base | Digits | Exampleنموونە | Its value in decimalنرخەکەی بە |
|---|---|---|---|---|
| Decimal | 10 | 0 1 2 3 4 5 6 7 8 9 | 259 | |
| Binary | 2 | 0 1 | 45 | |
| Octal | 8 | 0 1 2 3 4 5 6 7 | 242 | |
| Hexadecimal | 16 | 0 … 9 A B C D E F | 3858 |
The small number after the bracket is the subscript: it names the base. Without it, “101” could mean one hundred and one, five , sixty-five or two hundred and fifty-seven . So always write the base when it is not decimal.
ژمارە بچووکەکەی دوای کەوانەکە : ناوی دەڵێت. بەبێ ئەو، «101» دەکرێت واتای سەد و یەک بێت، پێنج ، شەست و پێنج یان دووسەد و پەنجا و حەوت . بۆیە هەمیشە بنووسە ئەگەر نەبێت.
| Hex digit | A | B | C | D | E | F |
|---|---|---|---|---|---|---|
| Valueنرخ | 10 | 11 | 12 | 13 | 14 | 15 |
Why octal and hex?بۆچی هەشتی و شانزەیی؟
Why octal and hex at all? Binary numbers get long quickly: . One octal digit stands for exactly 3 bits and one hex digit for exactly 4 bits, so octal and hex are short, safe ways of writing binary. That is why programmers use hex for memory addresses and for colours such as #FF8800: red , green , blue .
بۆچی و ؟ ژمارە زوو درێژ دەبن: . یەک ڕێک 3 نیشان دەدات و یەک ڕێک 4 ، بۆیە و شێوەی کورت و پارێزراوی نووسینی . بۆیە بەرنامەسازەکان بۆ ناونیشانی و بۆ ڕەنگەکان بەکاردەهێنن، وەک #FF8800: سوور ، سەوز ، شین .
Bits, bytes and wordsبیتەکان، بایتەکان و وشەکان
The takes information from main memory, works on it and puts the results back. The block of bits it handles in one operation, and moves to or from memory, is called a word. A word can hold a number for a calculation, or one or more characters such as letters, digits and symbols.
لە سەرەکییەوە وەردەگرێت، کاری لەسەر دەکات و ئەنجامەکان دەگەڕێنێتەوە. ئەو کۆمەڵە بە یەکجار کاری لەسەر دەکات و بۆ یان لە دەیگوازێتەوە، پێی دەوترێت . دەتوانێت ژمارەیەک بۆ ژمێرکاری هەڵبگرێت، یان یەک یان چەند نووسەیەک وەک پیت، و هێما.
Word length differs from machine to machine; it is usually between 8 and 64 bits. Today's phones and laptops are 64-bit machines.
درێژیی لە ئامێرێکەوە بۆ ئامێرێکی تر جیاوازە؛ زۆربەی جار لە نێوان 8 و 64 . مۆبایل و ئەمڕۆ ئامێری 64 .
An N-bit word is drawn as a row of boxes, and the bits are numbered from to , starting at the right. Bit , on the left, has the biggest weight: it is the (MSB). Bit 0, on the right, has the smallest weight: it is the (LSB).
N وەک ڕیزێک سندووق دەکێشرێت و لە ڕاستەوە لە تا ژمارە دەکرێن. لە چەپ گەورەترین کێشی هەیە: ئەوە (MSB)ـە. 0 لە ڕاست بچووکترین کێشی هەیە: ئەوە (LSB)ـە.
Four bits make a and eight bits a . For bigger units such as kilobyte and megabyte — and why a kilobyte can mean 1,000 or 1,024 bytes — see Bits, bytes and storage units.
چوار پێکدەهێنن و هەشت . بۆ یەکەی گەورەتر وەک و — و بۆچی دەکرێت 1,000 یان 1,024 بێت — بڕوانە بیتەکان، بایتەکان و یەکەکانی هەڵگرتن.
Bits, bytes and wordsبیتەکان، بایتەکان و وشەکان
Word, double word, quad wordوشە، وشەی دووقات و وشەی چوارقات
Many books, Windows and x86 programs also use fixed names for groups of bits. They come from the 16-bit Intel 8086 (1978), the first x86 processor, so in these names a word is 16 bits:
زۆر کتێب، Windows و x86 ناوی جێگیریش بۆ کۆمەڵەکانی بەکاردەهێنن. ئەم ناوانە لە Intel 8086ـەوە (1978) ماونەتەوە، کە یەکەم x86 بوو و 16 بوو، بۆیە لەم ناوانەدا 16 :
| Nameناو | Bits | Bytes | Hex digits | Exampleنموونە |
|---|---|---|---|---|
| 4 | ½ | 1 | ||
| 8 | 1 | 2 | ||
word (WORD) (WORD) | 16 | 2 | 4 | |
double word (DWORD) (DWORD) | 32 | 4 | 8 | |
quad word (QWORD) (QWORD) | 64 | 8 | 16 |
These names are fixed. A word in the sense of the screen before — the bits a CPU handles in one step — has grown to 64 bits, but a Windows WORD is still 16 bits, so that old programs keep working.
ئەم ناوانە جێگیرن. بە واتای بەشی پێشوو — ئەو کۆمەڵە بە یەک هەنگاو کاری لەسەر دەکات — گەیشتووەتە 64 ، بەڵام WORDـی Windows هێشتا 16 ، بۆ ئەوەی هەر کار بکەن.
Bits, bytes and wordsبیتەکان، بایتەکان و وشەکان
Which byte comes first?کام بایت یەکەم دێت؟
Big-endian and little-endian: which byte of a multi-byte number is stored first in memory and sent first on networks.
و : کاتێک ژمارەیەک لە چەند پێک دێت، کام یەکەم لە هەڵدەگیرێت و یەکەم بەسەر دەنێردرێت.
Chapters: 0:43 little vs big endian, 1:25 representing numbers, 2:04 network byte order.
بەشەکان: 0:43 بەرامبەر ، 1:25 نووسینی ژمارەکان، 2:04 لە .
Bits, bytes and wordsبیتەکان، بایتەکان و وشەکان
How many patterns do N bits give?N بیت چەند شێوە دەدات؟
A word of bits can stand for anything we agree on: numbers, letters, colours, even the kinds of trees in an orchard. The most common uses are numbers and characters.
کە لە پێکهاتووە دەتوانێت هەر شتێک نیشان بدات کە لەسەری ڕێک بکەوین: ژمارە، پیت، ڕەنگ، تەنانەت جۆرەکانی دار لە باخێکدا. باوترین بەکارهێنانەکانی ژمارە و نووسەن.
Each extra bit doubles the number of patterns: 1 bit gives 2 (0, 1); 2 bits give 4 (00, 01, 10, 11); 3 bits give 8. In general an N-bit word has
هەر زیادە ژمارەی شێوەکان دوو هێندە دەکات: 1 2 شێوە دەدات (0، 1)؛ 2 4 (00، 01، 10، 11)؛ 3 8. بە گشتی N ئەمەندە شێوەی هەیە:
As unsigned numbers these patterns are the values 0 to : the largest value is one less than the number of patterns, because one pattern is used for 0.
وەک ئەم شێوانە نرخەکانی 0 تا ـن: گەورەترین نرخ یەک کەمترە لە ژمارەی شێوەکان، چونکە یەک شێوە بۆ 0 بەکاردێت.
| Bits | Patterns شێوەکان | Largest value گەورەترین نرخ |
|---|---|---|
| 1 | 2 | 1 |
| 2 | 4 | 3 |
| 3 | 8 | 7 |
| 4 (a nibble)4 () | 16 | 15 |
| 7 | 128 | 127 |
| 8 (a byte)8 () | 256 | 255 |
| 16 | 65,536 | 65,535 |
| 32 | 4,294,967,296 | 4,294,967,295 |
| 64 | 18,446,744,073,709,551,616 | 18,446,744,073,709,551,615 |
Think of N lamps in a row, each on or off. Add one more lamp: every old pattern now appears twice, once with the new lamp off and once with it on. That is why one extra bit doubles the count.
بیر لە N گڵۆپ بکەرەوە لە ڕیزێکدا، هەر یەکەیان هەڵکراو یان کوژاوە. گڵۆپێکی تر زیاد بکە: هەر شێوەیەکی کۆن ئێستا دوو جار دەردەکەوێت، جارێک لەگەڵ گڵۆپە نوێیەکە کوژاوە و جارێک هەڵکراو. بۆیە یەک زیادە ژمارەکە دوو هێندە دەکات.
Where the analogy stops workingسنووری ئەم نموونەیە
Lamps are only a picture: a 64-bit word has about 18 billion billion patterns, far more than any row of lamps could ever show one by one.
گڵۆپەکان تەنها وێنەیەکن: 64 نزیکەی 18 ملیار ملیار شێوەی هەیە، زۆر زیاتر لەوەی هیچ ڕیزە گڵۆپێک بتوانێت یەک یەک پیشانیان بدات.
Bits, bytes and wordsبیتەکان، بایتەکان و وشەکان
The weights of a binary numberکێشەکانی ژمارەیەکی دووانی
Because one bit has only two states, each place in a binary number is worth twice the place on its right. Starting from the right, the bits count the 1s, 2s, 4s, 8s, 16s … of the number. For a 7-bit word:
چونکە یەک تەنها دوو دۆخی هەیە، هەر خانەیەک لە ژمارەیەکی دوو هێندەی خانەی لای ڕاستی دەهێنێت. لە ڕاستەوە، ژمارەی یەکەکان، دووەکان، چوارەکان، هەشتەکان، شازدەکان و هتد لە ژمارەکەدا دەژمێرن. بۆ 7 :
The largest 7-bit value is , and the smallest is . Check it with the rule: .
گەورەترین نرخی 7 ـە و بچووکترینیان . بە یاساکە بیپشکنە: .
After the the weights go on halving: , , , . So , as the place-value picture shows.
دوای کێشەکان بەردەوام نیوە دەبنەوە: ، ، ، . بۆیە ، وەک وێنەی پیشانی دەدات.
Counting in binaryژماردن بە دووانی
You count in binary exactly as in decimal, but you run out of digits after 1. In decimal, after 9 the digit goes back to 0 and you carry 1 to the next place: , . In binary the same happens after 1: , , .
بە ڕێک وەک دەژمێریت، بەڵام دوای 1 تەواو دەبن. لە دوای 9 دەگەڕێتەوە بۆ 0 و 1 دەگوازیتەوە بۆ خانەی دواتر: ، . لە هەمان شت دوای 1 ڕوودەدات: ، ، .

An old taxi has a mechanical kilometre counter: wheels with the digits 0 to 9. When the right wheel passes 9 it goes back to 0 and pushes the next wheel one step. A binary counter is the same machine with wheels that carry only 0 and 1, so it rolls over after every 1.
تەکسییەکی کۆن کیلۆمەترپێوێکی میکانیکیی هەیە: چەند خولاوەیەک کە 0 تا 9یان لەسەرە. کاتێک خولاوەی ڕاست لە 9 تێدەپەڕێت، دەگەڕێتەوە بۆ 0 و خولاوەی دواتر یەک هەنگاو دەجووڵێنێت. هەمان ئامێرە بەڵام خولاوەکانی تەنها 0 و 1یان لەسەرە، بۆیە دوای هەر 1ـێک دەگەڕێتەوە سەر 0.
Where the analogy stops workingسنووری ئەم نموونەیە
You can see an odometer wheel half-way between two digits; a digital counter has no in-between — all its bits change together at one clock tick.
دەتوانیت خولاوەیەکی کیلۆمەترپێو ببینیت کە لە نیوەی نێوان دوو ؛ هیچ دۆخێکی نێوانی نییە — هەموو لە یەک لێدانی کاتژمێردا پێکەوە دەگۆڕێن.
Counting in binary the same way as in decimal: a place rolls over and carries when it runs out of digits.
ژماردن بە هەر وەک ژماردن بە : کاتێک خانەیەک تەواو دەبن، دەگەڕێتەوە بۆ 0 و دەداتە خانەی دواتر.
Chapter 0:42 "How to count in binary" only (to 7:29).
تەنها بەشی 0:42، How to count in binary (تا 7:29).
Counting in binaryژماردن بە دووانی
0 to 15 in four systems0 تا 15 لە چوار سیستەمەکەدا
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 2 | 0010 | 2 | 2 |
| 3 | 0011 | 3 | 3 |
| 4 | 0100 | 4 | 4 |
| 5 | 0101 | 5 | 5 |
| 6 | 0110 | 6 | 6 |
| 7 | 0111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
Look at the octal column: after 7 comes 10 (eight). In the hex column: after 9 come A, B, … F, and only after F comes 10 (sixteen). Every system rolls over when it runs out of digits.
سەیری ستوونی بکە: دوای 7 ژمارەی 10 دێت (هەشت). لە ستوونی : دوای 9 پیتەکانی A، B، … F دێن و تەنها دوای F ژمارەی 10 دێت (شازدە). هەموو سیستەمێک کاتێک تەواو دەبن، دەگەڕێتەوە سەر سفر و یەک دەگوازێتەوە.
Three kinds of conversionسێ جۆر گۆڕینی بنچینە
Changing a number from one base to another is called . There are three kinds, and each has its own lesson:
گۆڕینی ژمارەیەک لە بۆ تر پێی دەوترێت . سێ جۆری هەیە و هەر یەکەیان وانەی تایبەتی خۆی هەیە:
- Decimal → binary, octal or hex: divide again and again by the new base — From Decimal to Binary, Octal and Hex.
- Binary, octal or hex → decimal: add up digit × place value — From Binary, Octal and Hex to Decimal.
- Between binary, octal and hex (for example octal ⇄ hex): go through binary and regroup the bits in 3s or 4s — Binary, Octal and Hex Shortcuts.
- ← ، یان : بەردەوام دابەشی نوێیەکە بکە — لە دەییەوە بۆ دووانی، هەشتی و شانزەیی.
- ، یان ← : × کۆ بکەرەوە — لە دووانی، هەشتی و شانزەییەوە بۆ دەیی.
- لە نێوان ، و (بۆ نموونە ⇄ ): بە بڕۆ و سێ سێ یان چوار چوار کۆ بکەرەوە — کورتەڕێکانی دووانی، هەشتی و شانزەیی.
Common mistakesهەڵە باوەکان
| Mistakeهەڵە | Fixچارەسەر |
|---|---|
| Writing the digit 8 or 9 in an octal number, or 2 in a binary number.نووسینی 8 یان 9 لە ژمارەیەکی ، یان 2 لە ژمارەیەکی . | A base- system has only the digits 0 to .سیستەمی تەنها 0 تا ـی هەیە. |
| Reading as “ten”.خوێندنەوەی وەک «دە». | Say “one-zero in binary”; its value is two.بڵێ «یەک-سفر بە »؛ نرخەکەی دووە. |
| Numbering bits from 1.ژمارەکردنی لە 1ـەوە. | Bits are numbered from 0 at the right: is the LSB, the MSB. لە ڕاستەوە لە 0ـەوە ژمارە دەکرێن: LSBـە و MSBـە. |
| “The MSB is always 1.”«MSB هەمیشە 1ـە.» | The MSB names a position, the left-hand bit. In 0110 the MSB, , is 0.MSB ناوی شوێنێکە: لای چەپ. لە ژمارەی 0110ـدا MSB، واتە ، 0ـە. |
| “8 bits can hold the value 256.”«8 دەتوانێت نرخی 256 هەڵبگرێت.» | 8 bits give 256 patterns, 0 to 255. The largest value is .8 256 شێوە دەدات، 0 تا 255. گەورەترین نرخ ـە. |
| Leaving out the base: writing 101 when you mean binary.نەنووسینی : نووسینی 101 کاتێک مەبەستت . | Write ; without the subscript a reader assumes decimal. بنووسە؛ بەبێ خوێنەر وا دادەنێت . |
| Thinking A–F in hex are letters or variables.وا بیرکردنەوە کە A–F لە پیت یان . | They are digits with the values 10 to 15.ئەوانە بە نرخەکانی 10 تا 15. |
Exercisesڕاهێنانەکان
Write as a sum of digits times powers of 10.
وەک کۆی جار 10 بنووسە.
Show answerوەڵامەکە پیشان بدە
Which of these numbers are written correctly? , , , ,
کام لەم ژمارانە بە دروستی نووسراون؟ ، ، ، ،
Show answerوەڵامەکە پیشان بدە
- Valid: and .
- Not valid: (binary has no 2), (octal has no 8 or 9), (hex stops at F).
- دروست: و .
- هەڵە: ( 2ـی نییە)، ( 8 و 9ـی نییە)، ( لە F دەوەستێت).
A teacher wants to give each of 30 students a different binary code, all of the same length. How many bits are needed?
مامۆستایەک دەیەوێت بە هەر یەک لە 30 قوتابی کۆدێکی جیاواز بدات، هەموو بە هەمان درێژی. چەند پێویستە؟
Hintئاماژە
Find the smallest with .
بچووکترین بدۆزەرەوە کە .
Show answerوەڵامەکە پیشان بدە
4 bits give only codes — too few. 5 bits give codes, enough for 30. Answer: 5 bits.
4 تەنها کۆد دەدات — کەمە. 5 کۆد دەدات، بەسە بۆ 30. وەڵام: 5 .
What is the largest unsigned value that fits in (a) 10 bits, (b) 12 bits?
گەورەترین نرخی بێنیشانە کە جێی دەبێتەوە لە (أ) 10 ، (ب) 12 چەندە؟
Show answerوەڵامەکە پیشان بدە
Each byte of memory has its own number, its . Write each memory size in bytes as a power of 2, then say how many bits an address needs to number every byte: (a) 1 KiB; (b) 64 KiB; (c) 1 MiB; (d) 16 MiB; (e) 4 GiB; (f) 16 EiB.
هەر ژمارەی تایبەتی خۆی هەیە، واتە . هەر قەبارەیەکی بە وەک 2 بنووسە، پاشان بڵێ ناونیشانێک چەند پێویستە تا هەموو ژمارە بکات: (أ) 1 KiB؛ (ب) 64 KiB؛ (ج) 1 MiB؛ (د) 16 MiB؛ (هـ) 4 GiB؛ (و) 16 EiB.
Hintئاماژە
, , and bytes. Multiplying powers of 2 adds the exponents: .
، ، و . لێکدانی 2 واتە کۆکردنەوەی ئەو ژمارە بچووکانەی لە سەرەوەن: .
Show answerوەڵامەکە پیشان بدە
| Sizeقەبارە | Bytes as a power of 2 وەک 2 | Address bits ناونیشان |
|---|---|---|
| (a) 1 KiB(أ) 1 KiB | 10 | |
| (b) 64 KiB(ب) 64 KiB | 16 | |
| (c) 1 MiB(ج) 1 MiB | 20 | |
| (d) 16 MiB(د) 16 MiB | 24 | |
| (e) 4 GiB(هـ) 4 GiB | 32 | |
| (f) 16 EiB(و) 16 EiB | 64 |
N address bits give addresses — the rule of How many patterns. Real processors and their address lines are in Registers and buses. Many books write these binary sizes as KB, MB, GB and EB; why that is unclear: 1,000 or 1,024?
N ناونیشان ناونیشان دەدات — هەمان یاسای ژمارەی شێوەکانـە. پرۆسێسەرە ڕاستەقینەکان و هێڵەکانی ناونیشانیان لە تۆمارگەکان و تێپەڕگەکاندا باس کراون. زۆر کتێب ئەم قەبارە بە KB، MB، GB و EB دەنووسن؛ بۆچی ئەمە ڕوون نییە: 1,000 یان 1,024؟
Write the next three numbers after (a) , (b) , (c) .
سێ ژمارەی دوای ئەمانە بنووسە: (أ) ، (ب) ، (ج) .
Show answerوەڵامەکە پیشان بدە
- (a) 1110, 1111, 10000
- (b) 20, 21, 22 — after 7 the octal digit rolls over
- (c) 2F, 30, 31 — after F the hex digit rolls over
- (أ) 1110، 1111، 10000
- (ب) 20، 21، 22 — دوای 7 دەگەڕێتەوە سەر 0
- (ج) 2F، 30، 31 — دوای F دەگەڕێتەوە سەر 0
In the 8-bit word 10010110, what are the MSB and the LSB, and what is the value of the word?
لە 8 10010110دا، MSB و LSB چین و نرخی چەندە؟
Show answerوەڵامەکە پیشان بدە
MSB and LSB . Value: .
MSB و LSB . نرخ: .
Summaryپوختە
- In a positional number system each place has a place value, a power of the base r; a number is the sum of digit × place value.
- Decimal (base 10, digits 0–9), binary (2, 0–1), octal (8, 0–7), hexadecimal (16, 0–9 and A–F, which stand for 10–15). Always write the base as a subscript.
- A word is the group of bits the CPU handles at once (8 to 64 bits). Bits are numbered (LSB, right) to (MSB, left).
- N bits give patterns; the largest unsigned value is (127 for 7 bits, 255 for a byte).
- Binary weights double to the left (1, 2, 4, 8 …) and halve to the right of the point (0.5, 0.25 …).
- Counting rolls over when a base runs out of digits: binary after 1, octal after 7, hex after F.
- Fixed names in x86 and Windows: nibble 4, byte 8, word 16, double word 32, quad word 64 bits. Byte order (endianness) says which byte of a word is stored first.
- لە بۆ هەر خانەیەک rـە؛ ژمارە کۆی × .
- ( 10، 0–9)، (2، 0–1)، (8، 0–7)، (16، 0–9 و A–F کە واتە 10–15). هەمیشە وەک بنووسە.
- ئەو کۆمەڵە کە بە یەکجار کاری لەسەر دەکات (8 تا 64 ). لە (LSB، ڕاست) تا (MSB، چەپ) ژمارە دەکرێن.
- N شێوە دەدات؛ گەورەترین نرخی بێنیشانە ـە (127 بۆ 7 ، 255 بۆ ).
- کێشەکانی بەرەو چەپ دوو هێندە دەبن (1، 2، 4، 8 …) و لە ڕاستی خاڵەکەوە نیوە دەبنەوە (0.5، 0.25 …).
- ژماردن کاتێک تەواو دەبن دەگەڕێتەوە سەر سفر: دوای 1، دوای 7، دوای F.
- ناوە جێگیرەکانی x86 و Windows: 4، 8، 16، 32، 64 . دەڵێت کام یەکەم هەڵدەگیرێت.
What does equal in decimal, and why? بە دەیی یەکسانە بە چی و بۆچی؟
16: “10” in any base means one group of the base and no units.
16: «10» لە هەر واتە یەک کۆمەڵەی و هیچ یەکەیەک.
Why do programmers like hexadecimal?بۆچی بەرنامەسازەکان حەز لە شانزەیی دەکەن؟
One hex digit is exactly 4 bits, so long binary numbers become short and easy to read, and can be turned back into bits digit by digit.
یەک ڕێک 4 ، بۆیە ژمارە درێژەکان کورت و ئاسان دەبن بۆ خوێندنەوە و دەتوانرێت بە بگەڕێندرێنەوە بۆ .
How many bits do you need for 1000 different values?بۆ 1000 نرخی جیاواز چەند بیت پێویستە؟
10 bits: is too few and is enough.
10 : کەمە و بەسە.
Videoڤیدیۆ
Watch a videoسەیری ڤیدیۆیەک بکە
A video that viewers liked a lot and praised in their comments, chosen for this lesson.ڤیدیۆیەک کە بینەران زۆریان پێ خۆش بووە و لە کۆمێنتەکانیاندا ستایشیان کردووە، بۆ ئەم وانەیە هەڵبژێردراوە.
The decimal, binary, octal and hexadecimal systems side by side, then decimal to octal and hex by dividing again and again.
، ، و لە تەنیشت یەکتر، پاشان گۆڕینی بۆ و بە دابەشکردنی دووبارە و دووبارە.
Chapters: 0:00 decimal, 1:16 binary, 1:49 octal, 2:26 hexadecimal (digits A-F = 10-15); stops at 3:36, where it starts converting 348 to binary (next lesson's method).
بەشەکان: 0:00 ، 1:16 ، 1:49 ، 2:26 ( A تا F = 10 تا 15)؛ لە 3:36 ڕادەوەستێت، کە دەست دەکات بە گۆڕینی 348 بۆ (ڕێگای وانەی دواتر).
Lesson complete!وانەکە تەواو بوو!
Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.
Key termsزاراوە سەرەکییەکان
From Decimal to Binary, Octal and Hexلە دەییەوە بۆ دووانی، هەشتی و شانزەیی
Related lecturesوانە پەیوەندیدارەکان
- From Decimal to Binary, Octal and Hexلە دەییەوە بۆ دووانی، هەشتی و شانزەیی
- From Binary, Octal and Hex to Decimalلە دووانی، هەشتی و شانزەییەوە بۆ دەیی
- Binary, Octal and Hex Shortcutsڕێگا کورتەکانی دووانی، هەشتی و شانزەیی
- Inside the Computerناو کۆمپیوتەرەکە
- Bits, Bytes and Storage Unitsبیتەکان، بایتەکان و یەکەکانی خەزنکردن
References and further readingسەرچاوەکان و خوێندنەوەی زیاتر
- T. L. Floyd, Digital Fundamentals, 11th ed. (Pearson, 2015), sections 2-1 Decimal numbers and 2-2 Binary numbers (course textbook)
- M. M. Mano and M. D. Ciletti, Digital Design, 6th ed. (Pearson, 2024), chapter 1 Digital Systems and Binary Numbers
- Wikipedia: Positional notation (place value, history, base conversion)
- Wikipedia: Hexadecimal (4 bits per digit, colour codes, 0x prefix)
- Wikipedia: Binary number (counting, weights)
- Python Language Reference: integer literals (0b, 0o, 0x)
- Harvard CS50 notes, week 0: bits and place values with light bulbs
- Wikipedia: Word (computer architecture)
- Wikipedia: Byte (history of the word)
- Wikipedia: Endianness
This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.