Вы находитесь на странице: 1из 8

Islamic University of Gaza

Faculty of Engineering
Computer Engineering Dept.
Digital Design Lab : ECOM 2112
Fall 2016

Eng. Bassam Nabriss


‫بسام عب د الكريم جاد هللا ال نبريص‬

Bass am Ak J Al nabr iss

LAB 6

Decoders & Encoders


Multiplexers & Demultiplexers

21/10/2016
Objectives
 Understanding the construction and operational principles of digital decoders and
encoders.
 Understanding the construction and operational of 7-segment BCD Segment decoder.
 Understanding how to implement functions using multiplexers and demultiplexers.

Theory
Decoders
A decoder is a logic circuit that will detect a specific binary number and the output is a
binary signal that indicates the presence or absence of that specific number. It converts
binary information from n input lines to a maximum of 2n unique output lines. So we have
types like 2-to-4 or 3-to-8, Can you mention other types?

2-to-4 Decoder
Inputs Outputs
B A F0 F1 F2 F3
0 0 1 0 0 0
0 1 0 1 0 0
1 0 0 0 1 0
1 1 0 0 0 1

𝐹0 = 𝐵`𝐴`
𝐹1 = 𝐵`𝐴
𝐹2 = 𝐵𝐴`
𝐹1 = 𝐵𝐴
Some decoders also have an enable input which will use
to out 0 for all outputs if it is disabled. Also some types of
decoders out 0 instead of 1 and 1 instead of 0, these types should have 0 for enabling bit.
For more information about these types check the ttl 74-139.

1
Example, Design the half-adder using decoders.
The half adder has two outputs S as sum and C as
carry, using the truth table of the half adder, where
S = 1 if A, B = 01 or 10, and C = 1 if A, B=1,1, we can
implement this implementation. where the purple
rectangle is the 2-to-4 decoder IC.

BCD-to-Seven Segment decoder


A seven segment LED display contains 7 LEDs. Each LED is called a segment and they are
identified as (a, b, c, d, e, f, g) segments. some of the 7-segment are common cathode and
others are common anode, for example, if decimal 4 is needed to be displayed, and if the 7-
segment is common anode and you want to show 4, then you should set the a,b,c,d,e,f,g =
1,0,0,1,1,0,0 and if it common cathode you should set it to 0,1,1,0,0,1,1

Encoders
Encoder is a digital circuit that performs the inverse operation of
a decoder, generates a unique binary code from several input
lines, n bit encoder has 2n input.

Inputs Outputs
D3 D2 D1 D0 Q1 Q0
0 0 0 1 0 0
0 0 1 x 0 1
0 1 x x 1 0
1 x x x 1 1
2*4 Encoder

2
In this implementation we can note that the pin
D0 is not used!, for example, if we want to draw
the implementation of the previous table, so
some ICs add the output V which denote to valid.
Also some encodes work on 0 and not 1, for
example the IC 74LS748 work on the highest 0
value.

LAB work
Part1: 2-to-4 decoder Part2: BCD-to-Seven Segment
Use the module KL-33005 block C, Find Use KL-33005 block b. To test this circuit
the suitable connection by yourself and LT should be 0 and to do this we should
find the truth table. connect the pin to 5V (not there is an
inverter gate). And find all compiantions

For more information about this IC check


this

3
Theory
Multiplexers
It is a device that selects one of several analog or digital input signals and forwards the
selected input into a single line, a multiplexer of 2n inputs has n select lines, which are used
to select which input line to send to the output. So it has only one output. Some multiplexers
have an enable bit which often is active-low so to enable it you should connect it 0 (0v), and
if you disable it, the output will be 1 regardless of the value of inputs.

2-to-1 Mux
The simplest multiplexer is a 2-to-1 mux, which
has a selector to select result will be from A or B.
where 2 is the number of inputs and 1 is the number
of bits on the output, can it have a value other than
than 1?

Q = S`A + SB

Inputs Output
S A B Q
0 0 X 0
0 1 X 1
1 X 0 0
1 X 1 1

We also can write the previous table as


Inputs Output
S Q
0 A
1 B

4-to-1 Mux
Another type of multiplexers is 4-to-1 (4 inputs and two Inputs Output
selectors and 1 output), S1 S0 Q
0 0 A
Q = A S0` S1` + BS1` S0 + C S1 S0` + D S1 S0 0 1 B
1 0 C
1 1 D

4
The implementation,

Example, you have 16 to 1


multiplexer, what is the
number of inputs,
selectors, and outputs?
Inputs: 16
Selectors: 4, where 24 = 16
Outputs: 1

Example, Implement the following F (A, B, C, D) = ∑ (1,2,4,5,8,12,14) using suitable mux.


Solution:
1- Use the first input as mux inputs.
2- The other inputs (3) used as selector, so
it has 3 selectors with 8 inputs.
3- The type of mux is 23 to 1 mux.
I0 I1 I2 I3 I4 I5 I6 I7
A` 0 1 2 3 4 5 6 7
A 8 9 10 11 12 13 14 15
A A` A` 0 1 A` A 0

Demultiplexers
The Demultiplexer is combinational logic circuit
that performs the reverse operation of
Multiplexer. It has only one input, n selectors
and 2n outputs, depending on the combination
of the select lines, one of the outputs will be
selected to take the state of the input

Inputs Outputs
Data S1 S0 Y0 Y1 Y2 Y3
D 0 0 D 0 0 0
D 0 1 0 D 0 0
D 1 0 0 0 D 0
D 1 1 0 0 0 D

5
Note that by applying logic '1' to the input, the circuit will do the same function of the
typical 2-to-4 Decoder.

LAB work
Part 1: 2-to-1 Mux Part 2: 8-to-1 Mux
Construct 2-to-1 Mux using KL-33006 Use KL-33006 block
block e. (D1=A, D0=B, S=C) Connect STROBE to 0, Read the result
from F.

6
Exercises
1- Design 3-to-8 decoder using two 2-to-4 decoders with enables. Then find the truth
table.
2- Design a Full Adder using decoder.
3- Implement the design of 3*8 encoder.
4- Implement F (A, B, C, D) = ∏ (3, 8, 12) using Mux,
a. In terms of B
b. In terms of D
5- Construct the implementation of 1*8 demultiplexer.
6- Design full adder using multiplexers.

Вам также может понравиться