blob: 841d1185871f7b642756fbbab7acbb026dbbf308 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
library ieee;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
entity test is
port(
sel: in std_logic;
inp: in unsigned(7 downto 0);
outp: out integer range 0 to 255
);
end;
architecture a of test is
begin
with sel select outp <= to_integer(inp) when '1', 0 when others;
end;
|