進数系と変換
導入済み
21:52
数系とデータ
この写真。この曲。この動画そのもの。あなたの名前、メッセージ、すべてのデバイスのすべてのファイル——コンピュータ内部では、すべてがゼロと一でしかありません。…
英語のナレーション・英語と中国語の字幕を切り替え可能
このレッスンの内容
| English | 意味 |
|---|---|
| hard drive | A device that stores data for long-term use in a computer. |
| gigabyte | A unit of data equal to one thousand million bytes. |
| byte/baɪt/ | バイト |
| operating system/ˈɒpəreɪtɪŋ ˈsɪstəm/ | System software that manages hardware resources and provides services for applications. |
| prefix/ˈpriːfɪks/ | A letter group or naming element added at the beginning of a word or name. |
| data representation | The way data is stored and given meaning using binary digits. |
| number systems | Ways of writing numbers using digits and rules for place value. |
| Denary/ˈdiːnəri/ | A number system using ten digits, from 0 to 9. |
| base/beɪs/ | The number of different digit symbols used by a positional number system. |
| digits/ˈdɪdʒɪts/ | Single symbols used to write numbers in a number system. |
| place values | The values of positions that determine how much each digit counts. |
| Binary/ˈbaɪnəri/ | A number system using two digits, 0 and 1. |
| bit/bɪt/ | ビット |
| nibble/ˈnɪbl/ | ニブル |
| Hexadecimal/ˌheksəˈdesɪml/ | A number system using digits 0 to 9 and letters A to F. |
| repeated division | A method of converting a number to binary by repeatedly dividing by two and reading remainders upwards. |
| remainder/rɪˈmeɪndə/ | The amount left after division into equal whole groups, or the residual expression after algebraic division. |
| register width/ˈredʒɪstə wɪtθ/ | レジスタ幅 |
| leading zeros | Zeros placed before the first non-zero digit to give a number the required width. |
| unsigned integer | A whole number stored without a sign, representing zero or a positive value. |
| BCD/ˌbiː siː ˈdiː/ | A way of storing each denary digit separately using four binary digits. |
| ASCII/ˈæski/ | A character code that uses seven bits to represent each character. |
| extended ASCII | A group of character codes that use eight bits to represent characters. |
| Binary prefixes | Prefixes that show quantities based on powers of two. |
| Decimal prefixes | Prefixes that show quantities based on powers of ten. |
| kilo | A decimal prefix meaning one thousand times a unit. |
| mega | A decimal prefix meaning one million times a unit. |
| giga | A decimal prefix meaning one thousand million times a unit. |
| tera | A decimal prefix meaning one million million times a unit. |
| memory/ˈmeməri/ | Circuits that store data, such as registers, RAM and ROM. |
| kibi/ˈkɪbi/ | キビ |
| mebi | A binary prefix meaning 2 to the power of 20 times a unit. |
| gibi | A binary prefix meaning 2 to the power of 30 times a unit. |
| tebi | A binary prefix meaning 2 to the power of 40 times a unit. |
| Memory addresses/ˈmeməri əˈdresɪz/ | Numbers that identify locations where data is stored in memory. |
| machine code/məˈʃiːn kəʊd/ | Instructions encoded in binary form that a processor can execute directly. |
| dump | A display or copy of data taken from computer memory or storage. |
| Colour codes | Values that describe colours using amounts of red, green and blue. |
| MAC addresses/mæk əˈdresɪz/ | Link-layer addresses used to identify network interfaces for communication on a local link. |
| error codes | Values that identify errors found by a computer system. |
| kibibyte/ˈkɪbɪbaɪt/ | A unit of data equal to 1,024 bytes. |
| kilobyte | A unit of data equal to 1,000 bytes. |
テラバイトではなかったテラバイト
- In 2005 a Californian bought a hard drive labelled 80 GB. His computer reported 74.5 GB. He sued, and the manufacturers eventually paid out: they had counted a gigabyte as a thousand million bytes, and the operating system had counted it as $2^{30}$.
- Neither was lying. There are two families of prefix, one built on powers of ten and one on powers of two, and they drift further apart the bigger the number gets.
- データ表現のすべてはこの考え方に依存しています。コンピュータは0と1以外何も保存せず、それ以外の意味は読み手の間の合意によって決まります。
- このレッスンは、3つの進数系、それらの間の変換、および2つの接頭辞グループについて解説します。
3つの進数系
- 十進法(10進)は桁0〜9を使用し、位取りの値は10の累乗です。これが日常使われる進数系です。
- Binary (base 2) uses 0 and 1, with place values that are powers of two. One digit is a bit; 4 bits are a nibble; 8 bits are a byte.
- Hexadecimal (base 16) uses 0 to 9 then A to F for 10 to 15. One hex digit stands for exactly 4 bits, which is why it is the shorthand programmers use for binary.
| Denary | Binary | Hex |
|---|---|---|
| 10 | 1010 |
A |
| 15 | 1111 |
F |
| 16 | 0001 0000 |
10 |
| 255 | 1111 1111 |
FF |

