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

Subversion Repositories uart_fiber

[/] [uart_fiber/] [trunk/] [Version2/] [q_period.vhd] - Blame information for rev 9

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 9 chipmaker7
----------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer: 
4
-- 
5
-- Create Date:    00:04:51 11/17/2013 
6
-- Design Name: 
7
-- Module Name:    q_period - Behavioral 
8
-- Project Name: 
9
-- Target Devices: 
10
-- Tool versions: 
11
-- Description: 
12
--
13
-- Dependencies: 
14
--
15
-- Revision: 
16
-- Revision 0.01 - File Created
17
-- Additional Comments: 
18
--
19
----------------------------------------------------------------------------------
20
library IEEE;
21
use IEEE.STD_LOGIC_1164.ALL;
22
use IEEE.STD_LOGIC_ARITH.ALL;
23
use IEEE.std_logic_unsigned.all;
24
 
25
-- Uncomment the following library declaration if using
26
-- arithmetic functions with Signed or Unsigned values
27
--use IEEE.NUMERIC_STD.ALL;
28
 
29
-- Uncomment the following library declaration if instantiating
30
-- any Xilinx primitives in this code.
31
--library UNISIM;
32
--use UNISIM.VComponents.all;
33
 
34
entity q_period is
35
    Port ( period : in  STD_LOGIC_VECTOR (6 downto 0);
36
           period01 : out  STD_LOGIC_VECTOR (6 downto 0);
37
           periodA : out  STD_LOGIC_VECTOR (6 downto 0);
38
           period10 : out  STD_LOGIC_VECTOR (6 downto 0));
39
end q_period;
40
 
41
architecture Behavioral of q_period is
42
 
43
begin
44
 
45
process(period)
46
 
47
variable varA:STD_LOGIC_VECTOR (6 downto 0);
48
variable var01:STD_LOGIC_VECTOR (6 downto 0);
49
 
50
begin
51
        if(period(0)='1')then
52
                varA:=(6=>'0')&period(6 downto 1)+1;
53
        else
54
                varA:=(6=>'0')&period(6 downto 1);
55
        end if;
56
        var01:=(6 downto 5=>'0')&period(6 downto 2);
57
 
58
        periodA<=varA;
59
        period01<=var01;
60
        period10<=varA + var01;
61
 
62
end process;
63
 
64
 
65
 
66
 
67
end Behavioral;
68
 

powered by: WebSVN 2.1.0

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