Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine...

43
Combinational Logic By : Ali Mustafa

Transcript of Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine...

Page 1: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

Combinational Logic

By : Ali Mustafa

Page 2: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

Contents

• Adder

• Subtractor

• Multiplier

• Comparator

• Decoder

• Encoder

• Multiplexer

Page 3: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

How to Analyze any combinational circuit like this?

Page 4: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

Analysis Procedure

3.Repeat step 2 until the outputs of the circuit are obtained in terms of the input variables.

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.

• To obtain the output Boolean functions from a logic diagram:

Page 5: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

Analysis Procedure

Page 6: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

Analysis Procedure

Page 7: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

Analysis Procedure

Page 8: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

Analysis Procedure• Derivation of Truth Table

Page 9: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

Analysis Procedure

Page 10: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

Analysis Procedure

Page 11: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

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.

Page 12: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

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]

Page 13: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

Example (cont.)

1-The system have three inputs and one output

Page 14: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

Example (cont.)

2- Derive the truth table

Page 15: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

Example (cont.)

Page 16: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

Circuits to be Implemented

• Arithmetic circuits

–Half Adder

–Full Adder

–Binary Adder/Subtractor

–Binary Multiplier

• Magnitude Comparator

Page 17: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

What's the example of Arithmetic Circuit?

One of the famous Digital Logic Circuits is the calculator.

Page 18: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

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”.

Page 19: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

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

Solution1- 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)

Page 20: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

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

Page 21: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

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

Page 22: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

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.

Page 23: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

Full Adder (cont.)2. Derive the truth table according to the given

relation between outputs and inputs

Page 24: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

Full Adder (cont.) 3- Obtain the simplified Boolean functions for

each output as a function of the input variables using K-map

Page 25: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

Full Adder (cont.)

4- Draw the logic diagram

Page 26: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

4-Bit Binary Adder (Ripple Carry Adder)

Page 27: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

Ripple Carry Adder

Page 28: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

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”.

Page 29: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

Adder/Subtractor

Page 30: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

SubtractorA B D B

0 0 0 0

0 1 1 1

1 0 1 0

1 1 0 0

A B C D B

0 0 0 0 0

0 0 1 1 1

0 1 0 1 1

0 1 1 0 1

1 0 0 1 0

1 0 1 0 0

1 1 0 0 0

1 1 1 1 1

HALF SUBTRACTOR FULL SUBTRACTOR

Page 31: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

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

Page 32: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

4- Bit Subtractor

Page 33: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

Assignment # 3

• Design 4-Bit Adder - Subtractor

Page 34: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

4-Bit Adder - Subtractor

Page 35: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

Binary multiplier

Page 36: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

Self Study

• 3 x 4 Bit Multiplier

Page 37: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

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

Page 38: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

Magnitude Comparator (cont.)

1. Determine the required number of inputs and output.

Page 39: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

Magnitude Comparator (cont.)

2. Derive the Truth Table that defines the required relationship between inputs and outputs.

Page 40: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

Magnitude Comparator (cont.)3- Get the simplified logic function of the

outputs using k-map

Page 41: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

Magnitude Comparator (cont.)4- Draw the circuit

Page 42: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

4 – Bit Comparator

Page 43: Combinational Logic · 2018-10-04 · Summary : How to design a combinational circuit? 1. Determine the required number of inputs and outputs. 2.Derive the Truth Table. 3.Obtain the

4 – Bit Comparator