Courses / Computer Science I
Introduction to Computers

Information Encoding and Binary Representation

Computer Science I 327 words Free to read

Everything Is Bits

A computer stores and processes information using just two states — on and off, high and low voltage — represented by the digits 0 and 1. A single such digit is a bit (binary digit); eight bits make a byte. Everything a computer holds — numbers, text, images, sound, instructions — is ultimately a pattern of bits. What a pattern means depends entirely on how it is interpreted.

Numbers are stored in binary (base 2), where each position is a power of 2 rather than a power of 10. Reading right to left, the positions are worth 1,2,4,8,16,1, 2, 4, 8, 16, \dots. The binary number 10111011 therefore equals 8+0+2+1=118 + 0 + 2 + 1 = 11 in decimal.

BinaryPowersDecimal
101110118+2+18+2+11111
100001000016161616
1111111111111111128+64++1128+64+\dots+1255255

An 8-bit byte can represent 28=2562^8 = 256 distinct values, from 00 to 255255. In general, nn bits give 2n2^n combinations. Because long binary strings are hard to read, programmers use hexadecimal (base 16, digits 0099 then AAFF), where each hex digit packs exactly 4 bits — so one byte is exactly two hex digits.

Text is encoded by mapping characters to numbers: ASCII uses 7 bits per character (128 symbols), while Unicode extends this to cover every writing system.

Common pitfall: thinking a bit pattern has an inherent meaning. The same byte 0100000101000001 is the number 6565, the letter AA in ASCII, or part of a color — the interpretation, not the bits, decides. Always ask how a pattern is being read before deciding what it represents.

An 8-cell binary ruler: each cell labelled with its power of 2 (128 down to 1). A sample byte lights its set bits in accent, and the lit place values drop one by one into a running sum beneath.

d=i=0n1bi2id = \sum_{i=0}^{n-1} b_i \cdot 2^i

Information Encoding and Binary Representation

Practise this lesson

The explanation above is free to read. The graded practice for this lesson lives in the Tryals app.

11practice questions
2interactive scenes
Start Computer Science I free

Introduction to Computers