The Wayback Machine - https://web.archive.org/web/20240914112833/https://www.geeksforgeeks.org/implementing-321-multiplexer-using-81-multiplexers/
Open In App

Implementing 32:1 Multiplexer using 8:1 Multiplexers

Last Updated : 15 Jun, 2022
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

A multiplexer is a digital combinational circuit that selects one out of several input lines and directs it to a single output line, hence often alternatively called a data selector. The selection of a particular input line out of several choices takes place on the basis of the selector lines. A multiplexer, in general, has n input lines, log2n selector lines, 1 enable line, and 1 output line and is commonly called an n:1 Multiplexer. 

An interesting problem in digital electronics is to make a p:1 multiplexer using only a q:1 multiplexer. The general methodology to tackle such problems is to divide n by m until we get 1 and find the number of stages and the number of multiplexers required.

p/q = k1            Stage 1
k1/q = k2           Stage 2
k2/q = k3           Stage 3
   :                   :
kn-1/q = kn = 1      Stage n

We have n stages, and the ith stage has ki = p/qi number of multiplexers. 

This works only when p is the n-th power of q. That is p = qn. So, log2p = nlog2q. 

Hence the number of selector lines in the p:1 multiplexer must be an integral multiple of the number of selector lines in the q:1 multiplexer. The integer n is basically the number of stages.

Total number of multiplexers = k1+k2+…+kn-1+1 = p/q + p/q2+…+p/qn-1+p/qn 

We immediately see it’s a geometric series. Hence. 

Total number of multiplexers = (p-1)/(q-1) = (qn -1)/(q-1) .

Here’s an example of implementing 8:1 Multiplexer using 2:1 Multiplexers.

8:1 MUX using 2:1 MUX

8:1 MUX using 2:1 MUX

However, if p is not an n-th power of q, then we cannot follow this simple implementation procedure. In such cases, we have to use the enable input. In general, we will have log2q selector lines and the rest r selector lines will be provided through the enabling, where r=log2p – log2q.

A 32:1 Multiplexer has 32 input lines and log2 32 = 5 selector lines. 

A 8:1 Multiplexer has 8 input lines and log2 8 = 3 selector lines. 

32/8 = 4, so four 8:1 Multiplexers are needed, but they have insufficient selector lines. So, we need to put 2 extra selector lines. In order to accommodate the 2 other selector lines, we need to use the enable (E) input of the multiplexers. 

Truth Table of 32:1 Multiplexer:

S4 S3 S2    S1   S0 Output
0 0

0      0      0

:        :       :

1      1      1

I0

:

I7

0 1

0      0      0

:        :       :

1      1      1

I8

:

I15

1 0

0      0      0

:        :       :

1      1      1

I16

:

I23

1 1

0      0      0

:        :       :

1      1      1

I24

:

I31

I signify the input line.

Truth Table of 8:1 Multiplexer:

S2 S1 S0 Output
0 0 0 I0
0 0 1 I1
0 1 0 I2
0 1 1 I3
1 0 0 I4
1 0 1 I5
1 1 0 I6
1 1 1 I7

I signify input line.

Implementation:

From the truth table, we can see that the truth table of the 32:1 Multiplexer is similar to the 8:1 Multiplexer for each combination of S4 and S3. So, if we enable only one out of the four 8:1 Multiplexers at a time using the enable E, then the 32:1 Multiplexer can be realized easily. 

SOP expression of the 32:1 Multiplexer is:

O = S4’S3’D0 + S4’S3D1 + S4S3’D2 + S4S3D3

Where each D is the output for each 8:1 multiplexer. 

D0 = S2'S1'S0'I0 + S2'S1'S0I1 + S2'S1S0'I2 + S2'S1S0I3 + S2S1'S0'I4 + S2S1'S0I5 + S2S1S0'I6 + S2S1S0I7
D1 = S2'S1'S0'I8 + S2'S1'S0I9 + S2'S1S0'I10 + S2'S1S0I11 + S2S1'S0'I12 + S2S1'S0I13 + S2S1S0'I14 + S2S1S0I15
D2 = S2'S1'S0'I16 + S2'S1'S0I17 + S2'S1S0'I18 + S2'S1S0I19 + S2S1'S0'I20 + S2S1'S0I21 + S2S1S0'I22 + S2S1S0I23
D3 = S2'S1'S0'I24 + S2'S1'S0I25 + S2'S1S0'I26 + S2'S1S0I27 + S2S1'S0'I28 + S2S1'S0I29 + S2S1S0'I30 + S2S1S0I31

The implementation is shown below. 

32:1 Multiplexer using 8:1 Multiplexer



Similar Reads

