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

Subversion Repositories uart_fpga_slow_control_migrated

[/] [uart_fpga_slow_control/] [trunk/] [code/] [library/] [gh_parity_gen_Serial.vhd] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 aborga
-----------------------------------------------------------------------------
2
--      Filename:       gh_parity_gen_Serial.vhd
3
--
4
--      Description:
5
--              a Serial parity bit generator
6
--
7
--      Copyright (c) 2005 by George Huber 
8
--              an OpenCores.org Project
9
--              free to use, but see documentation for conditions 
10
--
11
--      Revision        History:
12
--      Revision        Date            Author          Comment
13
--      --------        ----------      --------        -----------
14
--      1.0             10/15/05        S A Dodd        Initial revision
15
--
16
-----------------------------------------------------------------------------
17
LIBRARY ieee;
18
USE ieee.std_logic_1164.all;
19
 
20
ENTITY gh_parity_gen_Serial IS
21
        PORT(
22
                clk      : IN STD_LOGIC;
23
                rst      : IN STD_LOGIC;
24
                srst     : in STD_LOGIC;
25
                SD       : in STD_LOGIC; -- sample data pulse
26
                D        : in STD_LOGIC; -- data
27
                Q        : out STD_LOGIC -- parity 
28
                );
29
END gh_parity_gen_Serial;
30
 
31
ARCHITECTURE a OF gh_parity_gen_Serial IS
32
 
33
        signal parity  : std_logic;
34
 
35
BEGIN
36
 
37
        Q <= parity;
38
 
39
process (clk,rst)
40
begin
41
        if (rst = '1') then
42
                parity <= '0';
43
        elsif (rising_edge(clk)) then
44
                if (srst = '1') then -- need to clear before start of data word
45
                        parity <= '0';
46
                elsif (SD = '1') then -- sample data bit for parity generation
47
                        parity <= (parity xor D);
48
                end if;
49
        end if;
50
end process;
51
 
52
END a;
53
 

powered by: WebSVN 2.1.0

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