04 Adder MUX DMUX 2019

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

Dr.

Bonomali Khuntia
Berhampur University
October 2019
Digital Circuits
 Combinational Logic
 Output depends only on current input
 Sequential Logic
 Output depends not only on current input but also on past
input values
 Need some type of memory to remember the past input
values
Eg. Traffic light, counter
Adder
• Combinational logic circuits
give us many useful devices.
• One of the simplest is the
half adder, which finds the
sum of two bits.
• We can gain some insight as
to the construction of a half
adder by looking at its truth
table, shown at the right.

 As we see, the sum can be


found using the XOR
operation and the carry using
the AND operation.
Full Adder
Truth Table
K-map

Sum
AB AB Carry
00 01 11 10
Cin

Cin
00 01 11 10
0 1 1 0 1
1 1 1 1 1 1 1

S  A B C Co  AB  BC  CA
Draw the logic diagrams for both.
Assignment
Design Full-adder using two half adders and an OR gate.

C= XY’Z + X’YZ + XYZ’+XYZ


S=XY’Z’ +X’YZ’ + XYZ + X’Y’Z
= Z’ (XY’+X’Y) + Z (XY + X’Y’) = XY’Z + X’YZ + XY(Z’+Z)
= Z’ (XY’ + X’Y) + Z (XY’ + X’Y)’ = XY’Z + X’YZ + XY
= Z  (XY) = Z(XY’ + X’Y) + XY
= Z (XY) + XY
Subtractors
Half-subtractor:

Difference  A  B
Borrow  A B
Full Subtractor
Inputs Outputs

Difference of Full Subtractor is same as Sum of Full Adder.


Design Full-Subtractor using two half Subtractors and an OR gate.

Difference  A  B  Bin

Borrow  A B  BC  CA
Binary Adder
The carry bit “ripples” from one adder to the next; hence,
this configuration is called a ripple-carry adder.

Binary Parallel/Ripple Adder


Binary Adder/Subtractor
Assignments
 Design a 4-bit parallel subtractor using Full-
subtractors.
 Design a 4-bit combinational circuit incrementer
using Full-adders.
 Design a 4-bit combinational circuit decrementer
using Full-adders.
Algorithm
 Add the numbers with sign
bit treated the same as the
other bits.
 Overflow occurs when the
sum of two n-bit numbers
occupies n+1 bits.
 Overflow is detected by
XOR gate.
 If an overflow occurs, the
result in AC is erroneous.
Binary Decoder
 Black box with n input lines and 2n output lines
 Only one output is a 1 for any given input

n Binary 2n outputs
inputs Decoder
2-to-4 Binary Decoder
Truth Table:
X Y F0 F1 F2 F3 F0
0 0 1 0 0 0
X 2-to-4 F1

0 1 0 1 0 0 Y Decoder F2
F3
1 0 0 0 1 0
1 1 0 0 0 1

F0 = X'Y'
 From truth table, circuit for
2x4 decoder is:
F1 = X'Y
 Note: Each output is a 2-
