You are on page 1of 31

‫بسم ميحرلا نمحرلا هللا‬

Bayan University of Science and Technology


Collage of Engineering

Biomedical Engineering Department

Digital Circuit

T. Ryan Osman
Lec8
Decoder and Encoder
 The decoder is a combinational circuit that converts
binary information from n input lines to a maximum
of 2n unique output lines.
 The decoders presented here are called n-to-m line
decodes, where 𝑚 ≤ 2n (n is input ; m is output for
example decoder 3 to 8 line)
 Binary decoders can be developed using AND or OR
Gates.
 The outputs of a decoder are minterms. That is why
decoders are sometimes called as minterm
generators.
 There are 2n possible input combinations, for each of
these input combination only one output will be
HIGH (active) all other outputs are LOW.
 Some decoder have one or more ENABLE (E) inputs
that are used to control the operation of decoder.
 Block diagram of decoder:
Block diagram of 2 to 4 decoder:

 A and B are the inputs. ( Number of inputs =2)


2
 Number of possible input combinations: 2 =4
2
 Number of Outputs : 2 =4, they are indicated by D0,
D1, D2 and D3
 Truth table of 2 to 4 decoder:
Inputs Outputs Boolean
A B D0 D1 D2 D3 expression
0 0 1 0 0 0 D0 =AB
0 1 0 1 0 0 D1 =AB
1 0 0 0 1 0 D2 =AB
1 1 0 0 0 1 D3 =AB

 From the Truth Table it is clear that each output


is “1” for only specific combination of inputs.
 Logic diagram:
 Block diagram:

 x0,x1 and E are the inputs.


2
 Number of Outputs : 2 =4, they are indicated by Z0,
Z1, Z2 and Z3
 Truth table
Inputs Outputs
E x0 x1 Z0 Z1 Z2 Z3
0 x x 0 0 0 0
1 0 0 1 0 0 0
1 0 1 0 1 0 0
1 1 0 0 0 1 0
1 1 1 0 0 0 1
 Logic diagram:
Block diagram of 3 to 8 decoder:

 A,B and C are the inputs. ( Number of inputs =3)


3
 Number of possible input combinations: 2 =8
2
 Number of Outputs : 2 =4, they are indicated by D0,
D1, D2, D3, D4, D5, D6, D7 (from D0to D7)
 Truth table of 2 to 4 decoder:
Inputs Outputs Boolean
A B C D0 D 1 D2 D 3 D4 D 5 D6 D7 Expression
0 0 0 1 0 0 0 0 0 0 0 D0 = A'B'C'
0 0 1 0 1 0 0 0 0 0 0 D1 = A'B'C
0 1 0 0 0 1 0 0 0 0 0 D2 = A'BC'
0 1 1 0 0 0 1 0 0 0 0 D3 = A'BC
1 0 0 0 0 0 0 1 0 0 0 D4 = AB'C'
1 0 1 0 0 0 0 0 1 0 0 D5 = AB'C
1 1 0 0 0 0 0 0 0 1 0 D6 = ABC'
1 1 1 0 0 0 0 0 0 0 1 D7 = ABC

 From the Truth Table it is clear that each output


is “1” for only specific combination of inputs.
 Logic diagram:
 Implement the following multiple output function
using a suitable Decoder.
 f1(A, B, C) = Σm(0,4,7)+ d(2,3)
 f2 (A, B, C) =Σm (1,5,6)
 f3 (A, B, C) =Σm (0,2,4,6)
 A combinational circuit is defined by the following
Boolean function. Design circuit with a Decoder and
external gate.
• F1(x,y,z)=x'y'z'+xz
• F2(x,y,z)=xyz'+x'z
 STEP 1: Write the given function F1 and F2 in SOP
form
 F1(x,y,z)=x'y'z'+(y+y')xz
F1(x,y,z)=x'y'z'+y'xz+yxz
F1(x,y,z)= Σm (0,5,7)
 F2(x,y,z)=xyz'+(y+y')x'z
F2(x,y,z)=xyz'+y'x'z+yx'z
F2(x,y,z)= Σm (1,3,6)
1. Design 3 to 8 line decoder with enable
2. Design 2 to 4 line decoder with enable using NAND
gate
3. Implement full adder by using decoder
4. Implement the following Boolean function using
suitable Decoder.
 f1 (x,y,z)=Σm(1,5,7)
 f2 (x,y,z)=Σm(0,3)
 f3 (x,y,z)=Σm(2,4,5)
 An encoder is a digital circuit that performs the inverse
operation of a decoder. An encoder has 2n (or fewer) input
lines and n output lines. The output lines, as an aggregate,
generate the binary code corresponding to the input value.
 Encoders are used to translate the rotary or linear motion
into a digital signal.
 The difference between Decoder and Encoder is that
Decoder has Binary Code as an input while Encoder has
Binary Code as an output.
 Encoder is an Electronics device that converts the analog
signal to digital signal such as BCD Code.
 Types of Encoders:
i. Priority Encoder
ii. Decimal to BCD Encoder
iii. Octal to Binary Encoder
iv. Hexadecimal to Binary Encoder
 As the name indicates, the priority is given to inputs
line.
 If two or more input lines are high at the same time
i.e 1 at the same time, then the input line with high
priority shall be considered.
 Block Diagram of Priority Encoder:
 Truth table of Priority Encoder:
Inputs Outputs
Valid
D3 D2 D1 D0 Y1 Y0
0 0 0 0 x x 0
0 0 0 1 0 0 1
0 0 1 x 0 1 1
0 1 x x 1 0 1
1 x x x 1 1 1

 There are four inputs D0, D1,D2, D3 and two outputs Y1 and
Y2.
 D3 has highest priority and D0 is at lowest priority.
 If D3=1 irrespective of other inputs then output Y1Y0=11.
 D3 is at highest priority so other inputs are considered as
don’t care.
 Logic diagram of priority encoder:
 Y1=D2+D3
 Y2=D3+D2'D1
 It has ten inputs corresponding to ten decimal digits
(from 0 to 9) and four outputs (A,B,C,D) representing
the BCD.
 Block Diagram of decimal to BCD encoder:
 Truth table of decimal to BCD encoder:
 From Truth Table it is clear that the output A is HIGH
when input is 8 OR 9 is HIGH
Therefore A=8+9
 The output B is HIGH when 4 OR 5 OR 6 OR 7 is HIGH
Therefore B=4+5+6+7
 The output C is HIGH when 2 OR 3 OR 6 OR 7 is HIGH
Therefore C=2+3+6+7
 Similarly D=1+3+5+7+9
 Logic diagram of decimal to BCD encoder:
 Write about:
Octal to binary encoder
must be include:
1. Block diagram
2. Truth table
3. Logic diagram
Thank you

You might also like