Binary: a short note

Machine understand binary language, we all know this thing. Today, we’ll know how machine knows what we don’t. Yeah, exactly.

Binary is the backbone of machine to understand: 0 and 1. We can represent everything in 0 and 1. It’s really good way as we can think whether it’s working (1) or not (0). We can represent it other than binary but we didn’t choose to as it can be really complicated because of things like voltage fluctuations, interference. So for the simplicity, we needed something which is robust against noise.

One important thing to know about Binary is it uses base-2 system, meaning each digit (bit) represents a power of 2. But why is this important? It’s just simple and more resilient against electrical noise. Unlike the decimal system, which requires ten different symbols to represent.

Consider the example: 00100110

Binary00100110
Power2⁷2⁶2⁵2⁴2⁰
Value1286432168421

0×128+0×64+1×32+0×16+0×8+1×4+1×2+0×1=38 

Each digit in a binary number represents an on (1) or off (0) state of a power of 2. When you sum up the "on" values, you get the decimal equivalent.


Real-world data (measurements, physics, finance) often require decimal precision that integers cannot provide, floating-point can. But, it is also an approximation, leading to precision errors in computation.


Structure:

  • 1-bit sign (0 = positive, 1 = negative) 0 (positive)

  • 8-bit exponent (determines scale) 129 (2⁺²)

  • 23-bit mantissa (stores precision) 1.25

Value: 1.25 × 2² = 5.0


Sound Representation in Binary: Understanding Digital Audio

Sound is a continuous wave in the analog world. However, computers cannot directly process analog signals, so they convert sound into digital data using a process called sampling.

How Sound is Converted to Binary

  • Sampling: The sound wave is measured at regular intervals. The more samples taken per second, the more accurate the digital representation (e.g., 44.1 kHz sampling rate → 44,100 samples per second)

  • Quantization: Each sample is assigned a binary value, depending on the bit depth (e.g., 16-bit means 65,536 possible values per sample)

  • Encoding: The sampled data is stored in binary format.


Image and Video Representation: Pixels and Compression

Unlike sound, which is a wave, images are made of pixels (small squares of color). A computer stores images as a grid of pixels, each represented in binary numbers.

How Images Are Stored in Binary

  • RGB Model: Each pixel has three color values – Red, Green, and Blue.

  • Bit Depth: The number of bits used per color channel determines how many colors can be represented.

    • 8-bit per channel → 16.7 million colors

    • 16-bit per channel → Over a trillion colors

Example: A 5-megapixel image has 5 million pixels, with 3 bytes per pixel (one for Red, Green, and Blue), leading to a 15MB uncompressed size.


Video

Videos are a series of images (frames) shown in sequence. A single 1080p (Full HD) video at 30 frames per second without compression would be enormous. So, it needs compression.

  • Uncompressed 1080p video → 177 MB/sec

  • Compressed (H.264, AV1) → Uses motion prediction to reduce redundancy.


Conclusion:

Everything in a computer—numbers, text, sound, images—is binary.

If computers moved beyond binary to quantum computing, how would accuracy, speed, and storage change? Would it eliminate these trade-offs or introduce new ones?