variable minterm (X'Y', X'Y, F2 = XY'
XY' or XY)
F3 = XY

X Y
3-to-8 Binary Decoder
Truth Table:
F0 = x'y'z'
x y z F0 F1 F2 F3 F4 F5 F6 F7 F1 = x'y'z
0 0 0 1 0 0 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0 0 F2 = x'yz'
0 1 0 0 0 1 0 0 0 0 0
0 1 1 0 0 0 1 0 0 0 0 F3 = x'yz
1 0 0 0 0 0 0 1 0 0 0
1 0 1 0 0 0 0 0 1 0 0 F4 = xy'z'
1 1 0 0 0 0 0 0 0 1 0
1 1 1 0 0 0 0 0 0 0 1 F5 = xy'z
F6 = xyz'
F0
F1 F7 = xyz
X
F2
Y
3-to-8
F3
Z
Decoder F4
F5
F6
x y z
F7
Implementing Functions Using Decoders

 Any n-variable logic function can be implemented using a


single n-to-2n decoder to generate the minterms
 OR gate forms the sum.
 The output lines of the decoder corresponding to the
minterms of the function are used as inputs to the or
gate.
 Any combinational circuit with n inputs and m outputs
can be implemented with an n-to-2n decoder with m OR
gates.
 Suitable when a circuit has many outputs, and each output
function is expressed with few minterms.
Implementing Functions Using Decoders
x y z C S
 Example: Full adder 0 0 0 0 0
0 0 1 0 1
S(x, y, z) = S (1,2,4,7) 0 1 0 0 1
0 1 1 1 0
C(x, y, z) = S (3,5,6,7) 1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1

3-to-8 0
Decoder 1 S
2
x S2 3
y S1 4
5 C
z S0 6
7
Use two 3 to 8 decoders to make 4 to 16
decoder
 Enable can also be active high
 In this example, only one decoder can be active at
a time.
 x, y, z effectively select output line for w
Encoders
 If the a decoder's output code has fewer bits than the input
code, the device is usually called an encoder.
e.g. 2n-to-n
 The simplest encoder is a 2n-to-n binary encoder
 One of 2n inputs = 1
 Output is an n-bit binary number

Binary
2n encoder n
. .
inputs . . outputs
. .
8-to-3 Binary Encoder
At any one time, only one input line has a value of 1.
Inputs Outputs
I0 I1 I2 I3 I4 I5 I6 I7 y2 y1 y0
1 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 1
0 0 1 0 0 0 0 0 0 1 0
0 0 0 1 0 0 0 0 0 1 1
0 0 0 0 1 0 0 0 1 0 0
0 0 0 0 0 1 0 0 1 0 1
0 0 0 0 0 0 1 0 1 1 0
0 0 0 0 0 0 0 1 1 1 1
I0
I1 y2 = I4 + I5 + I6 + I7
I2
I3 y1 = I2 + I3 + I6 + I7
I4
I5
I6
I7 y0 = I1 + I3 + I5 + I7
MULTIPLEXERS (Data Selectors)
 A multiplexers (MUX) is a device that allows digital
information from several sources to be routed onto a single
line for transmission over that line to a common
destination.

 The basic multiplexers has several data input lines and a


single output line. It also has data- select inputs, which
permit digital data on any one of the inputs to be switched
to the output line.

 In simple terms, this is what a multiplexer (MUX) does; it


selects one of several input signals and passes it on to the
output.
Typical Application of a MUX
Multiple Sources Selector Single Destination

MP3 Player
Docking Station

D0
Laptop

MUX
D1
Sound Card Y
D2

D3

Surround Sound System

Digital B A Selected Source


Satellite
0 0 MP3
0 1 Laptop
1 0 Satellite
Digital
1 1 Cable TV
Cable TV

23
Two-input multiplexer
4-to-1 Multiplexer (MUX)

Select Output
S1 S0 Y Y  I 0 S0 S1  I1S0 S1  I 2 S0 S1  I 3 S0 S1
0 0 I0
0 1 I1
1 0 I2 I0
1 1 I3
I1
Y
I2

I3

S0
S1

25
4-to-1 MUX 8-to-1 MUX 16-to-1 MUX

Inputs Output (Y)


(and inverted output)

Select
Enable
DEMULTIPLEXERS

 A multiplexer takes several inputs and transmits


one of them to the output.
 A DEMULTIPLEXER (DEMUX) basically reverses
the multiplexing function. It takes data from one
line and distributes them to a given number of
output lines. For this reason, the demultiplexer is
also known as a data distributor.
Typical Application of a DEMUX
Single Source Selector Multiple Destinations

B/W Laser
Printer

Fax
Machine

D0

DEMUX
X D1

D2 Color Inkjet
Printer
D3

B A Selected Destination
0 0 B/W Laser Printer Pen
0 1 Fax Machine Plotter

1 0 Color Inkjet Printer


1 1 Pen Plotter

28
A 1-line-to-4-line demultiplexer
A 1-line-to-8-line demultiplexer
THANK YOU

You might also like