Download presentation
Presentation is loading. Please wait.
Published byPaulina Taylor Modified over 9 years ago
1
1 Chapter 4: Arithmetic for Computers (Part 2) CS 447 Jason Bakos
2
2 Logic/Arithmetic From the truth table for the mux, we can use sum-of-products to derive the logic equation –With sum-of-products, for each ‘1’ row for each output, we AND together all the inputs (inverting the input 0’s), then OR all the row products To make it simpler, let’s add “don’t cares” to the table…
3
3 Logic/Arithmetic This gives us the following equation –(A and (not D)) or (B and D) –We don’t need the inputs for the “don’t cares” in our partial products –This is one way to simplify our logic equation Other ways include propositional calculus, Karnaugh Maps, and the Quine-McCluskey algorithm ABDC (out) 0X00 (a) X010 (b) 1X01 (a) X111 (b)
4
4 Logic/Arithmetic Here is a (crude) digital logic design for the 2-to-1 mux Note that multiple muxes can be assembled in stages to implement multiple-input muxes
5
5 Logic/Arithmetic For the adder, let’s minimize the logic using a Karnaugh Map… For CarryOut, we need 2 3 entries… We can minimize this to –CarryOut=AB+CarryInB+CarryInC AB CarryIn00011110 01 1111
6
6 Logic/Arithmetic There’s no way to minimize this equation, so we need the full sum of products: –Sum=(not A)(not B)CarryIn + ABCarryIn + (not A)BCarryIn + A(not B)CarryIn AB CarryIn00011110 011 111
7
7 Logic/Arithmetic In order to implement subtraction, we can invert the B input to the adder and set CarryIn to be 1 –This can be implemented with a mux: select B or not B (call this input Binvert) Now we can build a 1-bit ALU using an AND, OR, addition, and subtraction operation –We can perform the AND, OR, and ADD in parallel and switch the results with a 4-input mux (Operation will be our D-input) –To make the adder a subtractor, we’ll need to have to set Binvert and CarryIn to 1
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.