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_binary2gray.vhd] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 aborga
-----------------------------------------------------------------------------
2
--      Filename:       gh_binary2gray.vhd
3
--
4
--      Description:
5
--              a binary to gray code converter
6
--
7
--      Copyright (c) 2006 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             12/26/06        G Huber         Initial revision
15
--
16
-----------------------------------------------------------------------------
17
LIBRARY ieee;
18
USE ieee.std_logic_1164.all;
19
 
20
ENTITY gh_binary2gray IS
21
        GENERIC (size: INTEGER := 8);
22
        PORT(
23
                B   : IN STD_LOGIC_VECTOR(size-1 DOWNTO 0);      -- binary value in
24
                G   : out STD_LOGIC_VECTOR(size-1 DOWNTO 0) -- gray code out
25
                );
26
END entity;
27
 
28
ARCHITECTURE a OF gh_binary2gray IS
29
 
30
BEGIN
31
 
32
process (B) is
33
begin
34
        for j in 0 to size-2 loop
35
                G(j) <= B(j) xor B(j+1);
36
        end loop;
37
        G(size-1) <= B(size-1);
38
end process;
39
 
40
END a;
41
 

powered by: WebSVN 2.1.0

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