Witam
Mam problem z poniższym kodem. Mam do zbudowania multiplekser 8 bitowy, który ma dodatkowe wejście (dla 0 włącza multiplekser, dla 1 wyłącza) oraz dodatkowe wyjście (które jest negacją standardowego)
Nie wiem jak mogę to okodować, aby kod się kompilował, chce go skompilować a następnie zrobić symulacje. (Uzywam ISE WEBPACK).
Problemy z którymi nie mogę sobie poradzić:
* Jak przypisywać do wyjścia (not W) i Y wartość aktualnie wskazanej (przez SEL) zmiennej (D0-D7). Czy da się to wykonać w jednej linii? Lub jakkolwiek inaczej.
*Line 93. parse error, unexpected PROCESS, expecting IF
PS. Jeśli mój koncept bądź składnia są niepoprawne bardzo proszę o informacje.
schemat: https://eduinf.waw.pl/inf/prg/010_uc/74151.php
Na tą chwilę stworzyłem coś takiego:
Pozdrawiam.
----------------------------------------------------------------------------------
-- Company:
-- Engineer:
--
-- Create Date: 21:37:43 06/14/2020
-- Design Name:
-- Module Name: Mux74151 - Behavioral
-- Project Name:
-- Target Devices:
-- Tool versions:
-- Description:
--
-- Dependencies:
--
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;
-- Uncomment the following library declaration if instantiating
-- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity Mux74151 is
Port (
D0: in STD_LOGIC;
D1: in STD_LOGIC;
D2: in STD_LOGIC;
D3: in STD_LOGIC;
D4: in STD_LOGIC;
D5: in STD_LOGIC;
D6: in STD_LOGIC;
D7: in STD_LOGIC;
G: in STD_LOGIC;
SEL: in STD_LOGIC_VECTOR(2 downto 0);
W: out STD_LOGIC;
Y: out STD_LOGIC);
end Mux74151;
architecture Behavioral of Mux74151 is
begin
process (D0,D1,D2,D3,D4,D5,D6,D7,G,SEL) is
begin
if(G ='0' and SEL = "000") then
Y <= D0; -- i chce tu jednoczenie do W<= not Y
else if (G ='0' and SEL="001") then
Y <= D1 ; -- i chce tu jednoczenie do W<= not Y
else if (G ='0' and SEL="010") then
Y <= D2 ; -- i chce tu jednoczenie do W<= not Y
else if (G ='0' and SEL="011") then
Y <= D3 ; -- i chce tu jednoczenie do W<= not Y
else if (G ='0' and SEL="100") then
Y <= D4 ; -- ...
else if (G ='0' and SEL="101") then
Y <= D5 ;
else if (G ='0' and SEL="110") then
Y <= D6;
else
Y <= D7 ;
end if;
if(G ='1' and SEL = "000") then
W <= D0; -- i chce tu jednoczenie do Y<= not W
else if (G ='1' and SEL="001") then
W <= D1 ; -- i chce tu jednoczenie do Y<= not W
else if (G ='1' and SEL="010") then
W <= D2; -- i chce tu jednoczenie do Y<= not W
else if (G ='1' and SEL="011") then
W <= D3;-- ...
else if (G ='1' and SEL="100") then
W <= D4;
else if (G ='1' and SEL="101") then
W <= D5;
else if (G ='1' and SEL="110") then
W <= D6;
else
W <= D7;
end if;
end process;
end Behavioral;