Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - please help me check my coding

 
Thread Tools Search this Thread
Old 02-27-2008, 06:01 AM   #1
Default please help me check my coding


ontime range is 0,1,2.. to 199.
count1a range is 1, 3, 5 .. to 199 (odd numbers).
count1b range is 0, 2, 4 .. to 198 (even numbers).
counter1 range is 0,1,2... to 99.

i have two processes both with same input signal clk. 1st process will
count the rising edge while the 2nd process will count the falling
edge. time between rising edge and falling edge is 5ns.
when i run this code in simulation, i am able to achieve 5ns increment
from the output when i increment the ontime by 1.
but when i do the experiment on the circuit, i can only achieve 10ns
increment. for example, the results i got for ontime= 100, 101, 102,
103, 104, 105 are 40ns, 50ns, 50ns, 60ns, 60ns, 70ns respectively.

may i know where did i went wrong in my coding or is there any illegal
statement? please advise.. thank you.


process (clk, reset) --first process to take care of rising edge
if reset = '0' then
count1a := 1;
elsif (rising_edge(clk)) then
if (counter1 = 0) then
count1a := 1; --count1a will be odd number, 1, 3, 5 .. 199.
else
count1a := count1a + 1;
end if;
end if;
end process;

process (clk, reset) --2nd process to take care of falling edge
if reset = '0' then
count1b := 0; --count1b will be even numbers, 0, 2, 4 .. 198.
counter1 := 0;
elsif (falling_edge(clk)) then
if (counter1 = 0) then
count1b := 0;
end if;
if (counter1 >= 99) then
counter1 := 0;
else
counter1 := counter1 + 1;
count1b := count1b + 2;
end if;
ontime := XX;
ontime1 := XX + 1;
if (ontime1/2 = ontime/2) then --even ontime number
if(count1b < ontime) then
out1 <= '1'; -- out1 is my output signal
else
out1 <= '0';
end if;
else -- odd ontime number
if(count1a < ontime) then
out1 <= '1';
else
out1 <= '0';
end if;
end if;
end process;


raullim7@hotmail.com
  Reply With Quote
Old 02-27-2008, 06:03 AM   #2
raullim7@hotmail.com
 
Posts: n/a
Default Re: please help me check my coding
process (clk, reset) --first process to take care of rising edge
if reset = '0' then
count1a := 1;
elsif (rising_edge(clk)) then
if (counter1 = 0) then
count1a := 1; --count1a will be odd number, 1, 3, 5 .. 199.
else
count1a := count1a + 2;
end if;
end if;
end process;

**made a mistake here, should be count1a := count1a + 2, not + 1.





raullim7@hotmail.com
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Obatin MCSE,CCNA,CCNP,ORACLE,JAVA And Many More Certs WithoutExams..Pay After Check Results..100% Passing Gaurantee certexpert MCTS 0 01-16-2009 12:41 PM
Obatin MCSE,CCNA,CCNP,ORACLE,JAVA And Many More Certs WithoutExams..Pay After Check Results..100% Passing Gaurantee EXAMSATHOME MCTS 0 12-26-2008 09:47 AM
Obatin MCSE,CCNA,CCNP,ORACLE,JAVA And Many More Certs WithoutExams..Pay After Check Results..100% Passing Gaurantee EXAMSATHOME MCITP 0 12-26-2008 09:10 AM
Obtain Mcse,Ccna,Ccnp Without Exams( Pay After Check Results) 100%Passing Gaurantee Scr MCTS 0 06-19-2008 08:50 AM
Re: The purpose of dvd region coding? Shouse DVD Video 1 09-02-2003 05:47 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46