4 to 1 Multiplexer VHDL code

4 to 1 Multiplexer VHDL code can be written in many ways. Here we show how to write 4 to 1 multiplexer VHDL code using when..else statement and with..select statement. Both of these forms are called behavioral models because the multiplexer function is described as we know it.

A multiplexer is used to switch one of many inputs to a single output. Multiplexers are combinational components in digital system terminology(see Combinational vs Sequential digital VHDL circuits). Typically multiplexers are used to allow large, complex pieces of hardware to be reused. For example, in microcontrollers, a single pin can function as ordinary I/O pin, USART TX pin or USB pin etc. The IEEE symbol for a 4 to 1 multiplexer is shown below. The G is a select symbol and the meaning of 0/3 is not fraction, but means 0–3. Therefore the binary value on the top two inputs is used to select one of the inputs 0–3.

IEEE 4 to 1 multiplexer symbol

The following are two ways of writing 4 to 1 multiplexer VHDL code.

4 to 1 Multiplexer VHDL code using when..else

The following is the simulated waveform using VHDL software.

4 to 1 mux vhdl code simulation

4 to 1 Multiplexer VHDL code using with..select

The simulated waveform using Active-HDL VHDL software is shown below.

4 to 1 multiplexer vhdl code simulation

As such multiplexers like most of the digital components can be implemented using when…. else and with select VHDL statements. For example see VHDL code for 2 to 4 decoder where when.. else statement is used and 2 to 4 Decoder VHDL code where with..select is used. See also What is Entity and Architecture in VHDL.

What do you think?

0 points
Upvote Downvote

Total votes: 0

Upvotes: 0

Upvotes percentage: 0.000000%

Downvotes: 0

Downvotes percentage: 0.000000%

Leave a Reply

Your email address will not be published. Required fields are marked *

2 to 4 Decoder VHDL code

2 to 4 Decoder VHDL code

Seven Segment Decoder VHDL code