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

Subversion Repositories usb_dongle_fpga

[/] [usb_dongle_fpga/] [trunk/] [src/] [led_sys/] [byte_scan_mux.vhd] - Blame information for rev 53

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 nuubik
------------------------------------------------------------------
2
-- Universal dongle board source code
3
-- 
4
-- Copyright (C) 2006 Artec Design <jyrit@artecdesign.ee>
5
-- 
6
-- This source code is free hardware; you can redistribute it and/or
7
-- modify it under the terms of the GNU Lesser General Public
8
-- License as published by the Free Software Foundation; either
9
-- version 2.1 of the License, or (at your option) any later version.
10
-- 
11
-- This source code is distributed in the hope that it will be useful,
12
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
-- Lesser General Public License for more details.
15
-- 
16
-- You should have received a copy of the GNU Lesser General Public
17
-- License along with this library; if not, write to the Free Software
18
-- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
-- 
20
-- 
21
-- The complete text of the GNU Lesser General Public License can be found in 
22
-- the file 'lesser.txt'.
23
 
24
 
25
 
26
--                   bit 0,A
27
--                 ----------
28
--                |          |
29
--                |          |
30
--             5,F|          |  1,B
31
--                |    6,G   |
32
--                 ----------
33
--                |          |
34
--                |          |
35
--             4,E|          |  2,C
36
--                |    3,D   |
37
--                 ----------  
38
--                              # 7,H
39
 
40
 
41
-- Select signal order
42
--   ---    ---      ---    --- 
43
--  |   |  |   |    |   |  |   |  
44
--  |   |  |   |    |   |  |   |
45
--   ---    ---      ---    ---
46
--  |   |  |   |    |   |  |   |
47
--  |   |  |   |    |   |  |   |
48
--   ---    ---      ---    ---
49
--  sel(3) sel(2)   sel(1) sel(0)
50
 
51
 
52
 
53
library ieee;
54
use ieee.std_logic_1164.all;
55
use IEEE.std_logic_unsigned.all;
56
use IEEE.std_logic_arith.all;
57
 
58
 
59
entity byte_scan is
60
  port (
61
    clk          : in std_logic;
62
    hi_seg_1     : in std_logic_vector(7 downto 0);
63
    lo_seg_1     : in std_logic_vector(7 downto 0);
64
    hi_seg_0     : in std_logic_vector(7 downto 0);
65
    lo_seg_0     : in std_logic_vector(7 downto 0);
66
    seg_out      : out std_logic_vector(7 downto 0);
67
    sel_out      : out std_logic_vector(3 downto 0)
68
    );
69
end byte_scan;
70
 
71
architecture rtl of byte_scan is
72
 
73
signal sel_p : std_logic_vector(3 downto 0);
74
signal count : std_logic_vector(1 downto 0):="00";
75
signal hi_seg_1_3 : std_logic_vector(7 downto 0);
76
signal lo_seg_1_3 : std_logic_vector(7 downto 0);
77
signal hi_seg_0_2 : std_logic_vector(7 downto 0);
78
signal lo_seg_0_2 : std_logic_vector(7 downto 0);
79
 
80
begin  -- rtl
81
 
82
 
83
hi_seg_1_3 <= hi_seg_1; -- when sel_hib_n ='1' else hi_seg_3;
84
lo_seg_1_3 <= lo_seg_1; --when sel_hib_n ='1' else lo_seg_3;
85
hi_seg_0_2 <= hi_seg_0; --when sel_hib_n ='1' else hi_seg_2;
86
lo_seg_0_2 <= lo_seg_0; --when sel_hib_n ='1' else lo_seg_2;
87
 
88
 
89
seg_out <=hi_seg_1_3  when count="01" else
90
                  lo_seg_1_3  when count="10" else
91
                  hi_seg_0_2  when count="11" else
92
                  lo_seg_0_2  when count="00";
93
 
94
sel_out <= sel_p;
95
 
96
sel_p <= "1110" when count="00" else
97
                 "0111" when count="01" else
98
                 "1011" when count="10" else
99
                 "1101" when count="11";
100
 
101
 
102
 
103
 
104
process (clk)  --enable the scanning while in reset (simulation will be incorrect)
105
begin  -- process
106
  if clk'event and clk = '1' then    -- rising clock edge
107
         count <= count + 1;
108
  end if;
109
end process;
110
 
111
end rtl;

powered by: WebSVN 2.1.0

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