Question: Project Part 2 :: VHDL Sequential Logic Follow the instructions below. Use the attached VHDL files as a basis for the project. ( The instructions
Project Part :: 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
B Clocked Dflipflop with NAND Gates
Below is the circuit diagram for the Dflipflip with NAND Gates that is Clocked. On the website with this assignment, you will find working code for this circuit along with working testbench code. Hint: to see how this works without excess clutter, run the the code and on the EPWave page, click on the name of each trace and remove it with the red X button, EXCEPT for D Q clock, and Reset. This will show you how the circuit works with Q rising on the next clock edge after D and Reset go to
C Exam Question: Clocked JKFlipflop Use the circuitVHDL code above again found on the page with this assignment to implement a clocked JKflipflip. 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
THE TEST BENCH CODE
LIBRARY ieee;
USE ieee.stdlogicALL;
ENTITY DFFtb IS
END DFFtb;
ARCHITECTURE behavior OF DFFtb IS
COMPONENT Dlatchnand
PORT
D : IN stdlogic;
Reset : IN stdlogic;
Q : OUT stdlogic;
clock : IN stdlogic;
;
END COMPONENT;
signal din : stdlogic :;
signal clk : stdlogic :;
signal rst : stdlogic :;
signal dout : stdlogic;
constant clkperiod : time : ns;
BEGIN
uut: Dlatchnand PORT MAP
D din,
Reset rst
Q dout,
clock clk
;
clkprocess :process
begin
for i in to loop
clk ;
wait for ns;
clk ;
wait for ns;
end loop;
wait;
end process;
stimproc: process
begin
set up store zero
rst ;
din ;
wait for ns;
read a zero, ignore input
rst ;
din ;
wait for ns;
ignore input, still output zero
rst ;
din ;
wait for ns;
ignore input, still output zero
rst ;
din ;
wait for ns;
store a
rst ;
din ;
wait for ns;
ignore input, read a
rst ;
din ;
wait for ns;
store zero again
rst ;
din ;
wait for ns;
read a zero, ignore input
rst ;
din ;
wait for ns;
store a
rst ;
din ;
wait for ns;
ignore input, read a
rst ;
din ;
wait for ns;
wait;
end process;
END;
DESIGN CODE
library IEEE;
use IEEE.STDLOGICALL;
entity Dlatchnand is
Port D : in STDLOGIC;
Reset : in STDLOGIC;
Q : inout STDLOGIC;
clock : in STDLOGIC;
end Dlatchnand;
architecture Behavioral of Dlatchnand is
signal notQ : STDLOGIC;
signal S R : STDLOGIC;
signal intermedTop, intermedBottom : STDLOGIC ;
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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
