CIS-77 Home http://www.c-jump.com/CIS77/CIS77syllabus.htm

Arithmetic Operations and Logical Functions


  1. Arithmetic Based on Logical Functions
  2. Adding Binary Numbers
  3. Half Adder Discussion
  4. The Full Adder
  5. One-bit Full Adder Example
  6. One-bit Full Adder
  7. Multibit Addition
  8. Programmable Logic Array
  9. Programmable Logic Array, Cont.
  10. Logical completeness

1. Arithmetic Based on Logical Functions


2. Adding Binary Numbers


  • How, then, could we add two binary numbers?

  • For two input bits there are four possible combinations of inputs.

  • These four possibilities, and the resulting sums, are:

         0 + 0 =  0
         0 + 1 =  1
         1 + 0 =  1
         1 + 1 = 10
    
  • The last line indicates that we have a carry output.

  •  

    INPUTS OUTPUTS
    A B CARRY SUM
    0 0 0 0
    0 1 0 1
    1 0 0 1
    1 1 1 0

  • Therefore, we can transform our results into a truth table, shown on the right.

  • Suddenly, this looks familiar:

    • The carry output is a simple AND function.

    • The sum is an XOR.

  •   half adder circuit

3. Half Adder Discussion


4. The Full Adder


  • To construct a full binary adder circuit, we need three inputs and two outputs, as specified by the following truth table:

     

    INPUTS OUTPUTS
    A B CARRY IN CARRY OUT 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

     

  •  

     

  • The truth table includes five columns as follows:

    1. input A

    2. input B

    3. carry IN for the current column

    4. resulting carry OUT (carry-over), generated for the next column

    5. the resulting SUM.

5. One-bit Full Adder Example


6. One-bit Full Adder


  • The new circuit combines three inputs: two input bits and a carry.

  • The gate-level description of a full adder follows:

  • Combination of AND-gates is a decoder circuit for each possible combination of inputs.

  • Decoder produces output of a single 1 (with the rest of 0s) for each unique combinaton of input signals.

  • The OR gates re-combine unique output 1 into desired combination of carry and sum outputs.

  • Note that AND-gate on top of the circuit is not connected to either of the OR-gates, because it should never produce any 1s in either output.

  •   full adder

7. Multibit Addition


  • A circuit for adding two 4-bit binary numbers: 4-bit full adder

    So far we explored a one-bit full adder.

  • To add multiple binary bits together, we must include a possible carry over from the lower order of magnitude, and send it as an input carry to the next higher order of magnitude bit.

  • Multibit addition requires full adders with carry lines to be cascaded (chained together.)

  • See also: binary subtraction article.

  •   4-bit full adder

8. Programmable Logic Array


  • One-bit full adder logic demonstrates a programmable logic array, or PLA, which is a collection of logic functions between:

    • unique input pattern, presorted by AND-gate array (decoder) on the left side, and

    • OR-gate array one the right side.

  • AND array corresponds to the number of rows in the truth table.

  •   programmable logic array

9. Programmable Logic Array, Cont.


  • The number of OR-gates corresponds to the number of output columns in the truth table.

  • PLA implementation is very simple: connect AND-gate output to the input of OR-gate as follows:

    • If row of the corresponding AND-gate requires output 1, make a connection.

    • If the truth table raw requires output 0, do not make a connection.

  •   programmable logic array

10. Logical completeness