Professional Documents
Culture Documents
DLD Week#1
DLD Week#1
DLD Week#1
Design
Jawaid Shabir
jshabir@ssuet.edu.pk
• It’s just the inversion of all the bits of the original number at their respective
positions.
2’s Compliment
• Just add binary ‘1’ to the 1’s compliment of a number to get its 2’s
compliment!
Another Method for finding the 2’s Compliment
Do it yourself….
The Sign Bit
• Left most bit in a binary number represents the sign of that binary
number.
• A ‘1’ shall indicate a negative number and a ‘0’ would indicate a
positive binary number.
1’s Compliment Form
• The 8421 Code is an example of the BCD code format where each digit is
expressed as a four-bit binary number.
• There are 16 symbols in all for such coding as with four bits you could only
access up to 16 symbols.
• Decimal to BCD conversion
Decimal to BCD Conversion &
BCD to Decimal Conversion
BCD Addition
• Add the four bits independently as per the rules of binary addition.
• If a result is equal to or greater than 9, its an invalid BCD number.
• Add 6 (0110) to the number and it is thus converted into a valid BCD number.
BCD Addition
BCD Addition
Do it yourself
The Gray Code
• A code that exhibits a single bit change from one code to the another in a
sequence.