Question: Project VHDL Sequential Logic Follow the instructions below. Use the attached VHDL files as a basis for the project. ( The instructions are shown in

Project VHDL Sequential Logic
Follow the instructions below.Use the attached VHDL files as a basis for the project.
(The instructions are shown in the image)as well as the testbench code and design
Please Provide the modified testbench code and design
The objective for this assignment is to implement a clocked JK-Flip Flop in VHDL using the test bench code given
C Question: Clocked JK-Flipflop
Use the circuit/VHDL code below (again,found on the page with this assignment)to implement a clocked JK-flipflop. See the diagram below:
NOTE: LEAVE THE RESET ALONE, DO NOT CHANGE THE WIRING FOR IT!YOU WILL HAVE TO TRIGGER THE RESET WHENEVER J OR K CHANGES, HOWEVER!! Basically you are treating the circuit beling supplied to you as the box in the circuit diagram above. For a JK flipflop
J K D Output*(Q)1011010011Qcomplement of previous output 00Q no change to output Table 1: JK Flipflip Truth Table. *Output always next clock edge after input
(THE TEST BENCH CODE)
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY DFF_tb IS
END DFF_tb;
ARCHITECTURE behavior OF DFF_tb IS
COMPONENT D_latch_nand
PORT(
D : IN std_logic;
Reset : IN std_logic;
Q : OUT std_logic;
clock : IN std_logic;
);
END COMPONENT;
signal din : std_logic :='0';
signal clk : std_logic :='0';
signal rst : std_logic :='0';
signal dout : std_logic;
constant clk_period : time :=10ns;
BEGIN
uut: D_latch_nand PORT MAP (
D =>din,
Reset =>rst,
Q =>dout,
clock =>clk
);
clk_process :process
begin
for i in 1to 24loop
clk <='0';
wait for 3ns;
clk <='1';
wait for 3ns;
end loop;
wait;
end process;
stim_proc: process
begin
--set up,store zero
rst <='1';
din <='0';
wait for 15ns;
--read a zero, ignore input
rst <='0';
din <='0';
wait for 15ns;
--ignore input, still output zero
rst <='0';
din <='1';
wait for 15ns;
--ignore input, still output zero
rst <='0';
din <='0';
wait for 15ns;
--store a 1
rst <='1';
din <='1';
wait for 15ns;
--ignore input, read a 1
rst <='0';
din <='0';
wait for 15ns;
--store zero again
rst <='1';
din <='0';
wait for 15ns;
--read a zero, ignore input
rst <='0';
din <='0';
wait for 15ns;
--store a 1
rst <='1';
din <='1';
wait for 15ns;
--ignore input, read a 1
rst <='0';
din <='0';
wait for 15ns;
wait;
end process;
END;
(DESIGN CODE)
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity D_latch_nand is
Port (D : in STD_LOGIC;
Reset : in STD_LOGIC;
Q : inout STD_LOGIC;
clock : in STD_LOGIC);
end D_latch_nand;
architecture Behavioral of D_latch_nand is
signal notQ : STD_LOGIC;
signal S,R : STD_LOGIC;
signal intermedTop, intermedBottom : STD_LOGIC ;
begin
intermedBottom <=not (D and reset and R);
intermedTop <=S nand intermedBottom ;
--AND gates for enable
S <=not (clock and Reset and intermedTop);
R <=not (clock and S and intermedBottom);
--SR latch
Q <=S nand notQ;
notQ <=not (R and Q and Reset);
end Behavioral;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Electrical Engineering Questions!