בתוך מעבד קיימים מיליארדי מתגים זעירים. כל אחד מהם יכול להיות רק בדלק או כבוי. זהו כל מה שיש למחשב פיזית — אין שם שלוש, אין שבע, אין… ⟦number⟧
English narration · English + 中文 subtitles burned in · קריאת קול באנגלית · תרגום אנגלי + סינית שרוף בתוך הסרטון
1.1
Why computers use binary · מדוע מחשבים משתמשים במערכת בין-ספרתית
English
A computer can only work with two states: on and off. You write these as 1 and 0. A system that uses only two digits 数字 is called binary 二进制 (base 2).
Every kind of data 数据 — numbers, text, sound and images — must be changed into binary before a computer can use it. The computer processes this binary using logic gates 逻辑门, and stores it in registers 寄存器 (small, fast stores inside the processor 处理器).
עברית
מחשב יכול לעבוד רק בשני מצבים: פועל וכבוי. כותבים אותם כ-1 ו-0. מערכת שמשתמשת בשני דיגיטים בלבד נקראת בינארית (בסיס 2).
מחשבים מייצגים כל נתון — מספרים, טקסט, קול ותמונות — כמחלקות בינאריות של 0s ו-1s
כל סוג של נתון — מספרים, טקסט, קול ותמונות — חייב להיות מומש לבינארי לפני שמחשב יכול להשתמש בו. המחשב מעבד את הבינארי הזה באמצעות שער לוגי, ואחסנו אותו ב-ריגיסטר (אחסון קטן ומהיר בתוך המעבד).
מעבד מיक्रוחזיק מיליוני טרנזיסטורים זעירים, כל אחד מתחלף הוא הפועל (1) או הכבוי (0) — הבסיס הפיזי של הבינארית
1 Understand how and why computers use binary to represent all forms of data
• Any form of data needs to be converted to binary to be processed by a computer • Data is processed using logic gates and stored in registers
2 (a) Understand the denary, binary and hexadecimal number systems (b) Convert between (i) positive denary and positive binary (ii) positive denary and positive hexadecimal (iii) positive hexadecimal and positive binary
• Denary is a base 10 system • Binary is a base 2 system • Hexadecimal is a base 16 system • Values used will be integers only • Conversions in both directions, e.g. denary to binary or binary to denary • Maximum binary number length of 16-bit
3 Understand how and why hexadecimal is used as a beneficial method of data representation
• Areas within computer science that hexadecimal is used should be identified • Hexadecimal is easier for humans to understand than binary, as it is a shorter representation of binary
4 (a) Add two positive 8-bit binary integers (b) Understand the concept of overflow and why it occurs in binary addition
• An overflow error will occur if the value is greater than 255 in an 8-bit register • A computer or a device has a predefined limit that it can represent or store, for example 16-bit • An overflow error occurs when a value outside this limit should be returned
5 Perform a logical binary shift on a positive 8-bit binary integer and understand the effect this has on the positive binary integer
• Perform logical left shifts • Perform logical right shifts • Perform multiple shifts • Bits shifted from the end of the register are lost and zeros are shifted in at the opposite end of the register • The positive binary integer is multiplied or divided according to the shift performed • The most significant bit(s) or least significant bit(s) are lost
6 Use the two’s complement number system to represent positive and negative 8-bit binary integers
• Convert a positive binary or denary integer to a two’s complement 8-bit integer and vice versa • Convert a negative binary or denary integer to a two’s complement 8-bit integer and vice versa
עברית
המועמדים צריכים להיות מסוגלים:
הערות והנחיות
1 הבן כיצד ומדוע מחשבים משתמשים בבינארי כדי לייצג כל צורות נתונים
• כל צורת נתונים צריכה להיות מומרת לבינארי כדי לעובד על ידי מחשב • נתונים מעובדים באמצעות שערי לוגיקה ואחסונים ברישמות
2 (א) הבנת מערכות הספרות עשרוניות, דו-ספרתיות ו-שיש-עשרוניות (ב) המרה בין (i) עשרוני חיובי לדו-ספרתי חיובי (ii) עשרוני חיובי לשיש-עשרוני חיובי (iii) שיש-עשרוני חיובי לדו-ספרתי חיובי
• מערכת עשרונית היא מערכת בסיס 10 • מערכת דו-ספרתית היא מערכת בסיס 2 • מערכת שיש-עשרונית היא מערכת בסיס 16 • הערכים המשמשים יהיו מספרים שלמים בלבד • המרות בשני הכיוונים, למשל מערכת עשרונית לדו-ספרתית או דו-ספרתית לעשרונית • אורך מקסימלי של מספר דו-ספרתי הוא 16-ביט
3 הבן כיצד ומדוע הקסדצימאלי משמש כשיטה מועילה לייצוג נתונים
• יש לזהות תחומים בתחום מדעי המחשב בהם משתמשים בקסדצימאלי • הקסדצימאלי קל יותר לאנושים להבנה מאשר בינארי, מכיוון שהוא ייצור קצר יותר לבינארי
4 (א) חבר שני מספרים שלמים בינאריים חיוביים בגודל 8-ביט (ב) הבן את מושג העלאת סף (overflow) ומדוע היא מתרחשת בחיבור בינארי
• שגיאת העלאת סף תתרחש אם הערך גדול מ-255 ברישום 8-ביט • למחשב או למכשיר יש מגבלה מוגדרת מראש שיכול לייצג או לאחסן, לדוגמה 16-ביט • שגיאת העלאת סף מתרחשת כאשר ערך מחוץ לגבול זה צריך להיות מוחזר
5 בצע הזזה לוגית בינארית על מספר שלם בינארי חיובי בגודל 8-ביט והבן את ההשפעה שיש לכך על המספר הבינארי החיובי
• בצע הזזות שמאל לוגיות • בצע הזזות ימינה לוגיות • בצע הזזות מרובות • ביטים המוזזים מהקצה של הרישום אבודים ואפסים מוזזים לתוך הקצה הנגדי של הרישום • המספר הבינארי החיובי מכפיל או מחולק בהתאם להזזה שבוצעה • הביט(ים) המשמעותי(ים) ביותר או הביט(ים) המשמעותי(ים) פחות אובדים
6 השתמש במערכת המספרים משלים לשניים כדי לייצג מספרים שלמים בינאריים חיוביים ושליליים בגודל 8-ביט
• המר מספר שלם בינארי או עשרוני חיובי למספר שלם בגודל 8-ביט במשלים לשניים ולהפך • המר מספר שלם בינארי או עשרוני שלילי למספר שלם בגודל 8-ביט במשלים לשניים ולהפך
Source: Cambridge International syllabus · מקור: הסיילבוס הבינלאומי של קמבריד'ג'
English
Counting in binary: 0 to 15
A number system 数制 is a way of writing numbers using a fixed set of digits. You need three of them.
System
Base
Digits used
Denary
10
0–9
Binary
2
0 and 1
Hexadecimal
16
0–9 then A–F
denary 十进制 is the normal counting system (also called decimal).
binary uses only 0 and 1.
hexadecimal 十六进制 (hex) uses sixteen digits: 0–9, then A, B, C, D, E, F stand for 10, 11, 12, 13, 14, 15.
The base 基数 tells you how many different digits a system uses.
Place value
Each column in a number has a place value 位值. In binary the place values double from right to left. For an 8-bit number they are:
One bit 位 is a single 0 or 1. Eight bits make one byte 字节. Four bits (half a byte) is a nibble 半字节.
Converting between number systems
Denary → binary. Write the place values. Put a 1 under each value you need so they add up to your number; put 0 under the rest.
Binary → hexadecimal. Group the bits into nibbles of 4, starting from the right. Change each nibble to one hex digit.
Denary → hexadecimal. The easy way is to change to binary first, then binary to hex.
This table helps with the hex letters:
Denary
Binary
Hex
10
1010
A
11
1011
B
12
1100
C
13
1101
D
14
1110
E
15
1111
F
Cambridge questions use binary numbers up to 16 bits long.
Worked example. Convert denary 100 to 8-bit binary, then to hexadecimal.
$100 = 64 + 32 + 4$, so the binary is 01100100. Splitting into nibbles, 01100100$= 6$ and $4$, so the hexadecimal is 64.
Why hexadecimal is used
Hex is shorter than binary and easier for people to read and write. One hex digit replaces 4 binary digits, so you make fewer mistakes. The value does not change — hex is just a shorter way to show the same binary.
Computer scientists use hex for:
MAC addresses and IPv6 addresses
colour codes in HTML (for example #FF0000 is red)
memory addresses 内存地址 and error codes
showing the contents of memory (a "memory dump")
עברית
ספירה במערכת דו-ספרתית: 0 עד 15
מערכת ספרות היא דרך לכתיבת מספרים באמצעות ערכה קבועה של דיגיטים. אתם צריכים שלושה מהם.
מערכת
בסיס
דיגיטים בשימוש
עשרונית
10
0–9
דו-ספרתית
2
0 ו-1
התרסעירית
16
0–9 ולאחר מכן A–F
עשרוני היא מערכת הספירה הרגילה (נקראת גם עשרונית).
בינארית משתמשת רק ב-0 וב-1.
הקסאדצימלית (הקס) משתמשת בששה עשר דיגיטים: 0–9, ולאחר מכן A, B, C, D, E, F מייצגים 10, 11, 12, 13, 14, 15.
הבסיס מספר כמה דיגיטים שונים מערכת משתמשת.
ערך מקום
לכל עמודה במספר יש ערך מקום. במערכת הבינארית, ערכי המקום כפולים מימין לשמאל. עבור מספר ב-8 ביט, הם:
128 64 32 16 8 4 2 1
טבלת ערכי מקום ל-8 ביט: ה-1s נמצאים מתחת לערכים שמסכמים ל-150
ביט אחד הוא 0 או 1 יחיד. שמונה ביטים יוצרים בייט אחד. ארבעה ביטים (חצי בייט) קרוי ניבול.
המרה בין מערכות ספרות
מערכת עשרונית → בינארית. כתוב את ערכי המקום. הנח 1 מתחת לכל ערך שצריך כדי שיסכמו למספר שלך; הנח 0 מתחת לשאר.
כל ספרה הקסדצימלית מתאימה לניבול של 4 ביטים משלה — F08 = 1111 0000 1000
בינארי → הקסדצימליות. חלק את הביטים לקבוצות של 4 ביטים (ניבולים), החל מימין. הפוך כל ניבול לספרה הקסדצימלית אחת.
עשרוני → הקסדצימליות. הדרך הקלה היא להפוך תחילה לבינארי, ואז מהבינארי להקסדצימליות.
טבלה זו מסייעת עם אותיות ההקסדצימליות:
עשרונית
בינארית
עשירית עשרונית
10
1010
A
11
1011
B
12
1100
C
13
1101
D
14
1110
E
15
1111
F
שאלות Cambridge משתמשות במספרים בינאריים באורך עד 16 ביט.
דוגמה פותרת. המר את 100 בעשרונית לבינארי ב-8 ביט, ולאחר מכן להקסדצימליות.
$100 = 64 + 32 + 4$, ולכן הבינארי הוא 01100100. בחלוקה לניבולים, 01100100$= 6$ ו-$4$, ולכן ההקסדצימליות היא 64.
למה משתמשים בהקסדצימליות
הקוד המעריכי קצר יותר מהבינארי וקל יותר לקריאה וכתיבה על ידי אנשים. ספרת מעריכית אחת מחליפה 4 ספרות בינאריות, ולכן עושים פחות טעויות. הערך אינו משתנה — הקוד המעריכי הוא רק דרך קצרה להציג את אותו בינארי.
מדעיני מחשב משתמשים בקוד מעריכי עבור:
כתובות MAC וכתובות IPv6
קודי צבע ב-HTML (לדוגמה #FF0000 הוא אדום)
כתובות זיכרון וקודי שגיאה
הצגת תוכן הזיכרון ("פלט זיכרון")
Explore · חקור
Binary, denary and hex · בינארי, עשרוני ו-HEX
Type a number and see it in binary, denary and hex — and how the place values build it. · הקלד מספר וראה אותו ב-בינארי, עשרוני ו-HEX — ואיך ערכי המקום בונים אותו.
You can add two 8-bit binary numbers, column by column from the right, just like denary. The rules for one column are:
A
B
Result bit
Carry
0
0
0
0
0
1
1
0
1
0
1
0
1
1
0
1
When a carry also comes in, $1 + 1 + 1 = 1$ with a carry of 1.
Example: add 01110110 (118) and 00110000 (48).
Overflow
An 8-bit register can hold denary values from 0 to 255 only. If an addition gives a result above 255, the answer needs a 9th bit. The register cannot hold this extra bit, so it is lost. This is called overflow 溢出 (an overflow error). It happens when a value goes outside the limit the register can store.
Example: 11001000 (200) $+$01001000 (72) $= 272$. In binary that is 1 00010000, which needs 9 bits. The leading 1 will not fit in 8 bits, so the stored answer is wrong.
עברית
ניתן לחבר שני מספרים בינאריים של 8 ביטים, עמודה בעמודה מימין לשמאל, בדיוק כמו במערכת העשרונית. הכללים לעמודה אחת הם:
רשמה ב-8 ביטים יכולה להכיל ערכים עשרוניים מ-0 עד 255 בלבד. אם תוצאת הסיכום היא מעל 255, התשובה תזדקק ל-9 ביט נוסף. הרשמה אינה יכולה להכיל ביט נוסף זה, ולכן הוא מאבד. תופעה זו נקראת גלישה (שגיאת גלישה). היא מתרחשת כאשר ערך עובר מחוץ לגבול שמספרת הרשמה יכולה לאחסן.
דוגמה: 11001000 (200) $+$01001000 (72) $= 272$. בבינארי זהו 1 00010000, הדורש 9 ביטים. הביט הראשון 1 לא יכנס ב-8 ביטים, ולכן התשובה המאוחסנת שגויה.
הוספת 200 ו-72 דורשת 9 ביטים, אך רשמה של 8 ביטים מוותרת על הביט התשיעי, ולכן התשובה שגויה
A logical binary shift 逻辑二进制移位 moves all the bits left or right by a number of places.
Bits that move off the end of the register are lost.
Zeros are added at the empty end.
A left shift multiplies the number by 2 for each place moved. A right shift divides it by 2 for each place; the right-most bits (the least significant bit(s) 最低有效位) are lost.
Example: left shift 00110101 (53) by 2 places.
The result is 11010100 (212), which is $53 \times 4$. The two left-most bits were lost and two zeros came in on the right. If a 1 is pushed off the end, that information is gone for good.
עברית
הזזה לוגית בינארית מזיזה את כל הביטים שמאלה או ימינה במספר מקומות.
ביטים שיוצאים מהקצה של הרגסטר נאבדים.
אפסים נוספים בקצה הריק.
הזזה שמאלית כופלת את המספר ב-2 עבור כל מקום שהוזז. הזזה ימינה מחלקת אותו ב-2 עבור כל מקום; הביטים הימניים ביותר (הביט/ים המשמעותיים ביותר) נאבדים.
הזזה שמאלית ב-2: כל ביט זז 2 מקומות שמאלה, הביטים העליונים אובדים ואפסים ממלאים את הימין
התוצאה היא 11010100 (212), שזהו $53 \times 4$. שני הביטים השמאליים ביותר אובדו ושני אפסים נכנסו מימין. אם 1 נשלף מהקצה, המידע הזה אבוד לעולם.
1.1
Two's complement · תשלום שניים
English
So far the numbers were positive. Two's complement 补码 lets an 8-bit register hold negative numbers too.
In two's complement, the left-most bit (the most significant bit 最高有效位, or MSB) has a negative place value:
If the MSB is 0, the number is positive.
If the MSB is 1, the number is negative.
To make a positive number negative: write the positive binary, flip every bit (0↔1), then add 1.
Example: make $-40$.
$+40$ = 00101000
flip the bits = 11010111
add 1 = 11011000
So $-40$ = 11011000. Check by adding the place values: $-128 + 64 + 16 + 8 = -40$.
To read a negative two's complement number, just add the place values (the MSB counts as $-128$). The range of an 8-bit two's complement number is $-128$ to $+127$.
עברית
עד כה המספרים היו חיוביים. תשלום שניים מאפשר לרגסטר 8 ביט להכיל גם מספרים שליליים.
בתשלום שניים, הביט השמאלי ביותר (הביט המשמעותי ביותר, או MSB) הוא בעל ערך מקום שלילי:
-128 64 32 16 8 4 2 1
אם ה-MSB הוא 0, המספר חיובי.
אם ה-MSB הוא 1, המספר שלילי.
להפוך מספר חיובי לשלילי: כתוב את הבינארי החיובי, הפוך כל ביט (0↔1), ואז הוסף 1.
דוגמה: הפוך את $-40$.
$+40$ = 00101000
הפכת הביטים = 11010111
הוספת 1 = 11011000
אז $-40$ = 11011000. בדוק על ידי חיבור ערכי המקום: $-128 + 64 + 16 + 8 = -40$.
הביט המשמעותי ביותר שווה ל-128−, ולכן 11011000 = −128 + 64 + 16 + 8 = −40
לקרוא מספר בשלילי בתשלום שניים, פשוט חבר את ערכי המקום (ה-MSB נחשב כ$-128$). הטווח של מספר בשלילי בתשלום שניים 8 ביט הוא $-128$ עד $+127$.
1.2
Representing text · נייגון טקסט
Syllabus · סיילבוס
English
Candidates should be able to:
Notes and guidance
1 Understand how and why a computer represents text and the use of character sets, including American standard code for information interchange (ASCII) and Unicode
• Text is converted to binary to be processed by a computer • Unicode allows for a greater range of characters and symbols than ASCII, including different languages and emojis • Unicode requires more bits per character than ASCII
2 Understand how and why a computer represents sound, including the effects of the sample rate and sample resolution
• A sound wave is sampled for sound to be converted to binary, which is processed by a computer • The sample rate is the number of samples taken in a second • The sample resolution is the number of bits per sample • The accuracy of the recording and the file size increases as the sample rate and resolution increase
3 Understand how and why a computer represents an image, including the effects of the resolution and colour depth
• An image is a series of pixels that are converted to binary, which is processed by a computer • The resolution is the number of pixels in the image • The colour depth is the number of bits used to represent each colour • The file size and quality of the image increase as the resolution and colour depth increase
עברית
המועמדים צריכים להיות מסוגלים:
הערות והנחיות
1 הבן כיצד ומדוע מחשב מייצג טקסט ואת השימוש בסטיות תווים, כולל קוד סטנדרטי אמריקאי להחלפת מידע (ASCII) ו-יוניקוד
• טקסט מומר לבינארי כדי לעובד על ידי מחשב • יוניקוד מאפשר טווח רחב יותר של תווים וסמלים מאשר ASCII, כולל שפות שונות ואימוג'ים • יוניקוד דורש יותר ביטים לכל תוו מאשר ASCII
2 הבן כיצד ומדוע מחשב מייצג קול, כולל השפעות קצב הדגימה ורזולוציית הדגימה
• גל קול נדגם כדי לקול יומר לבינארי, שיעובד על ידי מחשב • קצב הדגימה הוא מספר הדגימות שנלקחות בשנייה • רזולוציית הדגימה היא מספר הביטים לכל דגימה • הדיוק של ההקלטה וגודל הקובץ עולים ככל שקצב הדגימה והרזולוציה עולים
3 הבן כיצד ומדוע מחשב מייצג תמונה, כולל השפעות רזולוציה ועומק צבע
• תמונה היא סדרה של פיקסלים שהמרה לבינארי, שיעובד על ידי מחשב • הרזולוציה היא מספר הפיקסלים בתמונה • עומק הצבע הוא מספר הביטים המשמשים לייצוג כל צבע • גודל הקובץ ואיכות התמונה עולים ככל שרזולוציה ועומק הצבע עולים
Source: Cambridge International syllabus · מקור: הסיילבוס הבינלאומי של קמבריד'ג'
English
Computers store text by giving every character a number, then storing that number in binary. The set of characters a computer can use, together with their numbers, is a character set 字符集.
ASCII uses 7 bits per character, so it has 128 different characters. This is enough for English letters, digits and common symbols.
Unicode uses more bits per character. It can represent far more characters — many languages, plus symbols and emoji 表情符号.
Because Unicode has more characters, it needs more bits per character than ASCII, so the same text takes more storage 存储.
עברית
מחשבים שומרים טקסט על ידי assigning מספר לכל תווית, ולאחסון המספר הזה בצורה בינארית. הקבוצה של התוויות שהמחשב יכול להשתמש בהן, יחד עם המספרים שלהם, נקראת ערכת תוויות.
ASCII משתמש ב-7 ביטים לתווית אחת, ולכן יש לו 128 תוויות שונות. זה מספיק לאותיות אנגליות, ספרות וסמלים נפוצים.
Unicode משתמש במספר ביטים גדול יותר לתווית. הוא יכול לייצג הרבה יותר תוויות – מגוון רחב של שפות, בנוסף לסמלים ו-אמוג'י.
מכיוון ש-lUnicode מכיל יותר תוויות, הוא זקוק למספר ביטים גדול יותר לתווית מאשר ASCII, ולכן אותו טקסט דורש יותר מקום אחסון.
ASCII משתמש ב-7 ביטים עבור 128 תוויות; Unicode משתמש במספר ביטים גדול יותר עבור הרבה יותר תוויות אך דורש יותר אחסון
A sound wave 声波 is smooth and always changing. To store it, the computer measures the height of the wave at regular moments. This is called sampling 采样, and each measurement is a sample.
sample rate 采样率 is the number of samples taken each second (measured in Hz).
sample resolution 采样分辨率 is the number of bits used for each sample. The height of the wave at a sample point is its amplitude 振幅.
A higher sample rate and a higher sample resolution give a more accurate recording, but a larger file.
עברית
גל קולי הוא חלק ותמיד משתנה. כדי לאחסן אותו, המחשב מודד את גובה הגל ברגעים קבועים. תהליך זה נקרא דגימה, והמודד בכל עונה הוא דגימה.
דגימה מקליטה את גובה הגל (האמפליטודה) ברגעים קבועים
קצב דגימה הוא מספר הדגימות שנלקחות בכל שנייה (נמדד בהרץ).
רזולוציית דגימה היא מספר הביטים המשמשים לכל דגימה. גובה הגל בנקודת דגימה הוא ה-אמפליטודה שלו.
קצב דגימה גבוה ורזולוציית דגימה גבוהה נותנים הקלטה מדויקת יותר, אך קובץ גדול יותר.
Explore · חקור
Representing sound · ייצוג קול
y = a sin(bt + c)
Sound is a wave; sampling records its height many times a second. · קול הוא גל; דגימה תועדת את גובהו מספר פעמים בשנייה.
• Including: – bit – nibble – byte – kibibyte (KiB) – mebibyte (MiB) – gibibyte (GiB) – tebibyte (TiB) – pebibyte (PiB) – exbibyte (EiB) • The amount of the previous denomination present in the data storage size, e.g.: – 8 bits in a byte – 1024 mebibytes in a gibibyte
2 Calculate the file size of an image file and a sound file, using information given
• Answers must be given in the units specified in the question. Calculations must use the measurement of 1024 and not 1000 • Information given may include: – image resolution and colour depth – sound sample rate, resolution and length of track
3 Understand the purpose of and need for data compression
• Compression exists to reduce the size of the file • What the impact of this is, e.g.: – less bandwidth required – less storage space required – shorter transmission time
4 Understand how files are compressed using lossy and lossless compression methods
• Lossy compression reduces the file size by permanently removing data, e.g. reducing resolution or colour depth, reducing sample rate or resolution • Lossless compression reduces the file size without permanent loss of data, e.g. run length encoding (RLE)
2 חשב את גודל הקובץ של קובץ תמונה וקובץ קול, באמצעות מידע שניתן
• התשובות חייבות להיות נתונות ביחידות שנקבעו בשאלה. החישובים חייבים להשתמש במדידה של 1024 ולא 1000 • המידע שניתן עשוי לכלול: – רזולוציה ותמונה ועומק צבע – קצב דגימת קול, רזולוציה ואורך רצועה
3 הבן את המטרה והצורך בדחיסת נתונים
• דחיסה קיימת כדי להקטין את גודל הקובץ • מה ההשפעה של כך, לדוגמה: – פס רחב פחות נדרש – מקום אחסון פחות נדרש – זמן העברה קצר יותר
4 הבן כיצד קבצים דחוסים באמצעות שיטות דחיסה מאבדת ודחיסה ללא אובדן
• דחיסה מאבדת מצמצמת את גודל הקובץ על ידי הסרת נתונים לצמיתות, לדוגמה: הפחתת רזולוציה או עומק צבע, הפחתת תדירות דגימה או רזולוציה • דחיסה ללא אובדן מצמצמת את גודל הקובץ ללא אובדן נתונים לצמיתות, לדוגמה: קידוד אורך-רצף (RLE)
Source: Cambridge International syllabus · מקור: הסיילבוס הבינלאומי של קמבריד'ג'
English
Data storage is measured in the units below. A nibble is 4 bits and a byte is 8 bits; from the kibibyte upward, each unit is 1024 times the one before it (because $1024 = 2^{10}$, which fits binary).
Unit
Equals
bit
a single 0 or 1
nibble
4 bits
byte
8 bits
kibibyte (KiB)
1024 bytes
mebibyte (MiB)
1024 KiB
gibibyte (GiB)
1024 MiB
tebibyte (TiB)
1024 GiB
pebibyte (PiB)
1024 TiB
exbibyte (EiB)
1024 PiB
עברית
נפח אחסון נתונים נמדד ביחידות הבאות. ניבל הוא 4 ביטים ובית הוא 8 ביטים; החל מקיבייט ומעלה, כל יחידה היא פי 1024 מהיחידה הקודמת לה (מכיוון ש$1024 = 2^{10}$, שהתאים למערכת הספרות הדרווי).
יחידה
שווה ל-
bit
0 או 1 בודדים
nibble
4 ביטים
byte
8 ביטים
kibibyte (KiB)
1024 בייטים
mebibyte (MiB)
1024 KiB
gibibyte (GiB)
1024 MiB
tebibyte (TiB)
1024 GiB
pebibyte (PiB)
1024 TiB
exbibyte (EiB)
1024 PiB
צלחות דיסק קשיח: נפח אחסון נמדד בבייטים — כדי לדעת גודל קובץ יש צורך במידע על רוחב × גובה × עומק צבע לתמונות
Sound file size (in bits) $=$ sample rate $\times$ sample resolution $\times$ length in seconds.
Always divide by 1024 (not 1000) to change to KiB, MiB and so on. Give your answer in the unit the question asks for.
Worked example. A sound is recorded for 30 seconds at a sample rate of 8,000 Hz with a sample resolution of 16 bits. Find the file size in kibibytes (KiB).
Compression 压缩 makes a file smaller. A smaller file:
uses less storage space,
needs less bandwidth 带宽 (the amount of data a connection can carry),
takes a shorter time to send (a shorter transmission 传输 time).
There are two types.
Lossless compression
Lossless 无损 compression makes the file smaller with no permanent loss of data. The original file can be rebuilt exactly.
One method is run-length encoding 行程编码 (RLE). It replaces a run of repeated values with one copy of the value and a count of how many times it repeats. For example WWWWWWWW (8 whites) is stored as "8 W". This works well when data has many repeats.
Lossy compression
Lossy 有损 compression makes the file much smaller by permanently removing some data. The removed data cannot be got back. For example:
reducing the resolution or colour depth of an image,
reducing the sample rate or sample resolution of a sound.
Use lossless when you must keep every detail (text and program files). Use lossy for photos, music and video, where a small loss of quality is worth a much smaller file.
עברית
דחיסה הופכת קובץ לקטן יותר. קובץ קטן יותר:
משתמש בפחות מקום אחסון,
זקוק ל-רוחב פס קטן יותר (כמות המידע שאפשר לשאת בקישור),
לוקח זמן קצר יותר להעברה (זמן שידור קצר יותר).
ישנם שני סוגים.
דחיסה ללא איבוד נתונים
דחיסה ללא איבוד נתונים הופכת את הקובץ לקטן יותר ללא אובדן צמטי של מידע. ניתן לבנות מחדר את הקובץ המקורי בדיוק.
אחת השיטות היא הצפנת אורך רצף (RLE). היא מחליפה רצף של ערכים חוזרים בעות אחת מהערך ובספירה כמה פעמים הוא חוזר. לדוגמה WWWWWWWW (8 לבנים) מאוחסן כ-"8 W". זה עובד היטב כאשר למידע יש הרבה חזרות.
הצפנת אורך רצף מאחסנת כל רצף פעם אחת כספירה וערך
דחיסה עם איבוד נתונים
דחיסה עם איבוד נתונים הופכת את הקובץ לקטן משמעותית על ידי הסרה צמטית של חלק מהנתונים. הנתונים שהוסרו לא יכולים לחזור. לדוגמה:
הפחתת הרזולוציה או עומק הצבע של תמונה,
הפחתת תדירות הדגימה או רזולוציית הדגימה של קלטת שמע.
השתמשו בדחיסה ללא איבוד נתונים כאשר חובה לשמור על כל פרט (קבצי טקסט ותוכנה). השתמשו בדחיסה עם איבוד נתונים לתמונות, מוזיקה ווידאו, שבו איבוד קטן באיכות שווה לקובץ קטן הרבה יותר.
Explore · חקור
Run-length encoding · אנכוד רצפים
Watch repeated symbols get squashed into a count — simple lossless compression. · התבונן בסמלים חוזרים הנדחסים לספירה — דחיסה פשוטה ללא איבוד נתונים.
1.3
Exam tips · טיפים לבחינות
English
Convert denary → binary by subtracting the place values (128, 64, 32 …); binary → denary by adding the place values that hold a 1.
To convert to hex, group the binary into nibbles of 4 bits from the right; each nibble is exactly one hex digit.
Overflow happens when a result needs more bits than the register has (an 8-bit register only holds 0–255), so the extra bit is lost.
File size in bits: for an image, width × height × colour depth; for sound, sample rate × resolution × seconds. Divide by 8 for bytes, then by 1024 for each larger unit.
Lossless compression keeps every bit (text; run-length encoding); lossy permanently removes data (photos, music) for a much smaller file.
עברית
ממירו מערכת עשרונית → בינארית על ידי חיסור ערכי המקום (128, 64, 32 …); בינארית → עשרונית על ידי חיבור ערכי המקום שמכילים 1.
להמרה לשישה עשר, יש לסדר את הבינארי בקבוצות של 4 ביטים (ניבלים) מימין לשמאל; כל ניבל מייצג בדיוק דיגיט אחד בשישה עשר.
התחממות יתר (Overflows) מתרחשת כאשר התוצאה דורשת יותר ביטים מאשר הרישום מכיל (רישום בגודל 8 ביטים יכול לאחסן רק 0–255), ולכן הביט העודף אובד.
גודל קובץ בביטים: לתמונה, רוחב × גובה × עומק צבע; לקול, תדירות דגימה × רזולוציה × שניות. לחלק ב-8 לקבלת байت, ולאחר מכן לחלק ב-1024 לכל יחידה גדולה יותר.
דחיסה ללא איבוד נתונים משמרת כל ביט (כמו בטקסט או באנcohing באורך); דחיסה עם איבוד נתונים מסירה לעולם נתונים (תמונות, מוזיקה) כדי ליצור קובץ קטן הרבה יותר.
Interactive lessons on this topic · שיעורים אינטראקטיביים בנושא זה
Work through it step by step, with instant-check exercises. · לעבור על הדברים צעד אחר צעד, עם תרגילים לבדיקה מיידית.
Pick one and the site follows you — notes, papers, videos and practice all open on it. · בחרו נושא אחד והאתר יעקוב אחריו — הערות, מסמכים, וידאו ותרגולים פתוחים בו.
Type to search notes, lessons, code, vocabulary and past-paper questions across every subject. · הקלד כדי לחפש הערות, שיעורים, קוד, אוצר מילים ושאלות מבחנים בכל הנושאים.