COMPUTER OPERATOR

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
data:packing [2026/04/28 21:00] – created skanderdata:packing [2026/05/03 14:25] (current) – [Minimum required bits] skander
Line 1: Line 1:
 ====== Packing ======  ====== Packing ====== 
  
-'Packing' refers to the act of using the minimum required bits to encode information.+'Packing' refers to the practice of representing information using only the minimum number of bits required, and arranging those bits contiguously in memory or in a data stream. In other words, it avoids wasting unused bits when encoding values.
  
 +In data representation and programming, packing is often used to combine multiple values into a compact layout. This may involve packing fields into tuples or aggregate types, especially when memory usage, cache efficiency, storage size, or binary serialisation performance matters.
 +
 +===== Minimum required bits =====
 +
 +Encoding information as binary digits, or bits, requires an encoding scheme that defines how values are mapped to bit patterns and how those bit patterns are decoded back into values.
 +
 +For a finite set of possible values, the minimum fixed-width binary representation requires enough bits to uniquely encode every value. This bit width is determined by the cardinality of the value set.
 +
 +<code>
 +ceil(log2(number of possible values))
 +</code>
data/packing.1777402842.txt.gz · Last modified: by skander