-
Notifications
You must be signed in to change notification settings - Fork 2
/
BBPD.vhd
58 lines (45 loc) · 1.06 KB
/
BBPD.vhd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
--Package Declaration
LIBRARY IEEE;
USE ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
ENTITY BBPD IS
PORT
(
Din :IN STD_LOGIC; --clk
CLK_early :IN STD_LOGIC;
CLK_edge :IN STD_LOGIC;
CLK_late :IN STD_LOGIC;
--outputs
UP :OUT STD_LOGIC;
DOWN :OUT STD_LOGIC
);
END BBPD;
ARCHITECTURE Behaviour of BBPD IS
signal Q_early :STD_LOGIC;
signal Q_edge :STD_LOGIC;
signal Q_late :STD_LOGIC;
signal XOR_1 :STD_LOGIC;
signal XOR_2 :STD_LOGIC;
begin
XOR_1 <= Q_edge XOR Q_early;
XOR_2 <= Q_edge XOR Q_late;
process(CLK_early)begin
if rising_edge(CLK_early) then
Q_early <= Din;
end if;
end process;
process(CLK_edge)begin
if rising_edge(CLK_edge) then
Q_edge <= Din;
end if;
end process;
process(CLK_late)begin
if rising_edge(CLK_late) then
Q_late <= Din;
UP <= XOR_1;
DOWN <= XOR_2;
end if;
end process;
end process
END Behaviour;