digital electronics chapter 4 combinational logic

28
Digital Electronics

Upload: melvin-luke-fleming

Post on 28-Dec-2015

241 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Digital Electronics Chapter 4 Combinational Logic

Digital Electronics

Page 2: Digital Electronics Chapter 4 Combinational Logic

Chapter 4

Combinational Logic

Page 3: Digital Electronics Chapter 4 Combinational Logic

Terminology

Combinational:Output is completely determined from the input(s) and does not depend on time

Sequential : Output depends on the input(s), previous history, and time

Analysis : A circuit is given and one must determine the Truth Table

Design: One must build a circuit whose output(s) are given as a Truth Table

Page 4: Digital Electronics Chapter 4 Combinational Logic

Analysis Problem

Set up the Truth Table

Page 5: Digital Electronics Chapter 4 Combinational Logic

Analysis: Truth Table

x y F

0 0 0

0 1 1

1 0 1

1 1 0

Page 6: Digital Electronics Chapter 4 Combinational Logic

Design or Synthesis

x y z F

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 1

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

Page 7: Digital Electronics Chapter 4 Combinational Logic

K-Map of Design Problem

y'z' y'z yz yz'

x'

x

1

1 1 1

F = x y + x z + y z

Page 8: Digital Electronics Chapter 4 Combinational Logic

Final Circuit Design

F = x y + x z + y z

Page 9: Digital Electronics Chapter 4 Combinational Logic

Binary Adder

Half Adder Truth Table

x y C S

0 0 0 0

0 1 0 1

1 0 0 1

1 1 1 0

Page 10: Digital Electronics Chapter 4 Combinational Logic

Implementation of Half Adder

Page 11: Digital Electronics Chapter 4 Combinational Logic

Full Adder

x y z C S

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

Page 12: Digital Electronics Chapter 4 Combinational Logic

Implementation of Full Adder

Page 13: Digital Electronics Chapter 4 Combinational Logic

Magnitude Comparator

Page 14: Digital Electronics Chapter 4 Combinational Logic

Comparator Theory

x is generated from XNOR and equals 1 if the two bits are equal

A = B if all the x’s are equal

A > B if the corresponding bit is greater as long as the previous bits are equal

A < B if the corresponding bit is smaller as long as the previous bits are equal

Page 15: Digital Electronics Chapter 4 Combinational Logic

3-to-8 Line Decoder

Page 16: Digital Electronics Chapter 4 Combinational Logic

Decoder Truth Table

Which output will be high when x =1, y = 1 and z = 0 ?

Page 17: Digital Electronics Chapter 4 Combinational Logic

Decoder Truth Table

Only line 6 will be high. The other 7 lines will be low.

Page 18: Digital Electronics Chapter 4 Combinational Logic

Decoder Application

Implement the Full Adder with a 3x8 Decoder

Page 19: Digital Electronics Chapter 4 Combinational Logic

Full Adder using 3x8 Decoder

Page 20: Digital Electronics Chapter 4 Combinational Logic

Important Note!

The actual 74LS138 decoder chip has inverted outputs … welcome to the REAL WORLD!!!

Page 21: Digital Electronics Chapter 4 Combinational Logic

Multiplexer

A multiplexer is a combinational circuit that selects binary information from one of many

input lines and directs it to a single output line.

Page 22: Digital Electronics Chapter 4 Combinational Logic

Multiplexer

Page 23: Digital Electronics Chapter 4 Combinational Logic

Multiplexer Application

Implement the function F(x,y,z) = Σ(1,2,6,7)

Page 24: Digital Electronics Chapter 4 Combinational Logic

F(x,y,z) = Σ(1,2,6,7) with a multiplexer

Page 25: Digital Electronics Chapter 4 Combinational Logic

VHDL

// A 2x4 Decoder with enable Emodule my_decoder (A,B,E,D); input A,B,E; output [0:3] D; assign D[0] = ~(~A & ~B & ~E), D[1] = ~(~A & B & ~E), D[2] = ~(A & ~B & ~E), D[3] = ~(A & B & ~E);endmodule

Page 26: Digital Electronics Chapter 4 Combinational Logic

Gate implementation of my_decoder

Page 27: Digital Electronics Chapter 4 Combinational Logic

More VHDL ...

//A 4-bit comparatormodule comp(A,B,ALTB,AGTB,AEQB); input [3:0] A,B; output ALTB,AGTB,AEQB; assign ALTB = (A < B), AGTB = (A > B), AEQB = (A == B);endmodule

Page 28: Digital Electronics Chapter 4 Combinational Logic

That’s All Folks!