aboutsummaryrefslogtreecommitdiff
path: root/sem6/dig/m5/ex2.vhdl
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2021-02-24 15:15:24 +0100
committerJulian T <julian@jtle.dk>2021-02-24 15:15:46 +0100
commit92876e17653abd7f46126d7419433c628d303cb8 (patch)
tree053fce8e2f16935756f3570f67112f26cfe6d11f /sem6/dig/m5/ex2.vhdl
parentbf931f790f2ad6f482df38b0f70e0bbd05c401d8 (diff)
Add exercises for m5 dig
Diffstat (limited to 'sem6/dig/m5/ex2.vhdl')
-rw-r--r--sem6/dig/m5/ex2.vhdl25
1 files changed, 25 insertions, 0 deletions
diff --git a/sem6/dig/m5/ex2.vhdl b/sem6/dig/m5/ex2.vhdl
new file mode 100644
index 0000000..dc295c1
--- /dev/null
+++ b/sem6/dig/m5/ex2.vhdl
@@ -0,0 +1,25 @@
+-- TEST_START{"inputs": [], "outputs": ["output,23,0"], "clk": "clk", "testcount": 100}TEST_STOP
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.numeric_std.all;
+
+entity ex2 is
+ port (
+ clk: in std_logic;
+ output: out std_logic_vector(23 downto 0)
+ );
+end ex2;
+
+architecture impl of ex2 is
+ signal value: unsigned(23 downto 0) := "000000000000000000000000";
+begin
+ output <= std_logic_vector(value);
+
+ process (clk)
+ begin
+ if (clk'event and clk = '1') then
+ value <= value + 1;
+ end if;
+ end process;
+
+end impl;