chandru4u4
Newbie level 3
- Joined
- Dec 15, 2011
- Messages
- 4
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,315
Hello everyone ,
i am new with vhdl design , i design a one jk flip flop program . here how can initialize "no change" condition .
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
---- Uncomment the following library declaration if instantiating
---- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity jk_ff is
Port ( clock : in STD_LOGIC;
x : inout bit_vector(1 downto 0);
q : inout STD_LOGIC);
end jk_ff;
architecture Behavioral of jk_ff is
begin
process (clock,x)
begin
if (clock = '1')then
case x is
when "01" => q<='0';
when "10" => q<='1';
when "11" => q<='0';
when others => q<=q;
end case;
else
case x is
when "01" => q<='0';
when "10" => q<='1';
when "11" => q<='1';
when others => q<=q;
end case;
end if;
end process;
end Behavioral;
i am new with vhdl design , i design a one jk flip flop program . here how can initialize "no change" condition .
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
---- Uncomment the following library declaration if instantiating
---- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity jk_ff is
Port ( clock : in STD_LOGIC;
x : inout bit_vector(1 downto 0);
q : inout STD_LOGIC);
end jk_ff;
architecture Behavioral of jk_ff is
begin
process (clock,x)
begin
if (clock = '1')then
case x is
when "01" => q<='0';
when "10" => q<='1';
when "11" => q<='0';
when others => q<=q;
end case;
else
case x is
when "01" => q<='0';
when "10" => q<='1';
when "11" => q<='1';
when others => q<=q;
end case;
end if;
end process;
end Behavioral;