Created
August 2, 2016 23:39
-
-
Save brouhaha/ad63550bea8921de07c20977ade4757e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Floppy disk read data pulse catcher | |
-- Eric Smith <[email protected]> | |
-- 2016-08-02 | |
-- WARNING: untested | |
library ieee; | |
use ieee.std_logic_1164.all; | |
use ieee.numeric_std.all; | |
entity floppy_rd_pulse_catcher is | |
port (clk: in std_logic; | |
async_read_data_n: in std_logic; -- active low | |
sync_read_data: out std_logic -- active high | |
); | |
end floppy_rd_pulse_catcher; | |
architecture behavioral of floppy_rd_pulse_catcher is | |
signal q1, q2: std_logic; | |
begin | |
process (async_read_data_n, clk) | |
begin | |
if async_read_data_n = '0' then | |
q1 <= '1'; | |
elsif rising_edge (clk) then | |
q1 <= '0'; | |
end if; | |
if rising_edge(clk) then | |
q2 <= q1; | |
end if; | |
end process; | |
sync_read_data <= '1' when q1 = '1' and q2 = '0' | |
else '0'; | |
end behavioral; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment