Courses / Computer Science I
Introduction to Computers

Information Encoding and Binary Representation

Computer Science I 259 words Free to read

Everything Is Bits

A computer stores all information using just two states: on and off, represented as 0 and 1. A single digit is a bit, and eight bits make a byte.

What a bit pattern means depends entirely on its interpretation. The exact same byte 0100000101000001 can be the decimal number 6565, the letter AA in ASCII, or part of an image.

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

Binary is base-2, where positions are powers of 22. An nn-bit value gives 2n2^n combinations; an 8-bit byte holds 28=2562^8 = 256 values (00 to 255255).

Common pitfall: Assuming a bit pattern has an inherent meaning. Always check how data is interpreted.

Hex, Text, and Formulas

Because long binary strings are clumsy, programmers use hexadecimal (base 16, digits 0099 and AAFF). Each hex digit packs 4 bits, so one byte equals two hex digits.

Text uses numeric mapping: ASCII uses 7 bits for 128 English characters, while Unicode extends this globally to cover every writing system.

The decimal value dd of any binary sequence is calculated by summing each bit bib_i multiplied by its position's power of 2:

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

Symbol Guide:

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

Introduction to Computers