URL
https://opencores.org/ocsvn/c16/c16/trunk
[/] [c16/] [trunk/] [vhdl/] [BaudGen.vhd] - Diff between revs 2 and 9
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 2 |
Rev 9 |
Line 11... |
Line 11... |
--use UNISIM.VComponents.all;
|
--use UNISIM.VComponents.all;
|
|
|
entity BaudGen is
|
entity BaudGen is
|
Generic(bg_clock_freq : integer; bg_baud_rate : integer);
|
Generic(bg_clock_freq : integer; bg_baud_rate : integer);
|
Port( CLK_I : in std_logic;
|
Port( CLK_I : in std_logic;
|
CLR : in std_logic;
|
RST_I : in std_logic;
|
CE_16 : out std_logic
|
CE_16 : out std_logic
|
);
|
);
|
end BaudGen;
|
end BaudGen;
|
|
|
architecture Behavioral of BaudGen is
|
architecture Behavioral of BaudGen is
|
Line 41... |
Line 41... |
process(CLK_I)
|
process(CLK_I)
|
begin
|
begin
|
if (rising_edge(CLK_I)) then
|
if (rising_edge(CLK_I)) then
|
CE_16 <= '0'; -- make CE_16 stay on for (at most) one cycle
|
CE_16 <= '0'; -- make CE_16 stay on for (at most) one cycle
|
|
|
if (CLR = '1') then
|
if (RST_I = '1') then
|
COUNTER <= 0;
|
COUNTER <= 0;
|
elsif (COUNTER >= limit) then
|
elsif (COUNTER >= limit) then
|
CE_16 <= '1';
|
CE_16 <= '1';
|
COUNTER <= COUNTER - limit;
|
COUNTER <= COUNTER - limit;
|
else
|
else
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.