Lecture 1 Number - System
Lecture 1 Number - System
Daniyal Adeeb
About instructor
Daniyal Adeeb
BSc Electrical Engineering GCU, Lhr Gold Medalist
4+ experience as a Machine
Learning/AI engineer
Office Hours
2×1+4×1+2×0+1×1=7
This code allows more flexibility as it uses both positive and negative
weights for the bits, which can be useful in some applications where
negative values need to be represented. It is often used in specific
situations that require precise control over binary representations.
The 8-4-2-1 code is a weighted code, and its main feature is that it
assigns both positive and negative weights to each bit position,
making it unique compared to other codes like BCD.
Gray Code
Gray code is a binary numeral system where each successive number
differs from the previous one by only a single bit. This is particularly
useful in applications that involve continuous or analog data, as it
prevents errors during the transition from one value to the next.
In Gray code, the first bit of the binary number remains the same, and
each subsequent bit is determined by performing an exclusive OR
(XOR) operation between the corresponding binary bit and the
previous binary bit. The primary advantage of Gray code is that it
reduces errors in systems where multiple bits change simultaneously,
which can lead to invalid readings.
For example: