aboutsummaryrefslogtreecommitdiff
path: root/sem6/dig/m4/dflip.vhdl
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2021-02-17 15:55:39 +0100
committerJulian T <julian@jtle.dk>2021-02-17 15:55:39 +0100
commit3568f19d347df23eb1d8b7fc8e74c736390a09f4 (patch)
tree9c0bcc101d53e1c62c80384764e850a9c1ca3a77 /sem6/dig/m4/dflip.vhdl
parentcfcd3eefcbc547a8b69d9f5830b7a27c0bdb60ce (diff)
Added first non working version of assignments for dig m4
Diffstat (limited to 'sem6/dig/m4/dflip.vhdl')
-rw-r--r--sem6/dig/m4/dflip.vhdl26
1 files changed, 26 insertions, 0 deletions
diff --git a/sem6/dig/m4/dflip.vhdl b/sem6/dig/m4/dflip.vhdl
new file mode 100644
index 0000000..5f722d3
--- /dev/null
+++ b/sem6/dig/m4/dflip.vhdl
@@ -0,0 +1,26 @@
+LIBRARY IEEE;
+USE IEEE.STD_LOGIC_1164.all;
+
+ENTITY dflip IS
+ PORT(
+ d: IN STD_LOGIC;
+ clk: IN STD_LOGIC;
+ q: OUT STD_LOGIC;
+ nq: OUT STD_LOGIC
+ );
+END dflip;
+
+ARCHITECTURE impl OF dflip IS
+ SIGNAL qi : STD_LOGIC;
+BEGIN
+ nq <= NOT qi;
+ q <= qi;
+ PROCESS (clk)
+ BEGIN
+ -- Check if high edge
+ if (clk'event and clk = '1') then
+ qi <= d;
+ end if;
+ END PROCESS;
+END IMPL;
+