Your SlideShare is downloading.
×

×
# Introducing the official SlideShare app

### Stunning, full-screen experience for iPhone and Android

#### Text the download link to your phone

Standard text messaging rates apply

Like this presentation? Why not share!

- IS 151 Lecture 11 by wajanga 362 views
- IS 151 Lecture 10 by wajanga 424 views
- IS 151 Lecture 8 by wajanga 391 views
- IS 151 Lecture 7 by wajanga 333 views
- IS 151 Lecture 6 by wajanga 98 views
- IS 151 lecture 4 by wajanga 447 views
- Flip flop, latch, difference betwee... by Akash Thahrani 3977 views
- Encoder and decoder by Then Murugeshwari 23646 views
- IS 151 lecture 2 by wajanga 395 views
- IS 151 Lecture 6 by wajanga 209 views
- B5e imtb (1) by Chafik Abdelghani... 3754 views
- Memory management by Satya Joshi 215 views

Like this? Share it with your network
Share

684

views

views

Published on

IS 151 Lecture 9 - UDSM 2013

IS 151 Lecture 9 - UDSM 2013

No Downloads

Total Views

684

On Slideshare

0

From Embeds

0

Number of Embeds

0

Shares

0

Downloads

53

Comments

0

Likes

2

No embeds

No notes for slide

