Digital Logic Design By Ahmad Bilal ZAROORI AILAN
Digital Logic & Design By Ahmad Bilal
ZAROORI AILAN • QUIZ will be held in next class – Topic includes • • Numbering Systems Logic gates Truth Tables MCQs of General discussion in class
Guys have you ever seen this ? How do they actually work
BCD CODE
BCD (Binary Coded Decimal) Code • Binary Code to represent decimal digits 0 -9 • Used by Decimal Number Displays • How many binary bits are required to represent 10 unique codes
BCD (Binary Coded Decimal) Code Decimal 0 1 2 3 4 BCD 0000 0001 0010 0011 0100 Decimal 5 6 7 8 9 BCD 0101 0110 0111 1000 1001
BCD Addition 23 45 68 0010 0011 0100 0101 0110 1000 23 0010 0011 49 0100 1001 72 0110 1100 • 1100 is illegal BCD number
BCD Addition • Add a 0110 (6) to an invalid BCD number • Carry added to the most significant BCD digit 23 49 72 0010 0011 0100 1001 0110 1100 0111 0010
What about Subtraction
BCD Subtraction • Carried out by two Methods • 9’s Compliment • 10’s Compliment
9’s Compliment • For binary Subtraction , we need to learn how to find 9’s Compliment • 9’s Compliment is easy • 9, s compliment of 5= 9 -5 which is equal to 4 • What will be the 9’s Compliment if 19 • What is the 9, s compliment of 158
10, Compliment • Well its easy. Just take 9’s compliment. And Add I to the answer • Find 10’s Compliment of 5 • =9 -5=4…………………. . 9’s Compliment • 4+1=5…………. 10’s Compliment
Subtraction • Subtract 8 -2 • Find 9’s Compliment of 2 (as it is to be subtracted) • So 9 -2=7 • Now add the answer = 8+7
• Now 8= 1 0 0 0 7=0111 15=1 1 Now 15 is invalid Code. So Add the both digits together = 1+5. Hence the Answer Only Do this When we have Carry
• • • 18 -24 Step 1 Step 2 Step 3 Step 4 Step 5 : 24 9, s Compliment =75 : 18+75=93 : The answer is Valid Binary Code : There is no Carry it means answer is : When ever there is no carry , subtract your answer every digit from 9 • Step 6 : 93 99 - 6
- Slides: 17