URL
https://opencores.org/ocsvn/dqpskmap/dqpskmap/trunk
[/] [dqpskmap/] [trunk/] [rtl/] [dataConverter.vhd] - Blame information for rev 2
Details |
Compare with Previous |
View Log
Line No. |
Rev |
Author |
Line |
1 |
2 |
entactogen |
|
2 |
|
|
-- Copyright (c) 2013 Antonio de la Piedra
|
3 |
|
|
|
4 |
|
|
-- This program is free software: you can redistribute it and/or modify
|
5 |
|
|
-- it under the terms of the GNU General Public License as published by
|
6 |
|
|
-- the Free Software Foundation, either version 3 of the License, or
|
7 |
|
|
-- (at your option) any later version.
|
8 |
|
|
|
9 |
|
|
-- This program is distributed in the hope that it will be useful,
|
10 |
|
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
|
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
|
|
-- GNU General Public License for more details.
|
13 |
|
|
|
14 |
|
|
-- You should have received a copy of the GNU General Public License
|
15 |
|
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16 |
|
|
|
17 |
|
|
library IEEE;
|
18 |
|
|
use IEEE.STD_LOGIC_1164.ALL;
|
19 |
|
|
use IEEE.STD_LOGIC_ARITH.ALL;
|
20 |
|
|
use IEEE.STD_LOGIC_UNSIGNED.ALL;
|
21 |
|
|
|
22 |
|
|
entity dataConverter is
|
23 |
|
|
Port (clk_36_KHz : in STD_LOGIC;
|
24 |
|
|
rst : in std_logic;
|
25 |
|
|
bit_stream_input : in STD_LOGIC;
|
26 |
|
|
valid_input : in STD_LOGIC;
|
27 |
|
|
dbit_output : out std_logic_vector(1 downto 0));
|
28 |
|
|
|
29 |
|
|
end dataConverter;
|
30 |
|
|
|
31 |
|
|
architecture Behavioral of dataConverter is
|
32 |
|
|
signal s_reg_s : std_logic_vector(1 downto 0);
|
33 |
|
|
begin
|
34 |
|
|
|
35 |
|
|
shift_reg: process(clk_36_KHz, rst, bit_stream_input)
|
36 |
|
|
variable s_reg_v : std_logic_vector(1 downto 0) := (others=>'0');
|
37 |
|
|
begin
|
38 |
|
|
if rst = '1' then
|
39 |
|
|
s_reg_v := (others=>'0');
|
40 |
|
|
elsif falling_edge(clk_36_KHz) and valid_input = '1' then
|
41 |
|
|
s_reg_v(1) := s_reg_v(0);
|
42 |
|
|
s_reg_v(0) := bit_stream_input;
|
43 |
|
|
end if;
|
44 |
|
|
|
45 |
|
|
s_reg_s <= s_reg_v;
|
46 |
|
|
end process;
|
47 |
|
|
|
48 |
|
|
dbit_output <= s_reg_s;
|
49 |
|
|
|
50 |
|
|
end Behavioral;
|
51 |
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.