Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

vhdl code for pulse generation of pw=1ms

Status
Not open for further replies.

kk_victory

Newbie level 3
Joined
Jul 28, 2008
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,327
pulse generator in vhdl

Hi guys
I have implemented vhdl code for generating a pulse
of following specifications
PW= 1ms
i.e. 1ms=on & 1ms=off

Means it is 50% duty cycle.

entity pulse is
Port ( clk : in std_logic;
res : in std_logic;
clk_div : out std_logic);
end pulse;


architecture Behavioral of pulse is
signal count : integer;
signal temp : std_logic;

begin
process(clk,res)
begin
if res='1' then

temp <='0';
count <= 0;

elsif (clk'event and clk='1') then
if (count = 40000) then
temp <= not temp;
count <=0;
else
count <= count +1;

end if;
end if;
end process;
clk_div <= temp;

end Behavioral;

But Im not getting proper PW=1ms I m using 40 MHz Clock. I have simulated in Model sim
Plz Let me favour
 

verilog code for pulse generation

Please continue your previous thread. I think 40000-1 would be correct.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top