blob: 7872e116342811da17dedb06d9a46fa5a395a4b9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
library work;
entity repro2 is
port (
i : in std_ulogic_vector(1 downto 0);
o : out std_ulogic_vector (3 downto 0)
);
end entity repro2;
architecture behav of repro2 is
function func (v : std_ulogic_vector (1 downto 0)) return std_ulogic_vector is
variable res : std_ulogic_vector (3 downto 0);
begin
case v is
when "01" =>
res := "1111";
when others =>
res := "0000";
return "0000";
end case;
return res;
end;
begin
o <= func (i);
end architecture behav;
|