You are on page 1of 43

Combinational Logic

By : Ali Mustafa
Contents
• Adder
• Subtractor
• Multiplier
• Comparator
• Decoder
• Encoder
• Multiplexer
How to Analyze any combinational
circuit like this?
Analysis Procedure
• To obtain the output Boolean functions from a
logic diagram:
1.Label all gate outputs that are a function of input
variables.

2.Label the gates that are a function of input


variables and previous labeled gates with different
arbitrary symbols.

3.Repeat step 2 until the outputs of the circuit are


obtained in terms of the input variables.
Analysis Procedure
Analysis Procedure
Analysis Procedure
Analysis Procedure
• Derivation of Truth Table
Analysis Procedure
Analysis Procedure
Summary :
How to design a combinational circuit?

1. Determine the required number of


inputs and outputs.
2.Derive the Truth Table.
3.Obtain the simplified Boolean functions.
4.Draw the logic diagram.
Example

• Design a combinational circuit with three


inputs and one output.
• The output must equal “1” when the inputs
are less than three and “0” otherwise. [use
only NAND gates]
Example (cont.)
1-The system have three inputs and one output
Example (cont.)
2- Derive the truth table
Example (cont.)
Circuits to be Implemented

• Arithmetic circuits
–Half Adder
–Full Adder
–Binary Adder/Subtractor
–Binary Multiplier
• Magnitude Comparator
What's the example of Arithmetic
Circuit?

One of the famous Digital Logic Circuits is


the calculator.
Arithmetic circuits
• An arithmetic circuit is a combinational circuit that
performs arithmetic operations such as addition,
subtraction, multiplication and division with binary
numbers or with decimal numbers in a binary code.
• A combinational circuit that performs the addition of
two bits is called a “Half Adder”.
Half adder
• It is required to design a combinational circuit
that adds two binary numbers and produce
the output in the form of two bits sum and
carry
Solution
1- We need to determine the inputs and output of
the system and give letters for all of them our system
has two inputs (X, Y) and two outputs (S, C)
Half adder
2-Derive the truth table according to the given
relation between outputs and inputs
– In the half adder block the output equals the sum
of two binary inputs
Half adder (cont.)
3- Obtain the simplified Boolean functions for
each output as a function of the input variables
using K-map

4- Draw the logic diagram


Full Adder
• It is required to add three binary numbers
Solution

1. From the specifications of the circuit, determine


the required number of inputs and outputs and
assign a letter (symbol) to each.
Full Adder (cont.)
2. Derive the truth table according to the given
relation between outputs and inputs
Full Adder (cont.)
3- Obtain the simplified Boolean functions for
each output as a function of the input
variables using K-map
Full Adder (cont.)
4- Draw the logic diagram
4-Bit Binary Adder (Ripple Carry Adder)
Ripple Carry Adder
Binary Subtractor
• The subtraction of binary number can be done
most conveniently by means of complements
• The subtraction “ A-B “ is done by taking the
2’s complement of “ B “ and adding it to “ A “.
– The 2’s complement can be obtained by taking the
1’s complement and adding “1” to the least
significant bit.
– The 1’s complement can be implemented easily
with inverter circuit and we can add “1” to the
sum by making the initial input carry of the
parallel adder equal to “1”.
Adder/Subtractor
Subtractor
A B D B A B C D B

0 0 0 0 0
0 0 0 0 0 0 1 1 1

0 1 0 1 1
0 1 1 1
0 1 1 0 1

1 0 0 1 0
1 0 1 0
1 0 1 0 0

1 1 0 0 1 1 0 0 0

1 1 1 1 1

HALF SUBTRACTOR FULL SUBTRACTOR


Subtractor
• HALF SUBTRACTOR
• D = A’B + AB’
• B = A’B

• FULL SUBTRACTOR
• D = A’B’C + A’BC’ + AB’C’ + ABC
• B = A’C + A’B + BC
4- Bit Subtractor
Assignment # 3

• Design 4-Bit Adder - Subtractor


4-Bit Adder - Subtractor
Binary multiplier
Self Study

• 3 x 4 Bit Multiplier
Magnitude Comparator

• It is required to design a circuit to compare


between two inputs A={A1,A0} and B={B1,B0}
both inputs consists of two binary bits the
circuit has three outputs Greater, Less, Equal
Magnitude Comparator (cont.)

1. Determine the required number of inputs and


output.
Magnitude Comparator (cont.)

2. Derive the Truth


Table that defines the
required relationship
between inputs and
outputs.
Magnitude Comparator (cont.)
3- Get the simplified logic function of the
outputs using k-map
Magnitude Comparator (cont.)
4- Draw the circuit
4 – Bit Comparator
4 – Bit Comparator

You might also like