Designing a Quad-Two Input MUX (74HC151 Multiplexer)

by anthonyorloff in Circuits > Electronics

791 Views, 2 Favorites, 0 Comments

Designing a Quad-Two Input MUX (74HC151 Multiplexer)

HC151.png

The purpose of this Instructables is to become familiar with the working of multiplexers while constructing one using the Quartus II software specifically the 74HC151 chip from Texas Instruments.

Description of a Multiplexer

In the simplest way, a multiplexer selects one of several input signals and passes it on to the output. A digital multiplexer (also commonly called a data selector) is a logic circuit that takes several digital data inputs and selects one of them at any given time to pass on to the output. This desired data input to the output is controlled by SELECT inputs (also commonly called address inputs) which determines which input is transmitted to the output.

Creating a Project Using Quartus II

Quartus_S1.PNG
Quartus_S2.PNG
Quartus_S3.PNG
Quartus_S4.PNG
  1. First to start, open up the Quartus II Software and click "Create a New Project"
  2. From there you will be prompted to choose you desired working directory and name of the project, in this case I simply named my project MUX and left the Top Level Design the same
  3. Next you will be prompted to choose the "Family and Device Settings" which is not important for this specific tutorial since we will only be simulating the project instead of uploading it to a development board, but to insure your simulation works properly you can follow the same specifications of the Cyclone V (DE0 board) given above
  4. After you are done creating a new project with the project wizard, locate the "Project Navigator" on the left hand side of the screen and next to Flow: choose 'Full Design' and select 'Create New Design File'. This will open a window with the different files able to be made using Quartus but for this specific project we will be using AHDL to program the multiplexer

Project Code

MUXcode.PNG

In this project we are using ADHL (Altera Hardware Description Language) which is a high-level, modular language made by Altera for the Quartus II software (although any text editor can be used as well).

About the code

The code is quite simple and split up between two major blocks being the SUBDESIGN and the BEGIN and END statements. The SUBDESIGN section declares the input, output, and bidirectional ports of the Text Design File (.tdf), in this case declaring the input channels and output data channels along with enable and select inputs. Within the BEGIN and END statements is where the workings of the multiplexer occurs seeing that without the enable (active-low) being activated that the code within the case statement will not run which selects which channel will be connected to the data out.

Side Note*

Often times you will find the input channels to be connected to the same input as the select channels especially with wiring but in this case is not necessary.

Compiling the Project

MUXcompile.PNG

Now that the code needed for the 74HC151 multiplexer is done, we need to verify that there are no bugs within the code and compile it so that we can test it in a simulator. To do so, using the 'Project Navigator' find the "Compile Design" section and double click 'Analysis and Synthesis' to check for any errors in our project (if you are trying to upload the project to a development board you will need to compile the whole design but to save some time, it is only needed to run the 'Analysis and Synthesis' to use the simulator).

Setting Up the Simulator

MUXwave1.PNG
MUXsim1.PNG
MUXsim2.PNG
MUXsim3.PNG
MUXsim4.PNG
  1. To use a Simulator for this project in Quartus, a new 'University Program VWF' file is needed to be made using the "Project Manager" and clicking "Create New Design File".
  2. From there a 'Simulation Waveform Editor" will open up where we will need to import our inputs and outputs used in the project.
  3. To import the inputs and outputs, navigate to the edit tab on the top of the screen and click on 'Insert' and 'Insert Node or Bus..."
  4. This will open a new window were you will open up the 'Node Finder' and click 'List' to display all used nodes
  5. Lastly move all 'Nodes Found' to the right side table (or click '>>' for Quartus to do it for you and you are ready to begin modifying each input to verify the working of the 74HC151 multiplexer

Simulation

SIMFR.PNG
  • Once each nodes have been imported to the screen, we can change the values of the exported inputs to lows or highs as needed by highlighting the wanted time sections and selecting from the top bar menu.
  • From the output of the simulation (to run the simulation click 'Simulation' then 'Run Functional Simulation') it can be seen that the multiplexer works as expected where when the enable is turned on (in this case when it is low) and the select matches the given channel that the output data line will be turned on, hence connected to the allocated channel.
    • Notice that when the enable is high that the data is at a low (meaning turned off or 0).

74HC151 Logic Diagram and Data Sheets

74h151.PNG

Downloads