Question

In: Electrical Engineering

Design in VHDL a 8-1 Multiplexer Screenshot the simulation and code.

Design in VHDL a 8-1 Multiplexer

Screenshot the simulation and code.

Solutions

Expert Solution

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity multiplexer is
Port (

    din:in STD_LOGIC_VECTOR (7 downto 0);
   sel:in STD_LOGIC_VECTOR (2 downto 0);
   dout : out STD_LOGIC);
end multiplexer;

architecture Behavioral of multiplexer is
begin
    process (din,sel)
    begin
      case sel is
           when "000"=> dout <= din(7);
           when "001"=> dout <= din(6);
           when "010"=> dout <= din(5);
           when "011"=> dout <= din(4);
           when "100"=> dout <= din(3);
           when "101"=> dout <= din(2);
           when "110"=> dout <= din(1);
           when "111"=> dout <= din(0);
           when others=> dout <= din(0);
      end case;
end process;
end Behavioral;


TEST BENCH:

LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_unsigned.all;
USE ieee.numeric_std.ALL;

ENTITY tb_multiplexer_vhd IS
END tb_multiplexer_vhd;

ARCHITECTURE behavior OF tb_multiplexer_vhd IS

-- Component Declaration for the Unit Under Test (UUT)
COMPONENT multiplexer
PORT(
din :IN std_logic_vector(7 downto 0);
sel:IN std_logic_vector(2 downto 0);
dout :OUT std_logic
);
END COMPONENT;

--Inputs
SIGNAL din : std_logic_vector(7 downto 0) := (others=>'0');
SIGNAL sel : std_logic_vector(2 downto 0) := (others=>'0');

--Outputs
SIGNAL dout : std_logic;

BEGIN

-- Instantiate the Unit Under Test (UUT)
uut: multiplexer PORT MAP(din => din,
sel => sel,
dout => dout
);

process

         din<= "10100011"; wait for 10ns;

         sel<= "000"; wait for 10ns,

         sel<= "001"; wait for 10ns,

         sel<= "010"; wait for 10ns,

         sel<= "011"; wait for 10ns,

         sel<= "100"; wait for 10ns,

         sel<= "101"; wait for 10ns,

         sel<= "110"; wait for 10ns,

         sel<= "111"; wait for 10ns,

        wait;

end process


END;


Related Solutions

Design in VHDL a 16-1 Demultiplexer Screenshot the simulation and code.
Design in VHDL a 16-1 Demultiplexer Screenshot the simulation and code.
Design in VHDL a gray code decoder to excess 3 code Screenshot the simulation and code.
Design in VHDL a gray code decoder to excess 3 code Screenshot the simulation and code.
VHDL Code will not run simulation. What is the problem with my code?? --VHDL Code library...
VHDL Code will not run simulation. What is the problem with my code?? --VHDL Code library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.NUMERIC_STD.ALL; entity DataMemory16Bits is Port ( Address_DM : in STD_LOGIC_VECTOR(15 downto 0); Data_In_DM : in STD_LOGIC_VECTOR(15 downto 0); Clock : in STD_LOGIC; We_DM : in STD_LOGIC; Re_DM : in STD_LOGIC; Data_Out_DM : out STD_LOGIC_VECTOR(15 downto 0)); end DataMemory16Bits; architecture Behavioral of DataMemory16Bits is Type DataMemory16Bits is array(0 to 31) of STD_LOGIC_VECTOR(15 downto 0); signal memory: DataMemory16Bits; begin process...
Design a 4-to-1 multiplexer using VHDL a- use with-select-when statement in writing VHDL file generate timing...
Design a 4-to-1 multiplexer using VHDL a- use with-select-when statement in writing VHDL file generate timing diagram
VHDL Code: Design a 16-bit 4-to-1 multiplexer using data-flow implementation style. Data inputs and output should...
VHDL Code: Design a 16-bit 4-to-1 multiplexer using data-flow implementation style. Data inputs and output should be 16-bit vectors. In your test bench, you should include enough number of test cases to show the correctness of your design.
Provide the VHDL code and simulation results for a mod-7 counter, with asynchronous active low reset.
Provide the VHDL code and simulation results for a mod-7 counter, with asynchronous active low reset.
Simulate this code in ISE Simulator (ISim) and screenshot the simulation library IEEE; use IEEE.STD_LOGIC_1164.ALL; use...
Simulate this code in ISE Simulator (ISim) and screenshot the simulation library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity multiplexer is Port (     din:in STD_LOGIC_VECTOR (7 downto 0);    sel:in STD_LOGIC_VECTOR (2 downto 0);    dout : out STD_LOGIC); end multiplexer; architecture Behavioral of multiplexer is begin     process (din,sel)     begin       case sel is            when "000"=> dout <= din(7);            when "001"=> dout <= din(6);            when "010"=> dout <= din(5);            when "011"=>...
solve in MATLAB and screenshot code ?′′ −??′ +??= ???(????−?????)
solve in MATLAB and screenshot code ?′′ −??′ +??= ???(????−?????)
Using the following VHDL code for an 8 bit adder, make the sum be displayed on...
Using the following VHDL code for an 8 bit adder, make the sum be displayed on the seven segment display of an Elbert V2 Spartan 3A FPGA Board. VHDL: library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity state_bit_adder is Port ( clk : in STD_LOGIC; reset : in STD_LOGIC;            D : in STD_LOGIC;            Enable : out STD_LOGIC_vector (2 downto 0);            input: in std_logic_vector(7 downto 0);            SUM: out...
I am trying to write the code for an 8 bit adder in VHDL so that...
I am trying to write the code for an 8 bit adder in VHDL so that I can program it onto my Elbert V2 Spartan 3A FPGA Development Board, but I keep getting errors. Any ideas what I am doing wrong? library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity adder8bit is Port ( a : in STD_LOGIC_VECTOR(7 downto 0); b : in STD_LOGIC_VECTOR(7 downto 0); cin : in STD_LOGIC; o : out STD_LOGIC_VECTOR(7 downto 0); cout : out STD_LOGIC); end adder8bit; architecture Behavioral...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT