Data Representation
AdvancedComputers store all data in binary: a bit is 0 or 1, eight bits make a byte; numbers use binary and hexadecimal, text uses ASCII and Unicode. Mastering base conversion and encoding reveals how data really looks inside a computer.
- Computers represent all data in binary: a bit is 0 or 1, eight bits make a byte
- Storage units grow by 1024: byte, KB, MB, GB, TB
- Binary and hexadecimal convert in groups of four bits from the right; decimal conversion uses place values or repeated division
文體小知識:科技知識說明文——講解電腦如何以二進制表示數據,位元與位元組的關係,二進制、十進制與十六進制的互換,以及字符編碼的原理。
§Text Passage
1A computer is built from vast numbers of electronic switches, each with only two stable states — on and off, represented by 1 and 0 — so all data inside a computer is ultimately binary. One binary digit is a bit, the smallest unit of storage; eight bits form a byte, giving 256 different combinations, just enough to represent one basic character.
2Storage capacity builds up from the byte: 1024 bytes make a KB, 1024 KB make a MB, then come GB and TB. Integers are stored in binary — five bits, for example, represent 0 to 31. To write long binary numbers conveniently, engineers use hexadecimal with digits 0–9 and A–F, and each hexadecimal digit corresponds to exactly four bits.
3Text must also be represented numerically. ASCII assigns each character a numeric value: capital A is 65, lowercase a is 97, and the digit symbol 0 is 48; the standard 7-bit code covers 128 characters. Unicode gives every character in every language a unique number, covering Chinese characters, Japanese text and emoji, and has become the mainstream encoding of modern systems.
4Images are made of pixels, and each pixel's colour is stored as binary values — for example, three bytes recording the intensity of red, green and blue. Sound is digitised by sampling the wave amplitude at fixed intervals. The more bits used per pixel or per sample, the higher the quality and the larger the file — which is why HD videos run to GB, and why binary underpins all multimedia data.
1Summary 重點摘要
Computers store all data in binary: a bit is 0 or 1, eight bits make a byte; numbers use binary and hexadecimal, text uses ASCII and Unicode. Mastering base conversion and encoding reveals how data really looks inside a computer.
2Vocabulary cards Vocabulary
The smallest unit of data in a computer, holding either 0 or 1.
A group of 8 bits able to represent 256 different values; the basic unit of storage.
The base-2 number system using only 0 and 1, the form in which computers store all data.
The base-16 system using 0–9 and A–F; one hexadecimal digit stands for exactly four bits.
A storage unit equal to 1024 bytes.
The scheme that assigns a numeric value to each character so text can be stored digitally.
A 7-bit character code assigning values such as 65 for capital A, covering 128 characters.
An encoding giving every character in every language a unique number, including Chinese characters and emoji.
The smallest unit of a digital image, its colour stored as binary values.
Measuring a sound wave's amplitude at fixed intervals to turn sound into a sequence of numbers.
3Step by step Steps
- Step 1: Bits and bytesA computer's memory is built from hundreds of millions of electronic switches, each with two stable states — on (1) and off (0) — so all data ultimately becomes binary. A bit is the smallest unit; eight bits form a byte, giving 2 to the power of 8, i.e. 256 combinations. For example, one byte can represent exactly one ASCII character — the reason storage units are built on the byte.
- Step 2: Binary to decimalEach binary position has a place value — 1, 2, 4, 8, 16 and so on from right to left; add the place values of the 1 bits to get the decimal value. For example, 10110110 has place values 128, 64, 32, 16, 8, 4, 2, 1; the 1 bits contribute 128, 32, 16, 4 and 2, totalling 182, so 10110110₂ = 182₁₀. Write out the place values first and align each digit — mistakes then become rare.
- Step 3: Decimal to binaryUse repeated division by 2: keep dividing, record each remainder until the quotient is 0, then read the remainders bottom-up. For example, to convert 45: 45 ÷ 2 = 22 remainder 1, 22 ÷ 2 = 11 r 1, 11 ÷ 2 = 5 r 1, 5 ÷ 2 = 2 r 1, 2 ÷ 2 = 1 r 0, 1 ÷ 2 = 0 r 1; reading bottom-up gives 101101. Check: 32 + 8 + 4 + 1 = 45 — correct.
- Step 4: Binary and hexadecimal conversionHexadecimal uses 0–9 and A–F (A to F standing for 10 to 15), and each digit maps to exactly four bits, so convert by grouping four bits from the right. For example, split 10110110 into 1011 and 0110: 1011 is 11, written B, and 0110 is 6, giving B6. Conversely, 3D splits into 3 and D: 3 is 0011 and D (13) is 1101, joining to 00111101.
- Step 5: Storage unitsCapacity builds up from the byte: 1024 bytes make a KB, 1024 KB a MB, 1024 MB a GB, and 1024 GB a TB. For example, a photo is about three MB, a ten-minute HD video about five hundred MB, and a whole film runs to GB. Knowing the ladder lets you estimate how many files fit on a drive or in cloud storage — and in exercises remember the factor is 1024, not 1000.
- Step 6: ASCII character codingASCII uses seven bits to code 128 characters: digits 0 to 9 are 48 to 57, capitals A to Z are 65 to 90, lowercase a to z are 97 to 122. For example, A is 65, which in binary is 1000001, padded to eight bits as 01000001; because the codes run consecutively, knowing C is 67 gives F as 67 + 3 = 70. Ordering and case conversion both rely on these patterns.
- Step 7: Unicode and multimediaASCII covers only English characters and cannot hold the tens of thousands of Chinese characters; Unicode gives every character worldwide a unique number, including Chinese, Japanese and emoji, and is the standard in modern operating systems and web pages. For example, a Chinese-English document saved in Unicode shows no garbled text. For images, each pixel stores its colour in several bits — more bits mean richer colour and larger files.
5Worked example Example
A computing notebook has three conversion questions: convert binary 10110110 to decimal and to hexadecimal; convert hexadecimal 2C to decimal; and write down the ASCII code of the letter A together with its 8-bit binary form. Solve step by step.
- Binary to decimal: write the place values 128, 64, 32, 16, 8, 4, 2, 1; the 1 bits of 10110110 contribute 128, 32, 16, 4 and 2, giving 128+32+16+4+2 = 182.
- Binary to hexadecimal: group four bits from the right — 1011 and 0110; 1011 is 11, written B, and 0110 is 6, so 10110110₂ = B6₁₆.
- Hexadecimal to decimal: in 2C the digit 2 sits in the sixteens place and C (12) in the units place, so 2×16+12 = 44.
- Letter A: its ASCII value is 65; by place values 64+1 = 65, the binary form is 1000001, padded to eight bits as 01000001.
- Answer: 10110110₂ = 182₁₀ = B6₁₆; 2C₁₆ = 44₁₀; the letter A has ASCII value 65 and 8-bit binary form 01000001. Key techniques: group four bits from the right for binary-to-hexadecimal; expand hexadecimal by place values 16 and 1; for character codes remember capitals start at 65, convert by place values and pad to eight bits.
6Common mistakes Mistakes
7Quick check Quick check
Q1How many bits are in a byte, and how many combinations can it represent?
Q2Convert binary 110101 to decimal.
Q3Convert decimal 200 to hexadecimal.
Q4What is the ASCII value of capital E? (Hint: A is 65)
Q5Why do computers use binary rather than decimal?
8Recap Recap
- Computers represent all data in binary: a bit is 0 or 1, eight bits make a byte
- Storage units grow by 1024: byte, KB, MB, GB, TB
- Binary and hexadecimal convert in groups of four bits from the right; decimal conversion uses place values or repeated division
- ASCII codes English characters numerically (A is 65); Unicode covers all characters including Chinese
- Images are made of pixels, sound is digitised by sampling — all ultimately binary