-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathD_flip_flop.vhd
More file actions
57 lines (42 loc) · 970 Bytes
/
D_flip_flop.vhd
File metadata and controls
57 lines (42 loc) · 970 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
-- VHDL code for D-flip-flop
-- Header file declaration
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
-- Entity declaration
ENTITY d_latch IS
PORT (
c, d : IN STD_LOGIC;
q, nq : OUT STD_LOGIC);
END d_latch;
-- Dataflow Modelling Style
-- Architecture declaration
ARCHITECTURE arch OF d_latch IS
SIGNAL qt, nqt : STD_LOGIC;
BEGIN
qt <= (d NAND c) NAND nqt;
nqt <= ((NOT d) NAND c) NAND qt;
q <= qt;
nq <= nqt;
END arch;
-- -- VHDL code for D - flipflop
-- -- Header file declaration
-- LIBRARY IEEE;
-- USE IEEE.Std_logic_1164.ALL;
-- -- Entity declaration
-- ENTITY RisingEdge_DFlipFlop IS
-- PORT (
-- Q : OUT STD_LOGIC;
-- Clk : IN STD_LOGIC;
-- D : IN STD_LOGIC
-- );
-- END RisingEdge_DFlipFlop;
-- -- Dataflow Modelling Style
-- -- Architecture declaration
-- ARCHITECTURE Behavioral OF RisingEdge_DFlipFlop IS
-- BEGIN
-- PROCESS (Clk)
-- BEGIN
-- IF (rising_edge(Clk)) THEN
-- Q <= D;
-- END IF;
-- END PROCESS;