FA Using 3to8 Dec

34
ECE 301 – Digital Electronics Decoders and Encoders (Lecture #13)

description

Full Adder using 3 to 8 Decoder.

Transcript of FA Using 3to8 Dec

Page 1: FA Using 3to8 Dec

ECE 301 – Digital Electronics

Decoders and Encoders

(Lecture #13)

Page 2: FA Using 3to8 Dec

ECE 301 - Digital Electronics 2

Definitions Active – the function is being performed

Active low – active when the output is 0. Active high – active when the output is 1.

Enabled – active circuit can perform its function Low-level enabled

circuit performs its function when Enable = 0. High-level enabled

circuit performs its function when Enable = 1.

Page 3: FA Using 3to8 Dec

ECE 301 - Digital Electronics 3

Decoders

Page 4: FA Using 3to8 Dec

ECE 301 - Digital Electronics 4

Decoder

A decoder selects 1 of 2N output lines by decoding a binary value on the N input lines.

(similar to a 1-to-2N Demultiplexer)

Page 5: FA Using 3to8 Dec

ECE 301 - Digital Electronics 5

Decoder: N-to-2N

0

w n 1 –

N inputs

EnEnable

2 N

outputs

y 0

y 2 n 1 –

w

Active-high or active-lowActive-high or active-low

Page 6: FA Using 3to8 Dec

ECE 301 - Digital Electronics 6

Decoder: 2-to-4

x

yD

0

D1

D2

D3

0

0

1

1

1

0

1

D 0 x

0

y

0

0

0

1

D 1

1

0

0

0

D 2

0

1

0

0

D 3

0

0

1

0

active-high output

Page 7: FA Using 3to8 Dec

ECE 301 - Digital Electronics 7

Decoder: 2-to-4 with Enable

0

active-low output

Page 8: FA Using 3to8 Dec

ECE 301 - Digital Electronics 8

Decoder: 3-to-8

Page 9: FA Using 3to8 Dec

ECE 301 - Digital Electronics 9

Decoder: 3-to-8

Page 10: FA Using 3to8 Dec

ECE 301 - Digital Electronics 10

Decoder: 4-to-16

Page 11: FA Using 3to8 Dec

ECE 301 - Digital Electronics 11

Designing Logic Circuits using Decoders

Decoders

Page 12: FA Using 3to8 Dec

ECE 301 - Digital Electronics 12

Decoders: Designing Logic Circuits

• Each row in a Truth Table corresponds to a minterm

• Each minterm can be mapped to a decoder output

• For each row in the Truth Table, where the output of the function is one (F = 1),

– Sum (“OR”) the corresponding outputs of the decoder to realize the logic function

Page 13: FA Using 3to8 Dec

ECE 301 - Digital Electronics 13

Decoders: Designing Logic CircuitsF = m(0,2)

Page 14: FA Using 3to8 Dec

ECE 301 - Digital Electronics 14

Exercise:

Design a circuit, using a 3-to-8 Decoder to realize the Boolean expression given below.

FX,Y,Z

= m(1,2,5,7)

Decoders: Designing Logic Circuits

Page 15: FA Using 3to8 Dec

ECE 301 - Digital Electronics 15

Exercise:

Design a circuit, using 2-to-4 Decoders to realize the Boolean expression given below.

FX,Y,Z

= m(1,2,5,7)

Decoders: Designing Logic Circuits

Page 16: FA Using 3to8 Dec

ECE 301 - Digital Electronics 16

Exercise:

Design a Full Adder using a 3-to-8 Decoder.

Decoders: Designing Logic Circuits

Page 17: FA Using 3to8 Dec

ECE 301 - Digital Electronics 17

Full Adder:

Sum = X xor Y xor Z

Carry = X.Y + X.Z + Y.Z

Page 18: FA Using 3to8 Dec

ECE 301 - Digital Electronics 18

Decoders: Designing Logic CircuitsFull Adder

Page 19: FA Using 3to8 Dec

ECE 301 - Digital Electronics 19

Encoders

Page 20: FA Using 3to8 Dec

ECE 301 - Digital Electronics 20

An encoder outputs the binary value of theactive input.

An encoder has 2N inputs and N outputs.

Encoder

Page 21: FA Using 3to8 Dec

ECE 301 - Digital Electronics 21

Encoder Inverse operation of the decoder

Decoder selects one output based on the input binary number.

Encoder outputs a binary number based on the selected input.

Issues What if more than one input is active? What if no inputs are active?

Page 22: FA Using 3to8 Dec

ECE 301 - Digital Electronics 22

2 N

inputs

w 0

w 2 n 1 –

y 0

y n 1 –

N outputs

Encoder: 2N-to-N

The active (or selected) input is encoded on the n outputs.

Page 23: FA Using 3to8 Dec

ECE 301 - Digital Electronics 23

w 1

w 0

y 0

w 2

w 3 y 1

0

0

1

1

1

0

1

w 3 y 1

0

y 0

0

0

1

0

w 2

0

1

0

0

w 1

1

0

0

0

w 0

0

0

0

1

Encoder: 4-to-2

Page 24: FA Using 3to8 Dec

ECE 301 - Digital Electronics 24

Encoder: 8-to-3

Page 25: FA Using 3to8 Dec

ECE 301 - Digital Electronics 25

Priority Encoder• Higher-order input has priority of lower-order input

– Order of the input determined by its binary value

• I0 has binary value 000 (0)

• I1 has binary value 001 (1)

• I2 has binary value 010 (2)

• I3 has binary value 011 (3)

• etc.

– So, • I1 selected over I0

• I2 selected over I1 and I0

• I3 selected over I2, I1, and I0

• etc.

Page 26: FA Using 3to8 Dec

ECE 301 - Digital Electronics 26

Priority Encoder

• Valid indicator

– Output signal of the (priority) encoder that indicates the validity of the encoded output

– Encoded output is invalid when no inputs are selected or when the encoder is disabled

• V = 0 (indicates invalid encoded output; active high)

– Encoded output when one, or more, input(s) is (are) selected, and encoder is enabled

• V = 1 (indicates valid encoded output; active high)

Page 27: FA Using 3to8 Dec

ECE 301 - Digital Electronics 27

4-to-2 Priority Encoder

Valid indicator

invalid

valid

Page 28: FA Using 3to8 Dec

ECE 301 - Digital Electronics 28

4-to-2 Priority Encoder

1

Page 29: FA Using 3to8 Dec

ECE 301 - Digital Electronics 29

4-to-2 Priority Encoder

Page 30: FA Using 3to8 Dec

ECE 301 - Digital Electronics 30

Tri-state Devices

Page 31: FA Using 3to8 Dec

ECE 301 - Digital Electronics 31

Tri-state Devices

Page 32: FA Using 3to8 Dec

ECE 301 - Digital Electronics 32

Tri-state Devices

Page 33: FA Using 3to8 Dec

ECE 301 - Digital Electronics 33

Tri-state Devices

Page 34: FA Using 3to8 Dec

ECE 301 - Digital Electronics 34

Tri-state Devices