2バイトで1文字を表すとき, 何種類の文字まで表せるか。
平成25年度 秋期 ITパスポート試験 問76
This question's explanation and your answers so far.
問 76
Incorrectア
32,000 is the value calculated as 32 × 1,000 by regarding 32K as 1K = 1,000, and it is not a power of 2. In the first place, the number of combinations of 16 bits is 2 to the power of 16, and there is no number of bits that would give 32,000.
Incorrectイ
32,768 is 2 to the power of 15, the number of combinations for 15 bits. Although 2 bytes = 16 bits, this value counts one bit too few, and it is exactly half of the correct 65,536.
Incorrectウ
64,000 is the value calculated as 64 × 1,000 by misunderstanding 64K as 1K = 1,000. In terms of amount of information, 1K = 1,024, so 64K = 64 × 1,024 = 65,536, and 64,000 is not even a power of 2.
- エ
正解 One byte is 8 bits, so 2 bytes are 8 × 2 = 16 bits. Each single bit takes one of 2 states, 0 or 1, so the total number of bit patterns that the 16 bits as a whole can represent is 2 to the power of 16 = 65,536. In a character code, one character is associated with one bit pattern, so the characters that can be represented by 2 bytes are at most 65,536 kinds. Therefore エ is the correct answer. Incidentally, you can do this in your head by decomposing it as 2 to the power of 10 = 1,024, and 2 to the power of 16 = 2 to the power of 10 × 2 to the power of 6 = 1,024 × 64 = 65,536.
- 1 byte = 8 bits. The number of kinds of states (characters) that can be represented by n bits is 2 to the power of n, so if 2 bytes = 16 bits, it is 2 to the power of 16 = 65,536 kinds.
- In the world of amount of information, 1K is not 1,000 but 2 to the power of 10 = 1,024. If you get this conversion wrong, you are led to wrong answers such as 32,000 or 64,000.