aboutsummaryrefslogtreecommitdiff
path: root/src/dispshift.vhd
diff options
context:
space:
mode:
Diffstat (limited to 'src/dispshift.vhd')
-rw-r--r--src/dispshift.vhd26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/dispshift.vhd b/src/dispshift.vhd
index 5669641..4c4093b 100644
--- a/src/dispshift.vhd
+++ b/src/dispshift.vhd
@@ -11,7 +11,29 @@ end dispshift;
architecture Behavioral of dispshift is
-begin
-
+-- init as empty display
+signal sD: std_logic_vector(11 downto 0) := x"aaa";
+signal SLastValue: std_logic := '0';
+begin
+ process(CLK)
+ begin
+ if (rising_edge (clk)) then
+ -- set default values
+ SLastValue <= S;
+ sD <= sD;
+
+ -- when S does go high update output
+ if (SLastValue = '0' and S = '1') then
+ -- set data on output
+ N3 <= sD(11 downto 8);
+ N2 <= sD(7 downto 4);
+ N1 <= sD(3 downto 0);
+ N0 <= D;
+
+ -- store new data
+ sD <= sD(7 downto 0) & D;
+ end if;
+ end if;
+ end process;
end Behavioral;