すべての進数系は位取りであり、異なるのは基数のみです
進数系
byte = Σ 桁の値
Each bit is worth a power of two — flip the bits and watch the decimal and hex update.
How many bits does one hexadecimal digit represent?
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
1桁のヘキサデシマル数字(0–F)は16の値をカバーします = $2^4$。したがって、正確に4ビット(ニブル)に対応します。
1バイトには何ビットありますか?
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
A byte is 8 bits (and a nibble is 4 bits).
Denary to binary
- 方法1:位取りによる変換。2の累乗を$128, 64, 32, 16, 8, 4, 2, 1$のように書き出し、最大で入るものを引き算して残りを処理し続けます。使用した位置の下に1を書きます。
- 方法2:連続除法による変換。2で繰り返し割り算を行い、余りを记录下来、最後に下から上へ読み取ります。
- $42 = 32 + 8 + 2$の場合、32、8、2の下のビットが1で、他は0となります:
0010 1010。

最大で入る2の累乗を引き算し、残りの処理を繰り返します

Convert denary $13$ to binary (8-bit not required — just the significant bits).
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
$13 = 8 + 4 + 1$ なので、8, 4, 1 の位がセットされます:1101。
二進数 00101010 を十進数に変換してください。
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
$32 + 8 + 2 = 42$ (32, 8, 2 の位がセットされています)。
Worked example: denary 200 to binary and hex
- $200 = 128 + 64 + 8$, so the 8-bit binary is
1100 1000. - Split into nibbles from the right:
1100is 12, which is C;1000is 8. So the hexadecimal isC8. - 逆方向の位取りで確認します:
C8$= 12 \times 16 + 8 = 200$。✓ 必ず計算過程を示してください。変換自体に得点がつきます。

Binary and hex, both directions
- Binary to hex: group the bits into nibbles from the right, padding the leftmost group with zeros, and convert each nibble.
0010 0010 1110becomes2 2 E, so22E. - Hex to binary: replace each hex digit with its own 4-bit pattern. No arithmetic needed.
- Hex to denary: multiply each digit by its place value, $16^2 = 256$, $16^1 = 16$, $16^0 = 1$.
22E$= 2 \times 256 + 2 \times 16 + 14 = 558$.

十六進数 2E を十進数に変換してください。
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
$2 \times 16 + 14 = 32 + 14 = 46$ (Eは14です)。
Convert the binary number 0010 0010 1110 to hexadecimal.
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
各ニブルは右から独立して変換されます:0010 = 2, 0010 = 2, 1110 = 14 = E。
値にいくつのビットが必要か?
- 試験問題ではレジスタ幅(8, 12 または 16 ビット)が固定されており、その幅になるように先頭にゼロをパディングする必要があります。$558$ を 12 ビットで表す場合、
0010 0010 1110となり、10 0010 1110ではありません。 - 0から$2^n - 1$までの符号なし整数には$n$ビット必要です:200には8ビット必要(8ビットで255まで)、1000には10ビット必要(10ビットで1023まで)、16には5ビット必要(4ビットでは15まで)。
- One hexadecimal digit needs 4 bits, one BCD digit needs 4 bits, and one ASCII character needs 7 bits, or 8 for extended ASCII.