Multiplexers in Digital Logic
In this article we will go through the multiplexer, we will first define what is a multiplexer then we will go through its types which are 2x1 and 4x1, then we will go through the Implementation of the 2x1 mux and higher mux with lower order mux, At last we will conclude our article with some applications, advantages and some FAQs. Table of Content
10 min read
Implementation of SOP function using multiplexer
Given a SOP function and a multiplexer is also given. We will need to implement the given SOP function using the given MUX. There are certain steps involved in it: Step 1: Draw the truth table for the given number of variable function. Step 2: Consider one variable as input and remaining variables as select lines. Step 3: Form a matrix where input
1 min read
1 Bit Full Adder using Multiplexer
Prerequisite : Multiplexer, Full adder Introduction : Multiplexer and Full adder are two different Digital Logic circuits. The Multiplexer is a digital switch. It allows digital information from several sources to be routed onto a single output line. On the other hand, the Full adder circuit performs the addition of three bits and produces the Sum
3 min read
Multiplexer Design using Verilog HDL
In this article, we are discussing Multiplexer Design. Below mentioned is the article in which we are going to discuss the problem. Design of a 2:1 MUX using Verilog Hardware Description Language along with Testbench. ConceptsA multiplexer is a combinational type of digital circuit that is used to transfer one of the available input lines to a sing
2 min read
Solving multiplexer circuit
The procedure for solving and finding the output function of the given multiplexer is quite simple. Firstly we will discuss the procedure and then illustrate it with examples. Procedure: Firstly truth table is constructed for the given multiplexer. Select lines in multiplexer are considered as input for the truth table. Output in truth table can be
2 min read
Python program to implement 2:4 Multiplexer
Prerequisite : Multiplexers in Digital Logic Introduction : It is a combinational circuit which have many data inputs and single output depending on control or select inputs.​ For N input lines, log n (base2) selection lines, or we can say that for 2n input lines, n selection lines are required. Multiplexers are also known as “Data n selector, para
3 min read
Difference between Multiplexer and Demultiplexer
In this article, we will go through the Difference between Multiplexer and Demultiplexer, First we will start our article with the definition of the multiplexer and demultiplexer in brief with their block diagram, and then we will go through the differences between Multiplexer and Demultiplexer in detail, At last we will conclude our article with s
3 min read
Difference between Multiplexer and Decoder
Both the multiplexer and the decoder operate together to generate signal and data output for various communication and operating channels. Though multiplexers and decoders perform almost identical functions, they differ for a variety of reasons. Before moving into the difference between Multiplexer and Decoder, let's first understand more about the
3 min read
Implementing Any Circuit Using NAND Gate Only
A universal gate is such a gate that we can implement any Boolean function, no matter how complex, using a circuit that consists of only that particular universal gate. The NAND & NOR gates are the most commonly encountered universal gates in digital logic. In this article, we will take a look at how to convert any circuit into a circuit that c
8 min read
Implementing Non-contiguous Memory Management Techniques
Memory Management Techniques are basic techniques that are used in managing the memory in operating system. Memory Management Techniques are basically classified into two categories: (i) Contiguous (ii) Non-contiguous We have already discussed the implementation of contiguous in the article Implementation of Contiguous Memory Management Techniques.
3 min read
Implementing DFA for no runs of length less than 4 for input (a,b)
DFA or Deterministic Finite Automata is a finite state machine, in which on every input alphabet a transition is done from one state to another state according to set of defined rules as per the need of string acceptance.In this particular problem, runs of length is the factor to think about.The input alphabets are {a, b}. No runs of length less th
15 min read
Multiple Linear Regression using R
Prerequisite: Simple Linear-Regression using RLinear Regression: It is the basic and commonly used type for predictive analysis. It is a statistical approach for modeling the relationship between a dependent variable and a given set of independent variables.These are of two types: Simple linear RegressionMultiple Linear Regression Let's Discuss Mul
3 min read
Softmax Regression using TensorFlow
This article discusses the basics of Softmax Regression and its implementation in Python using the TensorFlow library. Softmax regression Softmax regression (or multinomial logistic regression) is a generalization of logistic regression to the case where we want to handle multiple classes in the target column. In binary logistic regression, the lab
6 min read
Automation of Invoice Processing using RPA
In this article, we will learn how to make a simple project on Automation of Invoice Processing using RPA in UiPath Studio. This is a simple application of Robotic Process Automation in which invoices get downloaded in pdf formats from the desired email address, then from those invoices, specific information like email, name, due date, and balance
9 min read
Analysis of test data using K-Means Clustering in Python
This article demonstrates an illustration of K-means clustering on a sample random data using open-cv library. Pre-requisites: Numpy, OpenCV, matplot-lib Let's first visualize test data with Multiple Features using matplot-lib tool. # importing required tools import numpy as np from matplotlib import pyplot as plt # creating two test data X = np.ra
2 min read
Reader-Writers solution using Monitors
Prerequisite - Process Synchronization, Monitors, Readers-Writers Problem Considering a shared Database our objectives are: Readers can access database only when there are no writers.Writers can access database only when there are no readers or writers.Only one thread can manipulate the state variables at a time. What is the Reader-Writers problem?
4 min read
Lowest Common Ancestor in a Binary Tree | Set 3 (Using RMQ)
Given a rooted tree, and two nodes are in the tree, find the Lowest common ancestor of both the nodes. The LCA for two nodes u and v is defined as the farthest node from the root that is the ancestor to both u and v. Prerequisites: LCA | SET 1 Example for the above figure : Input : 4 5 Output : 2 Input : 4 7 Output : 1 Converting LCA to RMQ(Range M
15+ min read
Linear Regression using PyTorch
Linear Regression is a very commonly used statistical method that allows us to determine and study the relationship between two continuous variables. The various properties of linear regression and its Python implementation have been covered in this article previously. Now, we shall find out how to implement this in PyTorch, a very popular deep lea
4 min read
Google Cloud Platform - Using the Kubernetes API
In this article, we will look at the Kubernetes API and how it makes modeling the application lifecycle easier. Let's go over the concepts that make Kubernetes usable, scalable, and just downright awesome. When it comes to what scalable applications need, we've talked about containers and nodes, but that's just the tip of the iceberg. There's plent
4 min read
Draw a rectangular shape and extract objects using Python's OpenCV
OpenCV is an open-source computer vision and machine learning software library. Various image processing operations such as manipulating images and applying tons of filters can be done with the help of it. It is broadly used in Object detection, Face Detection, and other Image processing tasks. Let's see how to draw rectangular shape on image and e
4 min read
Classifying data using Support Vector Machines(SVMs) in R
In machine learning, Support vector machines (SVM) are supervised learning models with associated learning algorithms that analyze data used for classification and regression analysis. It is mostly used in classification problems. In this algorithm, each data item is plotted as a point in n-dimensional space (where n is a number of features), with
5 min read
MATLAB | Converting a Grayscale Image to Binary Image using Thresholding
Thresholding is the simplest method of image segmentation and the most common way to convert a grayscale image to a binary image.In thresholding, we select a threshold value and then all the gray level value which is below the selected threshold value is classified as 0(black i.e background ) and all the gray level which is equal to or greater than
3 min read
Background Subtraction in an Image using Concept of Running Average
Background subtraction is a technique for separating out foreground elements from the background and is done by generating a foreground mask. This technique is used for detecting dynamically moving objects from static cameras. Background subtraction technique is important for object tracking. There are several techniques for background subtraction
4 min read
How to find top-N records using MapReduce
Finding top 10 or 20 records from a large dataset is the heart of many recommendation systems and it is also an important attribute for data analysis. Here, we will discuss the two methods to find top-N records as follows. Method 1: First, let's find out top-10 most viewed movies to understand the methods and then we will generalize it for 'n' reco
5 min read
Python | Tokenize text using TextBlob
TextBlob module is a Python library and offers a simple API to access its methods and perform basic NLP tasks. It is built on the top of NLTK module. Install TextBlob using the following commands in terminal: pip install -U textblob python -m textblob.download_corpora This will install TextBlob and download the necessary NLTK corpora. The above ins
3 min read
Audio processing using Pydub and Google speechRecognition API
Audio files are a widespread means of transferring information. So, let's see how to break down audio files (.wav files) into smaller chunks, and to recognize the content in them and store it to a text file. To know more about audio files and their formats, refer Audio_formats. Need to break down an audio file? When we do any processing on audio fi
6 min read
LSB based Image steganography using MATLAB
Prerequisite: Image Steganography Introduction, Implementation using Python.Steganography is the method of hiding secret data inside any form of digital media. The main idea behind steganography is to hide the existence of data in any medium like audio, video, image, etc. When we talk about image steganography, the idea is quite simple. Images are
4 min read
Finding Network ID of a Subnet (using Subnet Mask)
In order to find network id (NID) of a Subnet, one must be fully acquainted with the Subnet mask. Subnet Mask: It is used to find which IP address belongs to which Subnet. It is a 32 bit number, containing 0's and 1's. Here network id part and Subnet ID part is represented by all 1's and host ID part is represented by all 0's. Example: If Network i
2 min read
Text extraction from image using LSB based steganography
Prerequisite: LSB based Image steganography using MATLABIn LSB based Image steganography using MATLAB, we saw how to hide text inside an image. In this article, we are going to see given the stego image or the pixel values and the length of the text embedded as input, how to extract the text from it. Extraction Process: The extraction process is si
3 min read
Draw Seychelles Flag using MATLAB
A colored image can be represented as a 3 order matrix. The first order is for the rows, the second order is for the columns and the third order is for specifying the color of the corresponding pixel. Here we use the RGB color format, so the third order will take 3 values of Red, Green and Blue respectively. The values of the rows and columns depen
4 min read