Electrical and Computer Engineering 2277A/B Lecture Notes - Lecture 4: Gray Code, Binary-Coded Decimal
Document Summary
Bcd and gray codes are two commonly used binary code formats. According to the huntington postulates and the corresponding theorems of boolean algebra, and, or, and not can be viewed as the fundamental operations of digital logic. Used to directly represent decimal positive integers as a 4-bit binary code. Even though bcd has the same encoding as the corresponding hex digits, the encoding scheme is not identical. This step generates the necessary carry digit in the corresponding decimal sum. Convert both decimal digits to binary and perform binary addition. If sum > (undefined in bcd), add to sum to obtain valid bcd-result. Bcd-result = correct when interpreted as bcd. Binary code for counting, where only one bit changes with each counting increment or decrement. Used for applications such as angular position encoders where count wraps around many times and transient position encoding errors must be prevented. A 1-bit gray code has the trivial sequence {0, 1}