Prof. Dr. Thorsten Jungmann (last updated 2026-11-02)
Relates to DET-05 Codes, code converters and standard components
Task
Each code of the lesson is made for its job and its medium. For each of the following jobs, name the code from the lesson that suits it, and give the reason in one sentence. Choose from the binary code, the binary-coded decimal (BCD) code, the excess-3 code, the Gray code, the American Standard Code for Information Interchange (ASCII), Code 39, the Hamming code, the one-hot code and the 7-segment code.
a) Jobs in everyday life:
- You type a letter on your smartphone, and the phone stores it as a code word.
- Your smartphone sends certain packets to wireless headphones, and they have to survive a flipped bit.
- A scanner in a pharmacy reads the pharmaceutical central number on the package of a medicine.
- A keypad with the digits 0 to 9 has one electric line per key.
- A clock shows each digit of the time with single light emitting diodes (LEDs), and you add their weights.
- A laboratory power supply shows the voltage that you set as digits, which you read at a glance.
b) Jobs at the heat pump and in industry:
- The controller of our heat pump transmits the electrical power as a whole number, with which other devices calculate.
- A controller reads the position at a joint of a robot arm.
- A cash register of the 1970s calculates with decimal digits in hardware and needs their nine’s complement.
c) The binary code can also describe positions. Why is it still unsuitable for a rotary encoder? Explain it with the change from sector 3 to sector 4 of a code disc with three tracks.
d) The controller of our heat pump records a message under the number 30 008, which fits into a word of 16 bits in the binary code. Write this number in the BCD code. What does the BCD code cost here, and what does it gain?
Solution
a) 1. ASCII, 2. Hamming code, 3. Code 39, 4. one-hot code, 5. BCD code, 6. 7-segment code
b) 1. binary code, 2. Gray code, 3. excess-3 code
c) From sector 3 to sector 4, all three bits change (011 to 100), and a reading in between can give any code word; in the Gray code, only one bit changes (010 to 110), so a misread is off by one sector at most
d) 0011 0000 0000 0000 1000; BCD costs 20 bits instead of the 16 of the binary word, and it gains the simple conversion, because each digit keeps its own four bits
