32
1 Combinational Logic Design Digital Computer Logic Kashif Bashir http://www.taleem.greatnow.com Email: [email protected]

1 Combinational Logic Design Digital Computer Logic Kashif Bashir Email: [email protected]

Embed Size (px)

Citation preview

Page 1: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

1

Combinational Logic Design

Digital Computer Logic

Kashif Bashirhttp://www.taleem.greatnow.com

Email: [email protected]

Page 2: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

2

Module Outline Combinational Circuits Design Topics Analysis Procedure Design Procedure Decoders Encoders Multiplexers Binary Adders Binary Subtraction Binary Adder-subtractors Binary Multipliers Decimal Arithmetic

Page 3: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

3

Combinational Circuits The outputs are a function of the present set of

inputs only The inside of a combinational circuit is made of

logic gates Combinational logic circuits are important

components of digital systems Each output can be thought of as a function of

all the inputs – if there are m outputs and n inputs then there are m boolean functions, one describing each output

Page 4: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

4

Combinational Circuits

Combinational Logic Circuit

m Outputsn Inputs

Page 5: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

5

Design Topics - Design Hierarchy

Uses divide and conquer approach Break the circuit into smaller pieces called blocks If a block is too large break it up into still smaller

blocks At each level or hierarchy we have a representation of

the blocks such as block diagram, gates, circuits Benefits

Reusability of blocks Quicker design completion Easier to verify and isolate problems

Page 6: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

6

Figure 3-2

Page 7: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

7

Diagrams Representing the Hierarchy for Figure 3-2

Page 8: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

8

Design Topics - Computer Aided Design

Digital Design of real world systems has become too complex to be done by hand alone

Digital design tools or software helps in creating design and verify it

Uses Hardware Description languages such as VHDL, Verilog

Computer Aided Design Tools exist for: Schematic Capture Simulation of Design Verification Synthesis Etc.

Page 9: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

9

Design Topics - Top Down Design

Ideally deign is top down which means the design is specified at very high levels of abstraction as text along with constraints on cost, performance size, reliability, etc.

Then the design is repeatedly divided into smaller and smaller blocks and implemented with these blocks

In order to obtain reusability and to make maximum reuse of predefined modules, often portions of the design are performed bottom-up

Page 10: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

10

Analysis Procedure Derivation of Boolean Functions Derivation of the Truth Table Logic Simulation

Page 11: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

11

Design Procedure1. From the specifications of the circuit,

determine the required number of inputs and outputs and assigned a letter symbol to each

2. Derive the truth table that defined the relationship between inputs and putouts

3. Obtain the simplified Boolean functions for each output as a function f the input variables

4. Draw the logic diagram

5. Verify the correctness of the design

Page 12: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

12

Some Design Examples BCD to Excess-3 code converter BCD to Seven Segment Decoder

Page 13: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

13

BCD to Excess-3 code converter

Page 14: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

14

BCD to Excess-3

code converter K-Maps

Page 15: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

15

BCD to Excess-3 code converter Logic Diagram

Page 16: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

16

Decoders n to 2n decoder - a

combinational logic circuit that converts binary information from the n coded inputs to a maximum of 2n unique outputs

Also called the n-to-m line deciders for example: 2-to-4 line decoder 3-to-8 line decoder

DecoderCombinational Logic Circuit

n Inputs 2n Outputs

Page 17: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

17

Decoder Diagrams

Page 18: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

18

Decoder with Enable Input

Page 19: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

19

Decoder Expansion Can use smaller

decoders to build bigger decoders.

e.g. using two 2-4 decoders we can build a 3-8 decoder or using two 3-8 decoders we can build a 4-16 decoder

Page 20: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

20

Combinational Circuit Implementation using Decoder A n-input decoder generates the minterms

corresponding to a boolean function of n-variables

Can use the outputs of a decoder along with an OR gate to implement a Boolean function in SOP form

Page 21: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

21

Combinational Circuit Implementation using Decoder

Page 22: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

22

Encoders Performs the

inverse operation of a decoder

Has 2n or fewer input lines and n output lines

The output generates the binary code corresponding to the input value

EncoderCombinational Logic Circuit

n Outputs2n Inputs

Page 23: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

23

Examples of Encoders Octal to Binary Encoder Priority Encoder

Page 24: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

24

Priority Encoder

Page 25: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

25

Multiplexers A multiplexer is

a combinational circuit that selects binary information from one of many input lines and directs the information to a single output line

MULTIPLEXERCombinational Logic Circuit

1 Output2n Inputs

n Selection Lines

Page 26: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

26

4-to-1-Line Multiplexer

MULTIPLEXERCombinational Logic Circuit

Output4 Inputs

S0 S1

D0

D1

D2

D3

S1 S0

Function table

Output

0 00 11 01 1

D0

D1

D2

D3

Page 27: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

27

Building MUXes

Page 28: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

28

Building MUXes

A MUX can be built using transmission gates

Mutiplexer blocks can be combined in parallel with common selection and enable lines to perform selection on multi-bit quantities

Page 29: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

29

Implementing Boolean Functions Using MUX

Any Boolean function of n-variables can be implemented using a MUX with n selection lines

A more efficient method is using a MUX with n-1 selection lines.

Let us take a look at each method

Page 30: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

30

Example of Implementing Boolean Functions Using MUX

Page 31: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

31

Example of Implementing Boolean Functions Using MUX

Page 32: 1 Combinational Logic Design Digital Computer Logic Kashif Bashir   Email: kashif@pafkiet.edu.pk

32

Demultiplexers Performs the inverse operation of a multiplexer A combinational circuit that receives input

from a single line and transmits it to one of 2n possible output lines

The selection of the specific output is controlled by the bit combination of n selection lines

Same as a Decoder with an enable – how?