Buy latest IEEE projects of 2018 online with base paper abstract Schematic Diagram and the main thing is code. All the things you will be found here with less cost. Price ranges from Rs.50-2000 depending on the project. We Mainly focus on Embedded VLSI and Matlab Projects. CSE and IT Projects are also Focused.

Thursday, June 8, 2017

VHDL Implementation of J-K Flip-Flop

J-K Flip-Flop. The J-K flip-flop is the most versatile of the basic flip-flops. It has the input- following character of the clocked D flip-flop but has two inputs,traditionally labeled J and K. If J and K are different then the output Q takes the value of J at the next clock edge.

VHDL Code


----------------------------------------------------------------------------------

-- Company: VHDL Language

-- Engineer: Manohar Mohanta

-- 

-- Create Date:    09:04:55 06/04/2017 
-- Design Name: 
-- Module Name:    jk_ff - Behavioral 
-- Project Name: 
-- Target Devices: 
-- Tool versions: 
-- Description: 
--
-- Dependencies: 
--
-- Revision: 
-- Revision 0.01 - File Created
-- Additional Comments: 
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.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 ( j,k : in  STD_LOGIC;
           clk : in  STD_LOGIC;
 reset : in STD_LOGIC;
            Q : out  STD_LOGIC;
           Qbar : out  STD_LOGIC);
end jk_ff;

architecture Behavioral of jk_ff is

signal qtemp,qbartemp : std_logic :='0';

begin
Q <= qtemp;
Qbar <= qbartemp;

process(clk,reset)
begin
if(reset = '1') then           --Reset the output.
 qtemp <= '0';
 qbartemp <= '1';
elsif( rising_edge(clk) ) then
if(J='0' and K='0') then       --No change in the output
 NULL;
elsif(J='0' and K='1') then    --Set the output.
 qtemp <= '0';
 qbartemp <= '1';
elsif(J='1' and K='0') then    --Reset the output.
 qtemp <= '1';
 qbartemp <= '0';
else                           --Toggle the output.
 qtemp <= not qtemp;
 qbartemp <= not qbartemp;
end if;
end if;
end process;
end Behavioral;

Simulated Results:-

Video Explanation of Code:-

No comments:

Post a Comment

Blog Views