blob: 0a7fe319cdd723de83d015da4da949620f187c87 (
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
package reproducer_pkg is
-- Functions
function MIN(LEFT, RIGHT: unsigned) return unsigned;
function MIN(LEFT, RIGHT: integer) return integer;
end reproducer_pkg;
package body reproducer_pkg is
function MIN(LEFT, RIGHT: unsigned) return unsigned is
begin
if LEFT < RIGHT then
return LEFT;
else
return RIGHT;
end if;
end;
function MIN(LEFT, RIGHT: integer) return integer is
begin
if LEFT < RIGHT then
return LEFT;
else
return RIGHT;
end if;
end;
end reproducer_pkg;
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
library work;
use work.reproducer_pkg.all;
entity reproducer is
port(
inputA : in unsigned(7 downto 0);
inputB : in unsigned(7 downto 0);
inputC : in integer;
inputD : in integer;
OutputA : out unsigned(7 downto 0);
OutputB : out integer
);
end reproducer;
architecture rtl of reproducer is
begin
OutputA <= min(inputA, inputB);
OutputB <= min(inputC, inputD);
end rtl;
|