For the following VHDL code, Is it necessary to keep

For the following VHDL code, Is it necessary to keep the variables KM2, KM1, KN2, KN1 ? This is a delay code and all these variables are equal to the input signal “Key” and the output is always zero.

Can I do,

KM1 <=>

KM <= km1=”” or=”” km1;=””>

Code ——

——————-÷——————–
library ieee;
use ieee.std_logic_1164.all;
————————————-
entity Press_Button is — to initialize the zoom in/out keys.
generic(SIZE : integer := 5);
port(
clk : in std_logic;
KEY : in std_logic_vector(SIZE-1 downto 0); — Delay the key: We neeed delay because
OutKey : out std_logic_vector(SIZE-1 downto 0)
);
end Press_Button;
———————————–
architecture Behavioral of Press_Button is

signal KM : std_logic_vector(SIZE-1 downto 0):=(others=>’1′);
signal KM1 : std_logic_vector(SIZE-1 downto 0):=(others=>’1′);
signal KM2 : std_logic_vector(SIZE-1 downto 0):=(others=>’1′);

signal KN1 : std_logic_vector(SIZE-1 downto 0):=(others=>’1′);
signal KN2 : std_logic_vector(SIZE-1 downto 0):=(others=>’1′);

signal cnt_20ms : integer :=0;
signal clk_20ms : std_logic:=’0′;

begin

process(clk)
begin
if(clk’event and clk = ‘1’) then — they want nothing to happen. This process works before the second one that is how it delays.
if(cnt_20ms
cnt_20ms<>
clk_20ms<=not clk_20ms;=”” –=”” controls=”” the=”” second=”” process.=”” delays=””>
else
cnt_20ms<>
end if;
end if;
end process;

process(clk_20ms)
begin
if(clk_20ms’event and clk_20ms = ‘1’) then — inputs cannot be on the left side of the process. Outputs cannot be on the right.
KM1<=key; –=”” creating=”” temp=””>
KM2<>
KM<=km1 or=””>
end if;
end process;

process(clk) — general 100 MHZ
begin
if(clk’event and clk = ‘1’) then
KN1<=km; –=”” km=”” is=”” same=”” as=”” the=””>
KN2<>
OutKey<=(kn1 and=”” (not=”” kn2));=”” –the=”” output=”” is=”” always=”” zero.=”” because=”” we=”” dont=”” want=”” it=”” to=”” do=”” anything.=”” just=”” delays=”” the=””>
end if;
end process;

end Behavioral;

 

 

Stressed over that homework?

Essay deadline breathing down your neck?

Let’s cut to the chase: Why struggle when you can ace it with zero hassle?

Whether it’s essays, research papers, or assignments — we’ve got you covered.

✅ Expert writers
✅ 100% original work
✅ No AI tools, just real pros

Stressed about your essay or homework? Get a top-quality custom essay NOW!!! Stop worrying. Start succeeding.

GradeEssays.com
We are GradeEssays.com, the best college essay writing service. We offer educational and research assistance to assist our customers in managing their academic work. At GradeEssays.com, we promise quality and 100% original essays written from scratch.
Contact Us

Enjoy 24/7 customer support for any queries or concerns you have.

Phone: +1 213 3772458

Email: support@gradeessays.com

© 2024 - GradeEssays.com. All rights reserved.

WE HAVE A GIFT FOR YOU!

15% OFF 🎁

Get 15% OFF on your order with us

Scroll to Top