PROJECT 11 – MULTIPLEXER
THEORY
Multiplexers
A multiplexer is a device which allows one of a number of inputs to be
routed to a single output. Here is a 4-1 multiplexer.
The control inputs c0 and c1 represent a 2-bit binary
number, which determines which of the inputs (i0, i1, i2
or i3) is connected to the output d.
If c1c0 represents the number n in binary, then the value
of the output d is the value of input in.
Multiplexers are useful in many situations. For example, in a CPU, data being
written to memory might come from one of a number of sources - from a register,
from the result of a calculation, etc - so a
multiplexer would be used to select data from the appropriate source.
Another application is where we want to be able to choose one of several
operations to carry out on some data - all the operations can be calculated in
their separate circuit section, and a multiplexer can be used to select the
desired result.
Implementing Multiplexers
The implementation of a multiplexer is straightforward, and uses a
decoder. Here is a 4-1 multiplexer.
Remember that all the outputs of the decoder are 0, apart from one. The inputs
c1c0 determine which of the outputs is non-zero.
All but one of the AND gates have 0 on one input and therefore output 0. The remaining
AND gate has 1 on one input and in (where n is represented in binary
by c1c0) on the other input. The output of this AND gate
is the value of in.
The OR gate has 0 on all of its inputs apart from one, and has the value of in
on the remaining input. The output of the OR gate is therefore the value of in.
Larger multiplexers can be implemented in the same way.
Multibit Multiplexers
The basic 2n-1 multiplexer is a switch, allowing one of 2n
inputs to be connected to the output. Each input consists of a single bit.
It is often necessary to consider a group of wires as a single signal. For
example, in a 32-bit microprocessor, all data is handled in blocks of 32 bits,
which means that 32 wires are needed to carry a value from one part of the
circuit to another.
A collection of wires which form a single signal is called a bus. In circuit diagrams, a bus
is represented by a single line with a short diagonal line across it, labelled
to indicate the width (number of wires) of the bus.
It is often necessary to use multiplexers to switch whole buses. In diagrams,
we simply draw a multiplexer as usual, with buses of specified width as inputs
and output.
This example shows a 4-1 multiplexer on a 32 bit bus. Note that the control
inputs are still individual wires. A 32 bit multiplexer can be implemented with
32 basic multiplexers, all sharing the same control inputs.
Demultiplexers
A demultiplexer is the opposite of a multiplexer.
There is one data input, whose value appears on one of the data outputs,
depending on the value of the control inputs. Here is a 1-4 demultiplexer.
If the control inputs c1c0 represent the number n in
binary, then the value of i is copied to output dn.
Depending on the details of the electronic implementation, the other outputs
might be 0, or might be in a disconnected state.
It is straightforward to implement a demultiplexer;
the circuit uses a decoder in a similar way to the implementation of a
multiplexer.
Source
http://www.dcs.gla.ac.uk/~simon/teaching/CS1Q-students/systems/online/sec7.html
PROJECT
EXPECTATIONS
Create a 4-1 multiplexer or a 1-4 demultiplexer.
Remember that a 4-1 multiplexer has the 4 data inputs as well as the 2
control inputs (6 inputs in all) and one output.
A 1-4 demultiplexer has 1 data input and 2
control inputs (3 inputs in all) and has 4 outputs.