Kod: Zaznacz cały
library ieee;
use ieee.std_logic_1164.all;
entity multiplexer is
port (
s : in std_logic;
d0 : in std_logic;
d1 : in std_logic;
y : out std_logic
);
end multiplexer;
architecture Behavioral of multiplexer is
begin
process ( s , d0, d1)
begin
if ( s = '0' ) then
y <= d0;
else
y<=d1;
end if;
--y <= d0 when s='0' else d1;
end process;
end Behavioral; Kod: Zaznacz cały
ERROR:HDLParsers:164 - "C:/Xilinx/10.1/ISE/ISEexamples/mux/muxx.vhd" Line 22. parse error, unexpected WHEN, expecting SEMICOLONKod: Zaznacz cały
library ieee;
use ieee.std_logic_1164.all;
entity multiplexer is
port (
s : in std_logic;
d0 : in std_logic;
d1 : in std_logic;
y : out std_logic
);
end multiplexer;
architecture Behavioral of multiplexer is
begin
--if ( s = '0' ) then
-- y <= d0;
--else
-- y<=d1;
--end if;
y <= d0 when s='0' else d1;
end Behavioral;