I have big problem because i dont uderstand properly how make my homework.
Well i have to make something like this:
http://tomaszewicz.zpt.tele.pw.edu.pl/files/u1/zad4.gif
I have code which create b1 but i dont knwo how to create the second and make them connect to b3.
My code is:
library ieee; use ieee.std_logic_1164.all; entity test is generic( n : integer := 4 ); port( a, b, c, d : in std_logic_vector(n-1 downto 0); s : in std_logic_vector(1 downto 0); y : out std_logic_vector(n-1 downto 0) ); end test; -- przypisanie sekwencyjne - case architecture arch_mux5 of test is begin pr_case: process(a,b,c,d,s) begin case s is when "00" => y <= a; when "01" => y <= b; when "10" => y <= c; when others => y <= d; end case; end process; end arch_mux5; architecture arch_mux6 of test is begin pr_if: process(a,b,c,d,s) begin y <= (others => '0'); -- latch jesli zakomentujemy, dlaczego? if s = "00" then y <= a; end if; if s = "01" then y <= b; end if; if s = "10" then y <= c; end if; if s = "11" then y <= d; end if; end process; end arch_mux6; configuration cfg of test is for arch_mux5 end for; end cfg;
mux5 and mux6 seems to be the same but in different write method.
You have to instantiate those multiplexers, e.g.:
Of course you still have to write the entity+architecture for
mux2. I didn’t test this code (don’t have a VHDL compiler here) but that should at least lead you into the correct direction.