combinational logic - basavaraj talawarbinary adder–subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1,...

116
Combinational Logic Ch. 4. Mano & Ciletti.

Upload: others

Post on 24-May-2020

18 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Combinational Logic

Ch. 4. Mano & Ciletti.

Page 2: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Outline● Combinational Circuit Analysis● Design Procedure

– BCD to Excess-3 Converter

● Binary Adder – Subtractor– HA, FA, Carry Lookahead Generator

● BCD Adder● Binary Multiplier● Magnitude Comparator● Decoder, Boolean Functions using Decoders● Encoders● Multiplexers, Boolean Function Implementation● Three State Gates

Page 3: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Analysis

Page 4: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Analysis

Page 5: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Truth Table

Page 6: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Truth Table

Page 7: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Design Procedure● Code Conversion

– BCD to Excess-3 code

BCD toExcess-3BCD to

Excess-34

BCD_A E-34

Page 8: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Design Procedure● Code Conversion

– BCD to Excess-3 codeBCD to

Excess-3BCD to

Excess-34

BCD_A E-3

4

Page 9: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

BCD to Excess-3 Code

Page 10: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

BCD to Excess-3 Code

Page 11: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

BCD to Excess-3● K-Maps for w, x, y, and z.

Page 12: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

BCD to Excess-3

Page 13: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

BCD to Excess-3

Page 14: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Binary Adder–Subtractor● Bit-wise Addtion:

– 0 + 0 = 0– 0 + 1 = 1– 1 + 0 = 1– 1 + 1 = 10

Page 15: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Binary Adder–Subtractor● 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and

1 + 1 = 10● Outputs: Sum and Carry bits

Page 16: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Binary Adder–Subtractor● 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and

1 + 1 = 10● Outputs: Sum and Carry bits● Half Adder: Combinational circuit to

add two bits

Page 17: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Binary Adder–Subtractor● 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1

+ 1 = 10● Outputs: Sum and Carry bits● Half Adder: Combinational circuit to

add two bits● Full Adder: Adds three bits (two

significant bits and a previous carry)

Page 18: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Binary Adder–Subtractor● 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10● Outputs: Sum and Carry bits● Half Adder: Combinational circuit to add two

bits● Full Adder: Adds three bits (two significant

bits and a previous carry)● Binary Adder for two n-bit numbers: n full

adders in cascade .

Page 19: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Half Adder

Page 20: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Half Adder

HalfAdderHalf

Adder

a

bsum

carry

Page 21: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Half Adder - TT

Page 22: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Half Adder

Page 23: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Half Adder

Page 24: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Full Adder● Inputs: Addend, Augend, Carry bits● Outputs: sum, carry

Page 25: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Full Adder● 3 Inputs: Addend, Augend, Carry bit● Outputs: sum, carry

HalfAdderHalf

Adder

a

bsum

carry_out

carry_in

Page 26: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Full Adder – TT

Page 27: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Full Adder – TT

Page 28: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Full Adder

Page 29: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Full Adder

Page 30: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Full Adder

S

Page 31: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Full Adder using Half Adders

● Half Adder Outputs

● Full Adder Outputs

Page 32: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Full Adder using Half Adders

C=x ' yz+xy ' z+xyz '+xyzC=x ' yz+xy ' z+xyz '+xyz

C=x ' yz+xy ' z+xyC=x ' yz+xy ' z+xy

C=z (x ' y+xy ' )+xyC=z (x ' y+xy ')+xy

Page 33: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Full Adder using Half Adders

Page 34: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Full Adder using Half Adders

Page 35: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Full Adder using Half Adders

Page 36: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Binary Adder● 1011 + 0011

Page 37: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Binary Adder● 1011 + 0011

Page 38: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

4-bit Adder

Page 39: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

4-bit Adder

Ripple Carry AdderRipple Carry Adder

Page 40: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

4-bit Adder

Ripple Carry AdderRipple Carry Adder

Which is the critical path?Which is the critical path?

Page 41: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Carry Propagation● Rename HA outputs

Page 42: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Carry Propagation● Rename HA outputs

● FA outputs:

Page 43: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Carry Propagation● Rename HA outputs

● FA outputs: (Ci is the third input)

Page 44: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Carry Propagation

Page 45: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Carry Propagation

Page 46: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Carry Generation

Page 47: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Carry Generation

Page 48: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Carry Lookahead Generator

Page 49: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

4-bit Carry Lookahead Adder

Page 50: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Binary Subtractor

Page 51: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Binary Subtractor

Page 52: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

BCD Adder● Inputs: Two digits (0 – 9), Carry (0 –

1)● Max sum = 19 (9 + 9 + 1)● Use the 4-b Binary Adder● Convert the Binary output to BCD

Page 53: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

BCD Adder

Page 54: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

BCD Adder

+6 =

Page 55: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

BCDAdder

Page 56: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Binary Multiplier● 2 bit Multiply: B1B0 x A1A0

Page 57: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Binary Multiplier● 2 bit Multiply: B1B0 x A1A0

Page 58: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Binary Multiplier● 2 bit Multiply:

B1B0 x A1A0

Page 59: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Binary Multiplier● 4b x 3b. B3B2B1B0 x A2A1A0

Page 60: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Binary Multiplier

● 4b x 3b. B3B2B1B0x A2A1A0

Page 61: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Magnitude Comparator● Compares two numbers A and B● Outputs: A > B, A = B, or A < B

ComparatorComparator

nA A=B

nBA<BA>B

