Computer Programming
Software Engineering
Very Large Scale Integration (VLSI)

What is VHDL code for 8 1 multiplexer using 2 1 multiplexer?

123

Top Answer
User Avatar
Wiki User
Answered
2014-06-10 20:50:33
2014-06-10 20:50:33

Personally describing VHDL code for multiplexer can be quite difficult without prior knowledge. It takes many VHDLs to be a multiplexer.

001
๐ŸŽƒ
0
๐Ÿคจ
0
๐Ÿ˜ฎ
0
๐Ÿ˜‚
0
User Avatar

Related Questions


A VHDL program for 64 to 1 multiplexer using four 4 to 1 multiplexers is not possible, as four 4 to 1 multiplexers provide only 16 inputs, only 1/4 of what is needed.


VHDL is a hardware description language. You can describe the hardware in three different ways using VHDL. 1. dataflow model 2. behavioral model 3. structural model


Use the multiplexer to choose the correct output based on the inputs (use the truth table).


Theoretically you use five 4-to-1 multiplexers. You use four of them to connect the 16 inputs. You then have four outputs. Take the fifth multiplexer and connect the four outputs as the inputs. The fifth multiplexer then has a single output that has multiplexed the original 16 inputs.


After compiling a hardware description language like VHDL, it is required to apply inputs to the program in order to obtain out puts. Applying the inputs involves initial conditions. As the systems designed using VHDL are electronic, the initial conditions plays a vital role. Hence, all these conditions along with the information as to where the input is expected to change from 1 to 0 or 0 to 1 is provided to the VHDL program. This is done in the form of a wave or another VHDL program. These are called VHDL test benches. In other words, test benches are the means of applying inputs to VHDL program.


In the "architecture" of VHDL, after "begin" statement, if you want, you can apply the inputs. For example, a<='0'; b<='1'; etc. But, if you want the inputs to change periodically, then you should at least apply one "enable" or "clock" pulse.


It is the enable line. Used to enable the multiplexer to function. For low enable multiplexers, strobe is set to 0 to enable the multiplexer whereas in high enable multiplexers, it is set 1 to enable the multiplexer.


You don't need two 4-to-1 multiplexers. You only need one 4-to-1 multiplexer, and something that functions as a 2-to-1, like a single 2-input OR gate with one input grounded.


Below code can implement NOT gate in VHDL. The code is written in behavioral model. Library ieee; use ieee.std_logic_1164.all; Entity gates is port (a: in std_logic; c : out std_logic); end gates ; architecture and1 of gates is begin process(a) Begin If a=1 then C<='0'; Else C<= '1'; End if; End process; End and1;


%Below code can implement AND gate in VHDL.%The code is written in behavioral model.Library ieee;use ieee.std_logic_1164.all;Entity gates isport (a,b: in std_logic;c : out std_logic);end gates ;Architecture behavioural of gates isbeginprocess(a,b)beginIf (a='1' and b='1') thencelsec'0';end if;end process;end behavioural;


Below code can implement OR gate in VHDL. The code is written in behavioral model. Library ieee; use ieee.std_logic_1164.all; Entity gates is port (a,b : in std_logic; c : out std_logic); end gates ; architecture and1 of gates is begin process(a,b) Begin If (a=1 or b=1) then C<='1'; Else C<= '0'; End if; End process; End and1;


20 address line available in 16 to 1 multiplexer 16 for input lines and 4 will be selection lines.


Below code can implement NAND gate in VHDL. The code is written in behavioral model. Library ieee; use ieee.std_logic_1164.all; Entity gates is port (a,b : in std_logic; c : out std_logic); end gates ; architecture and1 of gates is begin process(a,b) Begin If (a=1 and b=1) then C<='0'; Else C<= '1'; End if; End process; End and1;


Since a fulladder can be obtained by using 2 halfadders & 1 OR gate.....so we have to call an halfadder program as well as an OR program......this can be implemented easily with the help of structural model rather than dataflow and behavoioural model