- 1. Functions of Combinational Logic â€¢ Basic Adders â€“ Important in computers and many types of digital systems to process numerical data â€“ Basic adder operations are fundamental to the study of digital systems IS 151 Digital Circuitry 1
- 2. The Half Adder â€¢ Basic rules of binary addition â€“0+0=0 â€“0+1=1 â€“1+0=1 â€“ 1 + 1 = 10 â€¢ A half-adder accepts 2 binary digits on its inputs and produces two binary digits on its outputs â€“ a sum bit and a carry bit IS 151 Digital Circuitry 2
- 3. The Half Adder â€¢ Logic symbol for the half-adder â€¢ Truth table for the half adder A B Cout Sum 0 0 0 0 0 1 0 1 1 0 0 1 1 1 1 0 IS 151 Digital Circuitry 3
- 4. The Half Adder â€¢ Derive expressions for the Sum and Cout as functions of inputs A and B â€¢ From the truth table: â€“ Cout is a 1 only when both A and B are 1s: Cout = AB â€“ Sum is a 1 only if A and B are not equal: Sum = A B IS 151 Digital Circuitry 4
- 5. The Half Adder â€¢ Half-adder logic diagram IS 151 Digital Circuitry 5
- 6. The Full Adder â€¢ Accepts 3 inputs including an input carry and generates a sum output and an output carry â€¢ Difference between half and full-adder â€“ the full adder has three inputs (including an input carry) while a half adder has only two inputs (without the input carry) IS 151 Digital Circuitry 6
- 7. The Full Adder Logic symbol for a full adder IS 151 Digital Circuitry 7
- 8. The Full Adder â€¢ Full adder truth table A B Cin Cout Sum 0 0 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 1 0 1 0 0 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 1 1 IS 151 Digital Circuitry 8
- 9. The Full Adder â€¢ Derive expressions for the Sum and Cout as functions of inputs A, B and Cin from the truth table â€¢ Alternatively, using knowledge from the half adder: â€“ Sum = inputs exclusively-ORed â€¢ Sum = (A B) Cin â€“ Cout = inputs ANDed â€¢ AB + (A B)Cin IS 151 Digital Circuitry 9
- 10. The Full Adder â€¢ From the truth table: â€“ Sum = Aâ€™Bâ€™C + Aâ€™BCâ€™+ ABâ€™Câ€™ + ABC â€“ = Aâ€™Bâ€™C + ABC + Aâ€™BCâ€™ + ABâ€™Câ€™ â€“ = C(Aâ€™Bâ€™ + AB) + Câ€™(Aâ€™B + ABâ€™) â€“ = C(AexB)â€™ + Câ€™(AexB) â€“ = CexAexB â€“ = AexBexC IS 151 Digital Circuitry 10
- 11. The Full Adder â€¢ Also from the truth table: â€“ Carry out = Aâ€™BC + ABâ€™C ABCâ€™ + ABC â€“ = C(Aâ€™B + ABâ€™) + AB(Câ€™ + C) â€“ = C(AexB) + AB â€“ = AB + (AexB)C IS 151 Digital Circuitry 11
- 12. The Full Adder â€¢ Logic circuit for full-adder IS 151 Digital Circuitry 12
- 13. The Full Adder - Exercise â€¢ Determine an alternative method for implementing the full-adder â€“ Write SoP expressions from the truth table for Sum and Cout â€“ Map the expressions on K-maps and write simplified expressions if any â€“ Implement/draw the circuit diagram for the full-adder IS 151 Digital Circuitry 13
- 14. Parallel Binary Adders â€¢ A single full adder is capable of adding two 1- bit numbers and an input carry â€¢ To add binary numbers with more than one bit, additional full-adders must be used. â€¢ Example, for a 2-bit number, 2 full adders are used, 4-bit numbers, 4 full-adders are used, etc. â€¢ The carry output of each adder is connected to the carry input of the next higher-order adder IS 151 Digital Circuitry 14
- 15. Parallel Binary Adders â€¢ Block diagram of a basic 2-bit parallel adder General format, addition of two 2-bit numbers A2 B2 A1 B1 A B Cin A B Cin A2A1 + B2B1 Î£3Î£2Î£1 Cout (MSB) Î£3 Î£ Î£2 Cout Î£ Î£1 (LSB) IS 151 Digital Circuitry 15
- 16. Parallel Binary Adders â€¢ Block diagram of a basic 4-bit parallel adder A4 B4 A3 B3 A2 B2 A1 B1 A B Cin A B Cin A B Cin A B Cin (MSB) (LSB) Cout Î£ Cout Î£ Cout Î£ Cout Î£ C4 Î£4 Î£3 IS 151 Digital Circuitry Î£2 Î£1 16
- 17. Comparators â€¢ Basic function â€“ to compare the magnitudes of two binary quantities to determine the relationship of those quantities â€¢ Comparators determine whether two numbers are equal or not IS 151 Digital Circuitry 17
- 18. Comparators â€¢ Basic comparator operations The input bits are equal The input bits are not equal The input bits are equal IS 151 Digital Circuitry 18
- 19. Comparators â€¢ To compare binary numbers containing 2 bits each, an additional Ex-OR gate is required IS 151 Digital Circuitry 19
- 20. Comparators â€¢ The two LSBs of the two numbers are compared by gate G1, and the MSBs are compared by gate G2 â€“ Binary number A = A1A0 â€“ Binary number B = B1B0 â€¢ If the two numbers are equal, their corresponding bits are the same, and the output of each Ex-OR gate is a 0 â€¢ The 0s are inverted using the inverter, producing 1s â€¢ The 1s are ANDed, producing a 1, which indicates equality IS 151 Digital Circuitry 20
- 21. Comparators â€¢ If the corresponding sets of bits are not equal, i.e. A0â‰ B0, or A1â‰ B1, a 1 occurs on that Ex-OR gate output (G1 or G2) â€¢ In order to produce a single output indicating an equality or inequality of two numbers, two inverters and an AND gate are used â€¢ When the two inputs are not equal, a 1,0 or 0,1 appears on the inputs of the AND gate, producing a 0, indicating inequality IS 151 Digital Circuitry 21
- 22. Comparators - Examples â€¢ Determine whether A and B are equal (or not) by following the logic levels through the circuit â€“ a) A0 = 1, B0 = 0 and A1 = 1, B1 = 0 â€“ b) A0 = 1, B0 = 1 and A1 = 1, B1 = 0 IS 151 Digital Circuitry 22
- 23. 4-bit Comparators â€¢ To determine if two numbers are equal â€¢ If not, determine which one is greater or less than the other â€¢ Numbers â€“ A = A3A2A1A0 â€“ B = B3B2B1B0 IS 151 Digital Circuitry 23
- 24. 4-bit Comparators â€¢ Determine the inequality by examining highest-order bit in each other â€“ If A3 = 1 and B3 = 0; A > B â€“ If A3 = 0 and B3 = 1; A < B â€“ If A3 = B3, examine the next lower bit position for an inequality (i.e. A2 with B2) IS 151 Digital Circuitry 24
- 25. 4-bit Comparators â€¢ The three observations are valid for each bit position in the numbers â€¢ Check for an inequality in a bit position, starting with the highest order bits â€¢ When such an inequality is found, the relationship of the two numbers is established, and any other inequalities in lower-order bit positions are ignored IS 151 Digital Circuitry 25
- 26. Comparators - Example â€¢ Implement a circuit to compare the relationship between A and B A B A>B A=B A<B 0 0 0 1 0 0 1 0 0 1 1 0 1 0 0 1 1 0 1 For A > B (G): G = ABâ€™ For A = B (E): E = Aâ€™Bâ€™ + AB For A < B (L): L = Aâ€™B 0 IS 151 Digital Circuitry 26
- 27. Decoders â€¢ Function â€“ to detect the presence of a specified combination of bits (code) on inputs and to indicate the presence of that code by a specified output level â€¢ n-input lines (to handle n bits) â€¢ 1 to 2n output lines to indicate the presence of 1 or more n-bit combinations IS 151 Digital Circuitry 27
- 28. Decoders â€¢ Example: determine when a binary 1001 occurs on the inputs of a digital circuit â€¢ Use AND gate; make sure that all of the inputs to the AND gate are HIGH when the binary number 1001 occurs IS 151 Digital Circuitry 28
- 29. Decoders â€¢ Exercise: develop the logic required to detect the binary code 10010 and produce an active-LOW output (0) IS 151 Digital Circuitry 29
- 30. Decoders - Application â€¢ BCD-to-Decimal decoder â€“ Converts each BCD code into one of 10 possible decimal digits Decimal Digit BCD Code A3 A2 A1 A0 BCD Decoding Function 0 0 0 0 0 A3â€™ A2â€™ A1â€™ A0â€™ 1 0 0 0 1 2 0 0 1 0 3 0 0 1 1 4 0 1 0 0 5 0 1 0 1 6 0 1 1 0 7 0 1 1 1 8 1 0 0 0 9 1 0 0 1 IS 151 Digital Circuitry 30
- 31. Encoders â€¢ A combinational logic circuit that performs a reverse decoder function â€¢ Accepts an active level on one of its inputs (e.g. a decimal or octal digit) and converts it to a coded output, e.g. BCD or binary IS 151 Digital Circuitry 31
- 32. Encoders â€¢ The Decimal-to-BCD Encoder (10-line-to-4-line encoder) â€“ Ten inputs (one for each decimal digit) â€“ Four outputs corresponding to the BCD code â€¢ Logic symbol for a decimal-to-BCD encoder Decimal Input DEC/BCD 0 1 2 3 1 4 2 5 4 6 8 7 8 9 BCD Output IS 151 Digital Circuitry 32
- 33. Encoders â€¢ From the BCD/Decimal table, determine the relationship between each BCD bit and the decimal digits in order to analyse the logic. â€“ Example â€“ â€“ â€“ â€“ A3 = 8 + 9 A2 = 4 + 5 + 6 + 7 A1 = 2 + 3 + 6 + 7 A0 = 1 + 3 + 5 + 7 + 9 IS 151 Digital Circuitry 33
- 34. Encoders â€¢ Example: if input line 9 is HIGH (assume all others are LOW), it will produce a HIGH on A3 and A0, and a LOW on A1and A2 â€“ which is 1001, meaning decimal 9. IS 151 Digital Circuitry 34
- 35. Encoders - Exercise â€¢ Implement the logic circuit for the 10-line-to-4-line encoder using the logic expressions for the BCD codes A3 to A0 and inputs 0 to 9 IS 151 Digital Circuitry 35
- 36. Logic Functions Exercise (Lab 3) â€¢ Design and test a circuit to implement the function of the full adder (refer to lecture) IS 151 Digital Circuitry 36
- 37. â€¢ End of Lecture IS 151 Digital Circuitry 37

Be the first to comment