Professional Documents
Culture Documents
What is demultiplexer?
The data distributor, known more commonly as a Demultiplexer or Demux
for short, is the exact opposite of the Multiplexer we saw in the previous tutorial.
The demultiplexer takes one single input data line and then switches it to any one
of a number of individual output lines one at a time. The demultiplexer converts a
serial data signal at the input to a parallel data at its output lines as shown below.
1-to-4 Channel De-multiplexer
Output Select
b
Data Output
Selected
inverting operational amplifier is dependent upon the ratio between the input
resistor, Rin and its feedback resistor, R as determined in the Op-amp tutorials.
The digitally controlled analogue switches of the demultiplexer select an
input resistor to vary the value of Rin. The combination of these resistors will
determine the overall gain of the amplifier, (Av). Then the voltage gain of the
inverting operational amplifier can be adjusted digitally simply by selecting the
appropriate input resistor combination.
Standard Demultiplexer IC packages available are the TTL 74LS138 1 to 8-output
demultiplexer, the TTL 74LS139 Dual 1-to-4 output demultiplexer or the CMOS
CD4514 1-to-16 output demultiplexer.
Another type of demultiplexer is the 24-pin, 74LS154 which is a 4-bit to 16line demultiplexer/decoder. Here the individual output positions are selected using
a 4-bit binary coded input. Like multiplexers, demultiplexers can also be cascaded
together to form higher order demultiplexers.
Unlike multiplexers which convert data from a single data line to multiple lines and
demultiplexers which convert multiple lines to a single data line, there are devices
available which convert data to and from multiple lines and in the next tutorial
about combinational logic devices, we will look at Encoders which convert multiple
input lines into multiple output lines, converting the data from one form to
another.
Uses of Demultiplexer
Demultiplexer is used to connect a single source to multiple destinations. One use
of
the Demultiplexer is at the output of the ALU circuit. The output of the ALU has to
be stored in
one of the multiple registers or storage units. The Data input of the Demultiplexer i
s connected
to the output of the ALU. Each output of the Demultiplexer is connected to each of
the multiple
registers. By selecting the appropriate output data from the ALU
is routed to the appropriate
3
connected to their inputs by blowing away appropriate fuses which are blown throu
gh
programming. A programmed OR array has sum terms at the output of its OR gate
s. Similarly
a programmed AND array has product terms at its output. Figure 19.
An alternate implementation of the grid is with no fuses, the grid column and row
conductors are not connected to each other. A specific column conductor can be co
nnected to
a row conductor by shorting the column and row conductors. Both the methods in
which a fuse
is blown to disconnect a column from a row and the shorting method in which a co
lumn is
connected to
a row can only be done once. Thus when an array has been configured to
perform a function it can not be reprogrammed.
Programmable Logic Devices have an array of AND gates and an array of OR gates
either or both of which can be programmed. There are different types of PLDs, they
are
classified according to their architecture which allows either both the arrays to
be programmed
or only one of the two arrays.
1. Programmable Read-Only Memory (PROM)
The PROM consists of a fixed non-programmable AND array configured as
a decoder
and a programmable OR array. Figure 19.5. The PROM is used as
a storage device which
stores information at addressable locations. It has limited applications and is not u
sed as a
logic device. PROM architecture and details are discussed in latter lectures.
2. Programmable Logic Array (PLA)
The PLA consists of a programmable AND array and a programmable OR array.
10
11
12
13
The rotary switch, also called a wafer switch as each layer of the switch is
known as a wafer, is a mechanical device whose input is selected by rotating a
shaft. In other words, the rotary switch is a manual switch that you can use to
select individual data or signal lines simply by turning its inputs ON or OFF. So
how can we select each data input automatically using a digital device.
14
The input A of this simple 2-1 line multiplexer circuit constructed from
standard NAND gates acts to control which input ( I0 or I1 ) gets passed to the
output at Q.
15
From the truth table we can see that when data select input, A is LOW (logic
0), input I1 passes its data to the output while input I0 is blocked. When data
select A is HIGH (logic 1), input I0 is passed to Q while input I0 is blocked.
So by the application of either a logic 0 or a logic 1 at A we can select the
appropriate input with the circuit acting a bit like a single pole double throw
(SPDT) switch. Then in this simple example, the 2-input multiplexer connects one
of two 1-bit sources to a common output, producing a 2-to-1-line multiplexer and
we can confirm this in the following Boolean expression.
Q = A.I0.I1 + A.I0.I1 + A.I0.I1 + A.I0.I1
and for our 2-input multiplexer circuit above, this can be simplified too:
Q = A.I1 + A.I0
We can increase the number of data inputs to be selected further simply by
following the same procedure and larger multiplexer circuits can be implemented
using smaller 2-to-1 multiplexers as their basic building blocks. So for a 4-input
multiplexer we would therefore require two data select lines as 4-inputs
represents 22 data control lines give a circuit with four inputs, I0, I1, I2, I3 and two
data select lines A and B as shown.
4-to-1 Channel Multiplexer
16
17
Adding more control address lines will allow the multiplexer to control more
inputs but each control line configuration will connect only ONE input to the
output.
Then the implementation of the Boolean expression above using individual
logic gates would require the use of seven individual gates consisting
of AND, OR and NOT gates as shown.
4 Channel Multiplexer using Logic Gates
20
Multiplexing Basics
Multiplexing basically involves taking multiple signals and combining them into
one signal for transmission over a single medium, such as a telephone line. The
input signals can be either analog or digital. The purpose of multiplexing is to
enable signals to be transmitted more efficiently over a given communication
channel, thereby decreasing transmission costs.
A device called a multiplexer (often shortened to "mux") combines the input signals
into one signal. When the multiplexed signal needs to be separated into its
component signals (for example, when your email is to be delivered to its
destination), a device called ademultiplexer (or "demux") is used.
Multiplexing was originally developed in the 1800s for telegraphy. Today,
multiplexing is widely used in many telecommunications applications, including
telephony, Internet communications, digital broadcasting and wireless telephony.
22
In code division multiplexing (CDM), signals from multiple senders are transmitted
in an assigned frequency band. CDM uses a principle known as spread spectrum,
in which transmitted signals are spread out over all frequency channels in the
assigned band.
In simplest terms, each signal in a CDM system is multiplexed by means of a
spreading code assigned to the sender. This spreading code modulation increases
the bandwidth required for the signal. The receiver is aware of the spreading code
and uses it to demultiplex the signal.
Although it increases the bandwidth needed for transmission, CDM has the
advantage of being more secure than other types of multiplexing. In CDM
transmissions, an individual users signal is mixed in with the signals of other
users in the frequency band. Without the spreading code required for
demultiplexing an individual signal, CDM transmissions appear merely to be noise
to a receiving device.
23
Digital comparators actually use Exclusive-NOR gates within their design for
comparing their respective pairs of bits. When we are comparing two binary or
BCD values or variables against each other, we are comparing the magnitude of
these values, a logic 0 against a logic 1 which is where the term Magnitude
Comparator comes from.
As well as comparing individual bits, we can design larger bit comparators by
cascading together nof these and produce a n-bit comparator just as we did for
the n-bit adder in the previous tutorial. Multi-bit comparators can be constructed
to compare whole binary or BCD words to produce an output if one word is larger,
equal to or less than the other.
A very good example of this is the 4-bit Magnitude Comparator. Here, two 4-bit
words (nibbles) are compared to each other to produce the relevant output with
one word connected to inputs Aand the other to be compared against connected to
input B as shown below.
4-bit Magnitude Comparator
24
25
LOGIC DIAGRAM
26
27
28
to the adder is C0, and it ripples through the full adders to the output carry C4.
The S outputs generate the required sum bits. An n-bit adder requires n full
adders, with each output carry connected to the input carry of the next higher
order full adder. CS1026 16 Carry Propagation The addition of two binary numbers
in parallel implies that all the bits of the augend and addend are available for
computation at the same time. As in any combinational circuit, the signal must
propagate through the gates before the correct output sum is available in the
output terminals. The total propagation time is equal to the propagation delay of a
typical gate, times the number of gate levels in the circuit. The longest propagation
delay time in an adder is the time it takes the carry to propagate through the full
adders. CS1026 17 Inverter Delay CS1026 18 Full adder with P and G shown The
signals at Pi and Gi settle to their steady-state values after they propagate through
their respective gates. These two signals are common to all half adders and depend
on only the input augend and addend bits. The signal from the input carry Ci to
the output carry Ci + 1 propagates through an AND gate and an OR gate, which
constitute two gate levels. If there are four full adders in the adder, the output
carry C4 would have 2 * 4 = 8 gate levels from C0 to C4. For an n-bit adder, there
are 2n gate levels for the carry to propagate from input to output. CS1026 19 Gi is
called a carry generate, and it produces a carry of 1 when both Ai and Bi are 1,
regardless of the input carry Ci. Pi is called a carry propagate, because it
determines whether a carry into stage i will propagate into stage i + 1 i.e., whether
an assertion of Ci will propagate to an assertion of Ci + 1 CS1026 20 Carry
lookahead logic CS1026 21 Since the Boolean function for each output carry is
expressed in sum-of-products form, each function can be implemented with one
level of AND gates followed by an OR gate. The three Boolean functions for C1, C2,
and C3 are implemented in the carry lookahead generator. Note that this circuit
can add in less time because C3 does not have to wait for C2 and C1 to propagate;
in fact, C3 is propagated at the same time as C1 and C2. This gain in speed of
operation is achieved at the expense of additional complexity (hardware). CS1026
22 Logic diagram of carry lookahead generator CS1026 23 Four-bit adder with
carry lookahead CS1026 24 74283 4-bit binary Full Adder Connection Diagram
CS1026 25 74283 4-bit binary Full Adder Logic Diagram CS1026 26 Binary
Subtractor Remember that the subtraction A - B can be done by taking the 2s
complement of B and adding it to A. The 2s complement can be obtained by taking
the 1s complement and adding 1 to the least significant pair of bits. The 1s
complement can be implemented with inverters, and a 1 can be added to the sum
through the input carry. CS1026 27 Four-bit addersubtractor (with overflow
detection) CS1026 28 The circuit for subtracting A - B consists of an adder with
inverters placed between each data input B and the corresponding input of the full
adder. The input carry C0 must be equal to 1 when subtraction is performed. The
30
Operation
Note
Unsigned
addition
calculation
Operation
Signed
addition
A3
A2
A1
A0
B3
B2
B1
B0
S3
S2
S1
S0
Note
calculation
A3
A2
A1
A0
B3
B2
B1
B0
31
Operation
Subtraction
without
overflow
(V=0)
S3
Ignore C & V
S2
Note
Operation
S0
calculation
S1
Ignore C
A3
A2
A1
A0
B3
B2
B1
B0
S3
S2
S1
S0
Note
calculation
Subtraction
The minuend A, the subtrahend
with
B, and the difference S are all
overflow
2s complements.
(V=1)
A3
A2
A1
A0
B3
B2
B1
B0
S3
S2
S1
S0
2s Complement Table
Binary
2s complement
Binary
2s complement
01111
+15
10000
-16
01110
+14
10001
-15
32
01101
+13
10010
-14
01100
+12
10011
-13
01011
+11
10100
-12
01010
+10
10101
-11
01001
+9
10110
-10
01000
+8
10111
-9
00111
+7
11000
-8
00110
+6
11001
-7
00101
+5
11010
-6
00100
+4
11011
-5
00011
+3
11100
-4
00010
+2
11101
-3
00001
+1
11110
-2
00000
+0
11111
-1
Half Adder
33
Simplifying boolean equations or making some Karnaugh map will produce the
same circuit shown below, but start by looking at the results. The column is our
familiar XOR gate, while the Cout column is the AND gate. This device is called a
half-adder for reasons that will make sense in the next section.
or in ladder logic
Full Adder
34
The half-adder is extremely useful until you want to add more that one binary digit
quantities. The slow way to develop a two binary digit adders would be to make a
truth table and reduce it. Then when you decide to make a three binary digit
adder, do it again. Then when you decide to make a four digit adder, do it again.
Then when ... The circuits would be fast, but development time would be slow.
Looking at a two binary digit sum shows what we need to extend addition to
multiple binary digits.
11
11
11
--110
Look at how many inputs the middle column uses. Our adder needs three inputs;
a, b, and the carry from the previous sum, and we can use our two-input adder to
build a three input adder.
is the easy part. Normal arithmetic tells us that if = a + b + Cin and 1 = a + b,
then = 1 + Cin.
35
What do we do with C1 and C2? Let's look at three input sums and quickly
calculate:
Cin + a + b = ?
0+0+0=0
0+0+1= 1
0+1+0= 1
1+0+0=1
1 + 0 + 1 = 10
1 + 1 + 0 = 10
0 + 1 + 1 = 10
1 + 1 + 1 = 11
If you have any concern about the low order bit, please confirm that the circuit and
ladder calculate it correctly.
In order to calculate the high order bit, notice that it is 1 in both cases when a + b
produces a C1. Also, the high order bit is 1 when a + b produces a 1 and Cin is a 1.
So We will have a carry when C1 OR (1 AND Cin). Our complete three input adder
is:
36
For some designs, being able to eliminate one or more types of gates can be
important, and you can replace the final OR gate with an XOR gate without
changing the results.
We can now connect two adders to add 2 bit quantities.
37
A0 is the low order bit of A, A1 is the high order bit of A, B0 is the low order bit of B,
B1 is the high order bit of B, 0is the low order bit of the sum, 1 is the high order
bit of the sum, and Cout is the Carry.
38
A two binary digit adder would never be made this way. Instead the lowest order
bits would also go through a full adder.
There are several reasons for this, one being that we can then allow a circuit to
determine whether the lowest order carry should be included in the sum. This
allows for the chaining of even larger sums. Consider two different ways to look at
a four bit sum.
111
1<-+ 11<+-
0110
| 01 | 10
1011
| 10 | 11
----10001
If we allow the program to add a two bit number and remember the carry for later,
then use that carry in the next sum the program can add any number of bits the
user wants even though we have only provided a two-bit adder. Small PLCs can
also be chained together for larger numbers.
These full adders can also can be expanded to any number of bits space allows. As
an example, here's how to do an 8 bit adder.
39
This is the same result as using the two 2-bit adders to make a 4-bit adder and
then using two 4-bit adders to make an 8-bit adder or re-duplicating ladder logic
and updating the numbers.
Each "2+" is a 2-bit adder and made of two full adders. Each "4+" is a 4-bit adder
and made of two 2-bit adders. And the result of two 4-bit adders is the same 8-bit
adder we used full adders to build.
For any large combinational circuit there are generally two approaches to design:
you can take simpler circuits and replicate them; or you can design the complex
circuit as a complete device.
Using simpler circuits to build complex circuits allows a you to spend less time
designing but then requires more time for signals to propagate through the
transistors. The 8-bit adder design above has to wait for all the Cxout signals to
move from A0 + B0 up to the inputs of 7.
If a designer builds an 8-bit adder as a complete device simplified to a sum of
products, then each signal just travels through one NOT gate, one AND gate and
one OR gate. A seventeen input device has a truth table with 131,072 entries, and
reducing 131,072 entries to a sum of products will take some time.
40
When designing for systems that have a maximum allowed response time to
provide the final result, you can begin by using simpler circuits and then attempt
to replace portions of the circuit that are too slow. That way you spend most of
your time on the portions of a circuit that matter.
Half subtractor
The half-subtractor is a combinational circuit which is used to perform subtraction
of two bits. It has two inputs, X (minuend) and Y (subtrahend) and two outputs D
(difference) and B (borrow).
Full subtractor
As in the case of the addition using logic gates, a full subtractor is made
by combining two half-subtractors and an additional OR-gate. A full subtractor has
the borrow in capability (denoted as BORIN in the diagram below) and so
allows cascading which results in the possibility of multi-bit subtraction. The
circuit diagram for a full subtractor is given below.
41
42