1 / 27

Lecture 15: Combinational Circuits

Lecture 15: Combinational Circuits. Complete logic functions Some combinational logic functions Half adders Adders Multiplexers Decoders Parity generators Signal propagation in combinational logic ALUs. Announcement. ACM Movie Night 2:00 pm Saturday, Nov 12 Just show up – it’s free!

binta
Télécharger la présentation

Lecture 15: Combinational Circuits

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 15: Combinational Circuits • Complete logic functions • Some combinational logic functions • Half adders • Adders • Multiplexers • Decoders • Parity generators • Signal propagation in combinational logic • ALUs L15: Combinational Circuits

  2. Announcement • ACM Movie Night • 2:00 pm • Saturday, Nov 12 • Just show up – it’s free! • Free Food if you RSVP! • Send rsvp to "acm-exec@cs.uoregon.edu" • ACM events are open to all cis and pre-cis students L15: Combinational Circuits

  3. Complete Logic Functions • A logic gate is considered to be a complete logic function if we can use just that one type of gate to implement any logic function (i.e., NOT, AND, OR, NAND, and NOR) • NAND and NOR functions (each by themselves) are complete logic functions • Why would you be interested in complete logic functions or using just one type of logic gate in your design? L15: Combinational Circuits

  4. NAND Represents a Complete Logic Function A NOT AND NAND A B A B L15: Combinational Circuits

  5. NAND Represents a Complete Logic Function (cont.) OR A B NOR A B L15: Combinational Circuits

  6. Example • A’ + B’ + C • Circuit design using NOTs and ORs • “Brute force” substitution of NAND gates • We can make it a little simpler - how about applying DeMorgan’s Law first? A’ + B’ = (AB)’ L15: Combinational Circuits

  7. Another Example • AB + B’C A B C L15: Combinational Circuits

  8. Combinational Logic and Digital Devices • Now that we’ve learned how to implement a logic expression in a logic-gate-level design, we can start putting those functions together to form more complex (and useful!) functions • Digital logic that is designed so that the outputs are dependent only upon the current set of inputs is called COMBINATIONAL LOGIC L15: Combinational Circuits

  9. Examples of Combinational Digital Logic Functions • Multiplexers • Decoders • Parity Generators • Adders • Half adders • Full adders • 32-bit adders • Shifters • Comparators • Arithmetic Logic Units L15: Combinational Circuits

  10. Half Adder • Consists of: • 2 inputs • 2outputs • Sum • Carry • Used for basic integer addition ( 1 bit) Input A Input B Sum Carry 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 L15: Combinational Circuits

  11. Half Adder Logic Design A Sum B Carry L15: Combinational Circuits

  12. Full Adder Input A Carry In Input B Carry Out Sum • Consists of: • 3 inputs • A • B • Carry in • 2outputs • Sum • Carry out • Typical application: link together multiple full adders to add integers containing more than one bit 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 L15: Combinational Circuits

  13. Full Adder Logic Design Carry In A Sum B Carry Out L15: Combinational Circuits

  14. Integer Addition Using Full Adder Circuits A1 A0 B1 B0 Full Adder Full Adder Carry Out Carry In Carry Out Carry In “0” Sum1 Sum0 Adding two binary numbers, each containing two bits C1 C0 A (A1,A0) + B (B1,B0) ____ _________ Sum (C1,S1,S0) L15: Combinational Circuits

  15. Longer Chains of Adders Add Longer Integers A2 B2 A3 A0 B3 B0 A1 B1 Full Adder Full Adder Full Adder Full Adder Carry Carry Carry Carry Carry “0” Sum2 Sum3 Sum0 Sum1 L15: Combinational Circuits

  16. Multiplexers 4 input multiplexer D0 • Consist of: • 2n data inputs • One output • n control inputs • Used to control the selection of a single output from n different inputs • Typical application: parallel to serial converter D1 Out D2 D3 A B L15: Combinational Circuits

  17. Decoders 2 to 4 decoder D0 A • Consist of: • n inputs • 2n outputs • Used to select a single (one) output line • Typical application: selecting a memory chip D1 B D2 D3 L15: Combinational Circuits

  18. Parity Generator Even parity for 4 inputs • Consist of: • n inputs • 1output • Used to create a parity bit for a given set of inputs A B Output C D L15: Combinational Circuits

  19. Arithmetic Logic Units (ALUs) • The ALU is the math engine for modern digital computers L15: Combinational Circuits

  20. A Very Simple ALU • Performs four functions: A .AND. B (A & B) //bitwise AND A .OR. B (A | B) //bitwise OR NOT.B (~ B) //bitwise NOT A + B (A + B) //addition operator • Operates on single bits “A” and “B” L15: Combinational Circuits

  21. Block Diagram for a Very Simple, 1-Bit ALU Carry In Inv A A Logic Unit (AND, OR, NOT) Output A Enable A B B Enable B Sum A Full Adder B En OR 2 to 4 Decoder F1 En AND En NOT F0 En ADD L15: Combinational Circuits Carry Out

  22. 1-Bit Slice ALU Example • Four Functions (AND, OR, NOT B, ADDITION) for single bits Ai and Bi • Inputs • INV A Inverse of Ai • A The single bit Ai • ENA Enable the A input • B The single bit Bi • ENB Enable the B input • FO Control signal 0 • F1 Control signal 1 • Carry In Carry-in signal (usually the carry out signal from the previous state) • Outputs • Output Result of ALU computation • Carry Out Carry out signal from full adder circuit L15: Combinational Circuits

  23. Control Signals F0 and F1 • What do the control signals F0 and F1 do? • Both signals go into the 2 to 4 decoder • Between the two signals, one of the four ALU functions is selected to be the ALU’s output Output Function F0 F1 A AND B 0 0 0 1 A OR B 1 0 NOT B 1 1 A + B L15: Combinational Circuits

  24. Putting together digital logic functionsConnect “n” 1-bit ALUs to create 1 n-bit ALU An-1 A0 Bn-1 B0 A1 B1 An-2 Bn-2 1-bit ALU slice 1-bit ALU slice 1-bit ALU slice 1-bit ALU slice Outputn-1 Output0 Output1 Outputn-2 Carry outn-2 L15: Combinational Circuits

  25. More Complex ALUs • ALUs in modern CPUs can include more functions than the four we just put together • For example, other functions that might be useful: • multiply • shift • compare L15: Combinational Circuits

  26. How would you get the ALU to subtract two integers? • A – B • Think about the two’s complement procedure • NOT B (take the complement of B) • NOTB + 1 (add one to the result of step 1) • (NOTB + 1) + A (add A to the result of step 2) • Ignore any carry out signals L15: Combinational Circuits

  27. What additional function would we need to be able to multiply and divide integers? • Shifters (left shift and right shift) • Multiplication and division can be thought of as “shift and add” or “shift and subtract” procedures We don’t have time to build a multiplier, but this should give you the intuition for how it could be done. L15: Combinational Circuits

More Related