Software Portability and Optimization

Week 2 - Class 1

ยท

2 min read

Binary Representation of Data

Welcome back to another exciting week of learning in our journey through the world of data! In this class, we'll dive deep into the binary representation of data, exploring its various applications and techniques. Let's get started!

Binary

  • Binary uses 0s and 1s to represent values.

  • It's electrically represented as off/on or low/high voltage.

  • Binary is error-resistant compared to analog voltages.

  • Unlike analog signals which represent the number 0-10 as an analog electrical value, binary remains reliable even with signal degradation (like voltage can drop in a long wire) or interference (like electromagnetic waves).

Integers

Integers are the building blocks of binary numbering systems.

  • Unsigned integers use binary bits for values.

  • An 8-bit unsigned integer ranges from 0 to 255.

  • Signed integers use two's complement with a sign bit for negative values.

Fixed-Point

  • Like integers but with fractional bits.

  • They are typically used in scenarios where you need to represent decimal values precisely.

  • For example, 000001.11 in binary is 1.75 in decimal.

Floating-Point

  • Follows IEEE 754 standard.

  • Consist of sign, mantissa, and exponent.

  • They are typically used in scenarios where you need to represent decimal values precisely

  • New formats like Brain Float are emerging 16, less accuracy, for machine learning.

Characters

  • Encoded as integers corresponding to code points.

  • ASCII, EBCDIC, and Unicode standards.

  • Unicode, with its various formats like UTF-8 and UTF-16, aims to provide a comprehensive character set for human writing.

Sound

  • Represented as Pulse Coded Modulation (PCM), series of time-based air pressure measurements.

  • PCM can be quite storage-intensive, leading to compression techniques, both lossless and lossy, to reduce file sizes.

  • Psychoacoustic compression removes imperceptible sound variations.

Graphics

  • RGB for digital displays (additive color).

  • CYMK for printing (subtractive color).

  • Images are divided into pixels, with each pixel represented by values for RGB or CYMK channels.

  • Lossy and lossless compression, e.g., JPEG.

  • Video and animations are stored as sequences of images, with motion compensation techniques to reduce data redundancy.

Compression Techniques

  • Huffman and adaptive arithmetic encoding for uneven data distribution.

  • Run length encoding for repetitive sequences.

  • Text data compression using dictionaries.

  • Decomposition for audio waveforms.

  • Palletization for reducing image storage.

  • Psychoacoustic and psychovisual compression removes imperceptible data.

Conclusion

In closing, understanding binary representation and data compression techniques is essential in the modern world of data handling and processing. Stay tuned for more exciting lessons as we continue our exploration into the fascinating realm of data!

ย