- Joined
- Sep 24, 2008
- Messages
- 2
- Reaction score
- 0
Help me to solve the problems about the keypad decode.
eg: output: col1 goes high when row1 is high and button press is 1
row 2 is high and button press is 4
i put case or if statements???
let me know that what wrong with it. thanks
entity prog5 is
Port ( reset , clk : in std_logic;
index : in integer range 1 to 12;
col : out std_logic_vector(2 downto 0);
row : in std_logic_vector(3 downto 0));
end prog5;
architecture Behavioral of prog5 is
begin
Process(clk,index)
begin
case col is
when "100" => "1000" <= row; index = 1;
when "100" => "0100" <= row; index = 4;
when "100" => "0010" <= row; index = 7;
end case;
end process ;
end Behavioral;
thanks
Regards
Mitsui9999
mitsui9999
eg: output: col1 goes high when row1 is high and button press is 1
row 2 is high and button press is 4
i put case or if statements???
let me know that what wrong with it. thanks
Code:
Port ( reset , clk : in std_logic;
index : in integer range 1 to 12;
col : out std_logic_vector(2 downto 0);
row : in std_logic_vector(3 downto 0));
end prog5;
architecture Behavioral of prog5 is
begin
Process(clk,index)
begin
case col is
when "100" => "1000" <= row; index = 1;
when "100" => "0100" <= row; index = 4;
when "100" => "0010" <= row; index = 7;
end case;
end process ;
end Behavioral;
thanks
Regards
Mitsui9999
mitsui9999