User Tools

Site Tools


tanszek:oktatas:techcomm:bcd_encoding

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
tanszek:oktatas:techcomm:bcd_encoding [2025/10/27 18:43] kneheztanszek:oktatas:techcomm:bcd_encoding [2025/10/27 18:53] (current) – [Applications of BCD] knehez
Line 31: Line 31:
   * **Digital clocks** (old ones): These devices often display numbers directly in decimal form, so BCD simplifies the process.   * **Digital clocks** (old ones): These devices often display numbers directly in decimal form, so BCD simplifies the process.
   * **Financial application**s: BCD can be used in systems requiring precise decimal representation, such as in currency and banking systems, to prevent rounding errors.   * **Financial application**s: BCD can be used in systems requiring precise decimal representation, such as in currency and banking systems, to prevent rounding errors.
 +
 +=== How much is the redundancy of this encoding? ===
 +
 +Equation of redundancy is as follows: \(  R = \frac{H_{\text{max}} - H}{H_{\text{max}}} \)
 +
 +where:
 +  * \(H_{\text{max}}\) is the maximum entropy,
 +  * \(H\) is the actual entropy.
 +
 +Each decimal digit (0–9) is represented by a 4-bit binary code. However, 4 bits can represent 16 possible combinations (0000–1111), of which only 10 are used.
 +
 +Maximum entropy:
 +
 +$$ H_{\text{max}} = \log_2(16) = 4\ \text{bits per symbol} $$
 +
 +Actual entropy:
 +
 +Since only 10 symbols are used and they are equally likely:
 +
 +$$ H = \log_2(10) \approx 3.3219\ \text{bits per symbol} $$
 +
 +Substitute these values into the equation of redundancy:
 +
 +$$ R = \frac{4 - 3.3219}{4} = 0.1695 $$
 +
 +Thus, the redundancy of the BCD code is approximately 16.95%.
 +
 +This means that about 17% of the information capacity of the 4-bit representation is not used effectively due to the limited number of valid BCD codes.
tanszek/oktatas/techcomm/bcd_encoding.txt · Last modified: 2025/10/27 18:53 by knehez