Page 62: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Magnitude Comparator● Consider A3A2A1A0, B3B2B1B0

● A = B

Page 63: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Magnitude Comparator● Consider A3A2A1A0, B3B2B1B0

● A = B

Page 64: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Magnitude Comparator● Consider A3A2A1A0, B3B2B1B0

● A > B

Page 65: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Magnitude Comparator● Consider A3A2A1A0, B3B2B1B0

● A > B

Page 66: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Magnitude Comparator● Consider A3A2A1A0, B3B2B1B0

● A > B

● A < B

Page 67: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Magnitude Comparator

Page 68: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Decoders● n-to-m-line Decoder:

– n-bit Input; 2n bit Output

2-to-4-lineDecoder

2-to-4-lineDecoder

2A

D3

D2

D1

D0

Page 69: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Decoder – TT

Page 70: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Decoder – TT

Page 71: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Decoder

Page 72: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Decoder with Enable

2-to-4-lineDecoder

2-to-4-lineDecoder

2AD

3

D2

D1

D0En

Page 73: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Decoder with Enable

2-to-4-lineDecoder

2-to-4-lineDecoder

2AD

3

D2

D1

D0En

Page 74: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Decoder with Enable

2-to-4-lineDecoder

2-to-4-lineDecoder

2AD

3

D2

D1

D0En

Page 75: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Decoder with Enable

2-to-4-lineDecoder

2-to-4-lineDecoder

2AD

3

D2

D1

D0En

Page 76: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Decoder with Enable

2-to-4-lineDecoder

2-to-4-lineDecoder

2AD

3

D2

D1

D0En

Page 77: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Decoder with Enable

Page 78: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Boolean using Decoder● Decoder provides 2n minterms of n

input variables● Any Boolean function can be

expressed in sum-of-minterms● Any n-input, m-output combinational

circuit can be implemented with an n-to-2n-line decoder and m OR gates.

Page 79: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Full Adder using Decoder

Page 80: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Full Adder using Decoder

Page 81: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Encoders● Inverse of a decoder.● Encoder has 2n (or fewer) input

lines and n output lines

Page 82: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

23-to-3-line Encoder

Page 83: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

23-to-3-line Encoder

Page 84: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

23-to-3-line Encoder

Page 85: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

23-to-3-line Encoder

Page 86: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Priority Encoder● If two or more inputs are equal to 1

at the same time, input having the highest priority will take precedence.

Page 87: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Priority Encoder

Page 88: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Priority Encoder

Page 89: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Priority Encoder

Page 90: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Priority Encoder – Maps

Page 91: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Priority Encoder – Maps

Page 92: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Priority Encoder

Page 93: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Priority Encoder

Page 94: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Multiplexers● Selects binary information from one of

many input lines and directs it to a single output line.

● Selection of the input line is controlled by a set of selection lines– 2n input lines ==> n selection lines

● Also called Data Selector

Page 95: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Multiplexer

Page 96: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

MultiplexerS Y

0 I0

1 I1

Page 97: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

MultiplexerS Y

0 I0

1 I1

Y= I 0×S+ I1×SY= I 0×S+ I1×S

Page 98: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

MultiplexerS Y

0 I0

1 I1

Y= I 0×S+ I1×SY= I 0×S+ I1×S

Page 99: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

4-to-1 Multiplexer

Page 100: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

4-to-1 Multiplexer

I0

I1

I2

I3

Y

s2

Page 101: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

4-to-1 Multiplexer

I0

I1

I2

I3

Y

s2

Page 102: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

4-to-1 Multiplexer

I0

I1

I2

I3

Y

s2

Y=S1S0×I 0+S1S0×I 1+S1S0× I 2+S1S0×I 3Y=S1S0×I 0+S1S0×I 1+S1S0× I 2+S1S0×I 3

Page 103: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

4-to-1 MultiplexerI0

I1

I2

I3

Y

s2

Y=S1S0×I 0+S1S0×I 1+S1S0× I 2+S1S0×I 3Y=S1S0×I 0+S1S0×I 1+S1S0× I 2+S1S0×I 3

Page 104: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Quadruple two-to-one-line Multiplexer

A

BY

s

4

4

4

E

Page 105: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Boolean Function Implementation

● Boolean function of n variables– F(x,y,z)

● n–1 variables of the function are connected to the selection inputs– x, and y; for the function F(x,y,z)

● Remaining single variable is used for data input– z, z, 0, 1

Page 106: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Boolean Function Implementation

x y z F

Page 107: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Boolean Function Implementation

Page 108: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Boolean Function Implementation

Page 109: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Boolean Function ImplementationA B C D F

Page 110: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Boolean Function Implementation

Page 111: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Boolean Function Implementation

Page 112: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Three State Gates

Page 113: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Three State Gates

2-to-1-line Mux2-to-1-line Mux

Page 114: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Summary● Combinational Circuit Analysis● Design Procedure

– BCD to Excess-3 Converter

● Binary Adder – Subtractor– HA, FA, Carry Lookahead Generator

● BCD Adder● Binary Multiplier● Magnitude Comparator● Decoder, Boolean Functions using Decoders● Encoders● Multiplexer, Boolean Function Implementation● Three State Gates

Page 115: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Extra

Page 116: Combinational Logic - Basavaraj TalawarBinary Adder–Subtractor 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 Outputs: Sum and Carry bits Half Adder: Combinational circuit to add

Three State Gates

4-to-1-line Mux4-to-1-line Mux