-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmorse_lut.vhdl
61 lines (56 loc) · 1.48 KB
/
morse_lut.vhdl
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
59
60
61
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
library work;
use work.morse_attrs.all;
entity morse_lut is
port (
x : in std_logic_vector(2 downto 0);
q : out std_logic_vector(MORSE_MAX_LEN - 1 downto 0);
l : out std_logic_vector(MORSE_MAX_LEN_BITS - 1 downto 0)
);
end entity;
architecture behavioral of morse_lut is
begin
process(x) is
begin
case x is
-- A
when "000" =>
q <= "10111" & "000000";
l <= x"6";
-- B
when "001" =>
q <= "111010101" & "00";
l <= x"a";
-- C
when "010" =>
q <= "11101011101";
l <= x"c";
-- D
when "011" =>
q <= "1110101" & "0000";
l <= x"8";
-- E
when "100" =>
q <= "1" & "0000000000";
l <= x"2";
-- F
when "101" =>
q <= "101011101" & "00";
l <= x"a";
-- G
when "110" =>
q <= "111011101" & "00";
l <= x"a";
-- H
when "111" =>
q <= "10101010" & "000";
l <= x"9";
-- Não é um caso sintetizável
when others =>
q <= (others => '0');
l <= (others => '0');
end case;
end process;
end architecture;