<div dir="ltr"><table class=""><tbody><tr><td class="">Jsem asi ten posledni , dko tu muze radit ve VHDL, neb je to pro me <span class="">pueblo</span> <span class="">español, presto.<br>Ono zalezi na jakem HW to pak pojede a predevsim jak haklivy jste na presnsot a stridu hodin.<br>
Pokud nejste cimprlich tak, timhle by pri M=13 a D=20 mohlo jit udelat 65 z 100<br></span><br>-- =======<br>--<br>-- Given:<br>--<br>-- Fi = input frequency Hz<br>-- M = multiplier<br>-- D = divisor<br>-- Fo = output frequency Hz<br>
--<br>-- Where:<br>--<br>-- M ≤ D<br>--<br>-- Then:<br>--<br>-- ⎧ M<br>-- ⎪ Fi·— if M <= D<br>-- Fo = ⎨ D<br>-- ⎪<br>-- ⎩ undefined if M > D<br>--<br>--<br>-- If (M/D) is greater than 0.5, only the clock enable is valid.<br>
-- If (M/D) is greater than 1.0, both outputs are invalid.<br><br>entity Clock_Divider is<br> generic (<br> operand_width : positive<br> );<br> port (<br> clock : in bit;<br> reset : in bit;<br><br> multiplier : in unsigned(operand_width-1 downto 0);<br>
divisor : in unsigned(operand_width-1 downto 0);<br><br> out_enable : buffer bit;<br> out_clock : buffer bit<br> );<br>end entity;<br><br>architecture any of Clock_Divider is<br> signal enable_2x : bit;<br>
begin<br><br> -- Divide the clock by accumulating phase using the mulitplier and<br> -- subtracting when we pass the divisor value.<br><br> proc_enable : process is<br> variable phase : unsigned(operand_width downto 0);<br>
begin<br> wait until rising_edge(clock);<br> phase := phase + multiplier;<br> if phase >= divisor then<br> phase := phase - divisor;<br> out_enable <= '1';<br> else<br> out_enable <= '0';<br>
end if;<br> if reset = '1' then<br> phase := (others => '0');<br> out_enable <= '0';<br> end if;<br> end process;<br><br> proc_enable : process is<br> variable phase : unsigned(operand_width downto 0);<br>
begin<br> wait until rising_edge(clock);<br> phase := phase + (multiplier & '0');<br> if phase >= divisor then<br> phase := phase - divisor;<br> enable_2x <= '1';<br> else<br>
enable_2x <= '0';<br> end if;<br> if reset = '1' then<br> phase := (others => '0');<br> enable_2x <= '0';<br> end if;<br> end process;<br><br><br> proc_out_clock : process is<br>
begin<br> wait until rising_edge(clock);<br> if enable_2x = '1' then<br> out_clock <= not out_clock;<br> end if;<br> end process;<br><br>end architecture;</td><td class="" align="right"></td><td class="" align="right">
<br></td></tr></tbody></table></div><div class="gmail_extra"><br><br><div class="gmail_quote">Dne 3. ledna 2014 21:14 <span dir="ltr"><<a href="mailto:hw@itherm.cz" target="_blank">hw@itherm.cz</a>></span> napsal(a):<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Mam dalsi otazku ;-)<br>
<br>
Potreboval bych generovat 65MHz a 100MHz hodiny, da se to udelat pomoci<br>
jednech hodin z venku?<br>
<br>
Pavel<br>
<br>
<br>
-----Original Message-----<br>
From: Hw-list [mailto:<a href="mailto:hw-list-bounces@list.hw.cz">hw-list-bounces@list.hw.cz</a>] On Behalf Of Marek Peca<br>
Sent: 2. ledna 2014 10:13<br>
To: HW-news<br>
Subject: RE: VHDL - hloupe otazky<br>
<br>
> Me pri otazce slo hlavne o to jestli neni nejaky jeste lepsi postup<br>
> nez stavovy automat.<br>
<br>
To je velmi zapeklita otazka. Z hlediska Turingovske ekvivalence automatu je<br>
v synchronnim svete uplne *kazdy* obvod na spolecnem hodinovem signalu<br>
stavovym automatem...<br>
<br>
Prakticky zajimave jsou tedy 2 rozdilne dusledky zpusobu psani v HDL:<br>
a) co vyjde dobre na cas, popr. spotrebu hradel<br>
b) co se dobre cte a pise<br>
<br>
> Premyslel jsem nad tim to udelat i jako velky posuvny registr a proste<br>
> to precist najednou ;-)<br>
<br>
V a) to pro vetsinu uloh vyjde nevyhodne, velmi brzo pomine i zdanlive b),<br>
obavam se.<br>
<br>
<br>
ZdraviMP<br>
_______________________________________________<br>
HW-list mailing list - sponsored by <a href="http://www.HW.cz" target="_blank">www.HW.cz</a><br>
<a href="mailto:Hw-list@list.hw.cz">Hw-list@list.hw.cz</a><br>
<a href="http://list.hw.cz/mailman/listinfo/hw-list" target="_blank">http://list.hw.cz/mailman/listinfo/hw-list</a><br>
<br>
_______________________________________________<br>
HW-list mailing list - sponsored by <a href="http://www.HW.cz" target="_blank">www.HW.cz</a><br>
<a href="mailto:Hw-list@list.hw.cz">Hw-list@list.hw.cz</a><br>
<a href="http://list.hw.cz/mailman/listinfo/hw-list" target="_blank">http://list.hw.cz/mailman/listinfo/hw-list</a><br>
</blockquote></div><br></div>