%Below code can implement XOR gate in VHDL.%The code is written in behavioral model.Library ieee;use ieee.std_logic_1164.all;Entity gates isport (a,b : in std_logic; c : out std_logic);end gates ;architecture behavioural of gates isbeginprocess(a,b)beginIf (a='1' and b='0') thencelsif (a='0' and b='1') thencelsecend if;end process;end behavioural;


library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;entity mux2x1 isPort ( i : in STD_LOGIC_VECTOR (1 downto 0);s : in STD_LOGIC;y : out STD_LOGIC);end mux2x1;architecture df of mux2x1 isbeginwith s selectyi(1) when '1','0' when others;end df;


Vhdl has got three models - programming styles. 1. data flow model 2. behavioral model 3. structural model.


Yes. Any basic gate's Boolean expression can be implemented using a 2:1 multiplexer and hence any combinational circuit can be implemented using only multiplexers.


f = ~s.a + s.b , thus is the function for a multiplexer. let a not gate with input x and output y. set a = 1 and b =0 to get a not gate. y = ~x.1 + x.0


A multiplexer will have 2n inputs, n selection lines and 1 output. An 8 input multiplexer accepts 8 inputs i. e. 23. We also know that an 8:1 multiplexer needs 3 selection lines. A 4 input multiplexer accepts 4 inputs i. e. 22. We also know that a 4:1 multiplexer needs 2 selection lines. To realize an 8:1 multiplexer, two 4:1 multiplexers are required. They provide 8 inputs (4+4). Join the two selection lines of each MUX. Now we require 8 combinations from selection lines. i. e. 000, 001, 010, 011 ------------- 100, 101, 110,111. We know that 00, 01, 10 11 are common. Only the first bit differs (0 or 1). Hence, apply the third selection line as it is (i. e. 1) to upper 4:1 MUX and apply it complimented (i. e. 0) to lower MUX. Now it acts as 8:1 MUX.


VHDL is a hardware description language which is used to describe digital circuits or systems. The data involved digital systems is logical data i. e. 0 or 1. Hence, VHDL uses logical data as input and provides the same type of data in output.


You can design an 8-to-1 multiplexer using two 4-to-1 multiplexers, and a 2-1 multiplexor.The 8 inputs would be connected to the two 4-1's using two of the selector inputs and the outputs of the two 4-1's would be connected to the 2-1 using the third selector input.If the 4-1's have tri-state ouputs, you can eliminate the 2-1, and use the third selector input, and its complement, to drive the two 4-1's. You will need an inverter in this case. You just need to be careful that the 4-1's do not drive the output at the same time - this could result in large current spikes on GND and VCC, and you don't want that - open collector outputs, as opposed to totem pole outputs, are a wonderful solution to this problem - it all depends on required propagation delay time.


Below code can implement NOR gate in VHDL. The code is written in behavioral model. Library ieee; use ieee.std_logic_1164.all; Entity gates is port (a,b : in std_logic; c : out std_logic); end gates ; architecture and1 of gates is begin process(a,b) Begin If (a=0 and b=0) then C<='1'; Else C<= '0'; End if; End process; End and1;


These are predefined words in VHDL standards. Bit indicates that the data type is a bit i. e. 0 or 1. A bit_vector is an array of bits. example: a: in bit; b: in bit_vector(1 downto 0);


Below code can implement XNOR gate in VHDL.The code is written in behavioral model.Library ieee;use ieee.std_logic_1164.all;Entity gates isport (a,b : in std_logic; c : out std_logic);end gates ;architecture and1 of gates isbeginprocess(a,b)BeginIf (a=1 and b=0) thenC<='0';elsif (a=0 and b=1) thenC<='0';ElseC<= '1';End if;End process;End and1;Read more: What_is_the_VHDL_code_to_implement_XOR_gate_in_behavioral_model



Copyright ยฉ 2020 Multiply Media, LLC. All Rights Reserved. The material on this site can not be reproduced, distributed, transmitted, cached or otherwise used, except with prior written permission of Multiply.