OpenCores
URL https://opencores.org/ocsvn/parallel_io_through_fiber/parallel_io_through_fiber/trunk

Subversion Repositories parallel_io_through_fiber

[/] [parallel_io_through_fiber/] [trunk/] [parport_tx/] [step_sampler.vhd] - Blame information for rev 7

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 chipmaker7
----------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer: 
4
-- 
5
-- Create Date:    07:58:18 12/11/2013 
6
-- Design Name: 
7
-- Module Name:    step_sampler - Behavioral 
8
-- Project Name: 
9
-- Target Devices: 
10
-- Tool versions: 
11
-- Description: 
12
--
13
-- Dependencies: 
14
--
15
-- Revision: 
16
-- Revision 0.01 - File Created
17
-- Additional Comments: 
18
--
19
----------------------------------------------------------------------------------
20
library IEEE;
21
use IEEE.STD_LOGIC_1164.ALL;
22
 
23
-- Uncomment the following library declaration if using
24
-- arithmetic functions with Signed or Unsigned values
25
--use IEEE.NUMERIC_STD.ALL;
26
 
27
-- Uncomment the following library declaration if instantiating
28
-- any Xilinx primitives in this code.
29
--library UNISIM;
30
--use UNISIM.VComponents.all;
31
 
32
entity step_sampler is
33
    Port ( iCLK : in  STD_LOGIC;
34
           step : in  STD_LOGIC;
35
           dir : in  STD_LOGIC;
36
           step_cnt : out  STD_LOGIC;
37
           dir_value : out  STD_LOGIC);
38
end step_sampler;
39
 
40
architecture Behavioral of step_sampler is
41
 
42
signal q:std_logic;
43
signal step_cnt_reg:std_logic;
44
 
45
 
46
begin
47
 
48
step_cnt<=step_cnt_reg;
49
 
50
step_sampler:process (iCLK)
51
begin
52
 
53
        if (iCLK'event and iCLK= '1') then
54
                q<=step;
55
                if(q/=step and step='1')then
56
                        dir_value<=dir;
57
                        step_cnt_reg<=not step_cnt_reg;
58
                end if;
59
        end if;
60
end process;
61
 
62
 
63
end Behavioral;
64
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.