十進数 558 を12ビットの二進数として書きなさい(グループごとに4ビット、スペースは可)。
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
558 = 512 + 32 + 8 + 4 + 2。問題が指定する12ビットになるよう先頭をゼロで埋めください。ゼロ埋めがないと失点します。
worked example: 必要な最小ビット数
- あるシステムが0から1000までの値を格納しなければならない場合、最小何ビット必要か?
- 1000より最初に大きい2の累乗はどれかを問います。$2^9 = 512$では小さすぎます;$2^{10} = 1024$なので、10ビットで0〜1023を保持でき、1000も収まります。
- 答えは10ビットであり、理由は桁数ではなく範囲です。よくある罠:16には5ビット必要です。なぜなら4ビットでは15までしか表せないからです。
0から1000までの任意の符号なし値を格納できる最小のビット数は幾つですか?
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
9ビットでは最大511、10ビットでは最大1023になります。問題はビットの数ではなく、その範囲をカバーすることに関するものです。
Binary prefixes and decimal prefixes
- Decimal prefixes are powers of ten and are used for drive capacities and network speeds: kilo $= 10^3$, mega $= 10^6$, giga $= 10^9$, tera $= 10^{12}$.
- Binary prefixes are powers of two and are used for memory sizes: kibi (Ki) $= 2^{10} = 1024$, mebi (Mi) $= 2^{20}$, gibi (Gi) $= 2^{30}$, tebi (Ti) $= 2^{40}$.
- つまり「1 TB」のドライブには$10^{12}$バイトが入りますが、OSがTiB単位で報告する場合、$2^{40}$で割って約0.91を表示します。データが失われたわけではありません。異なる単位が使われただけです。

1キビバイト (KiB) には何バイトありますか?
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
キビバイトは $2^{10} = 1024$ バイト(メモリ用バイナリ接頭語)。
1 TBとして販売されているドライブは、1 TiBのメモリよりも少ないバイトを保持します。
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
$1\ \text{TB}$ is $10^{12}$ bytes; $1\ \text{TiB}$ is $2^{40}$ガス (cm³) $1.1 \times 10^{12}$. Decimal prefixes for drives, binary prefixes for memory.
Where hexadecimal is actually used
- Memory addresses and machine code, because one hex digit is exactly one nibble and a byte is exactly two hex digits, so a dump is readable at a glance.
- ウェブページのカラーコード:
#FF8800はそれぞれ1バイトの赤、緑、青を表します。MACアドレスやエラーコードも同様の理由です。 - The reason is always the same: hex is a shorthand for binary that a person can read and write without mistakes, not a system the computer itself uses.
実務において十六進数はどこで使用されますか?すべて該当するものを選択してください。
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
Hex is a human-readable shorthand for binary: one digit per nibble, two per byte. The processor itself works in binary.
見落としやすいポイント
- 問題で指定された幅にパッドしてください。パッドがないと、ビット自体は正しくても失点します。
- Group nibbles from the right, not the left, or every hex digit shifts.
- 4ビットは15まで、8ビットは255まで、10ビットは1023まで。「何ビット必要か」は範囲に関する問題です。
- A kibibyte is 1024 bytes and a kilobyte is 1000. Say which you used in any size calculation.
理解できましたか
- denary base 10, binary base 2 (bit, nibble = 4 bits, byte = 8 bits), hexadecimal base 16 where one digit is exactly one nibble
- denary to binary by subtracting powers of two or by repeated division reading remainders bottom-up; binary to hex by grouping nibbles from the right; hex to denary by place value
- レジスタ幅にパッドする;符号なし値が$n$ビット必要で、$2^n$が初めて超えるとき
- decimal prefixes are powers of ten (drives, networks), binary prefixes powers of two (memory): kibi $= 1024$
何が問題でしたか?この内容はサイトの運営チームだけが確認します。