This is an old revision of the document!
Table of Contents
Encoding Techniques
Encoding techniques are methods used to convert data into a specific format for efficient storage, transmission, or processing. These techniques are widely applied in fields such as telecommunications, data storage, and information security to optimize performance and ensure data integrity.
BCD
BCD (Binary-Coded Decimal) is a method of encoding decimal numbers where each digit is represented by its own binary sequence, typically using 4 bits. This coding simplifies the conversion between binary and decimal systems, making it useful in applications like digital clocks, calculators, and financial systems, where precise decimal representation is important. BCD is particularly favored in hardware-level computations for improved accuracy in handling decimal data.
Lecture Notes
Exercises
In a communication system, we want to transmit numbers from 40 to 119 using a fixed-length BCD code with parity checking (even parity).
a) What will be the length of the encoded messages if each decimal digit is encoded with 4 bits in BCD encoding?
b) Create a possible structure of the code table that assigns the binary representation of digits to the numbers. What will be the code for the numbers 42, 87, 100, and 111 in the system?
c) What will be the entropy and redundancy of this code if the occurrence of numbers in the range 40 $\leq$ n $\leq$ 69 is four times more frequent than the occurrence of numbers in the range 70 $\leq$ n $\leq$ 119?
d) How many bits would the messages be if we used pure binary coding with parity checking?
Huffman
Huffman coding is a lossless data compression algorithm that assigns variable-length codes to input characters based on their frequencies: more frequent characters receiving more shorter codes. This technique efficiently reduces the size of data for storage or transmission. It is widely used in applications such as file compression (e.g., ZIP), multimedia encoding (e.g., JPEG and MP3), and in communication systems where optimizing bandwidth is crucial.
Lecture Notes
Exercises
a) Explain Huffman encoding by encoding the message COMPRESSION_IS_COOL!
b) Explain Huffman encoding by encoding the message HELLO_WORLD_HELLO_EVERYONE!
LZW
LZW (Lempel-Ziv-Welch) coding is a lossless data compression algorithm that replaces repeated sequences of data with shorter codes, thus reducing file size without losing information. It is widely used in applications such as image compression (e.g., GIF), PDF files, and in systems that require efficient storage and transmission, like data archives and network protocols.
Lecture Notes and Videos
Exercises
a) Explain LZW encoding by encoding the message ABABABAB!
b) Decode the received message using only the initial dictionary!
c) Encode the message ABRACADABRAABRACADABRA with LZW coding!
d) Decode the received message using only the initial dictionary!
