<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pl-pl">
<link rel="self" type="application/atom+xml" href="https://forum.atnel.pl/feed.php?f=61&amp;t=15371&amp;mode" />

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2016-05-21T21:01:24+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=61&amp;t=15371&amp;mode</id>
<entry>
<author><name><![CDATA[bastik]]></name></author>
<updated>2016-05-21T21:01:24+01:00</updated>
<published>2016-05-21T21:01:24+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15371&amp;p=160993#p160993</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15371&amp;p=160993#p160993"/>
<title type="html"><![CDATA[Re: VHDL: Licznik modulo 10 dwukierunkowy]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15371&amp;p=160993#p160993"><![CDATA[
Dobra trochę zmieniłem koncepcje, plan jest taki żeby wykrywać kiedy guzik jest wciśnięty czyli stan=1, program znowu kompiluje się bez błędów, ale niestety symulacja nie działa. <br />[syntax=vhdl]library IEEE;<br />use IEEE.std_logic_1164.all, IEEE.numeric_std.all;<br /> <br />ENTITY counter is<br />generic (n:natural :=4);<br />port(<br />button1:        in std_logic;<br />button2:        in std_logic;<br />clear:  in std_logic;<br />C                               : out std_logic;<br />OUT1                            : out std_logic_vector(n-1 downto 0)<br />);<br />END counter;<br /> <br />ARCHITECTURE beh of counter is<br />begin<br /> <br />p0:process (button1, button2, clear) is<br />variable count: unsigned (n-1 downto 0);<br />begin<br />        if clear = '1' then<br />count:= (others=&gt;'0');<br />                elsif button1='1' then<br />count:=count+1;<br />                        elsif count=10 then<br />                                count:=(others=&gt;'0');<br />                                C&lt;='1';<br />                                else C&lt;='0';<br />                        end if;<br />                       <br />if button2='1' then<br />count:=count-1;<br />if count=6 then count:=&quot;1010&quot;;<br />C&lt;='1';<br />else C&lt;='0';<br />end if;<br />end if;<br /><br />OUT1&lt;=std_logic_vector(count);<br />end process p0;<br />end architecture beh;[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=8145">bastik</a> — 21 maja 2016, o 21:01</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[rskup]]></name></author>
<updated>2016-05-14T23:58:23+01:00</updated>
<published>2016-05-14T23:58:23+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15371&amp;p=160641#p160641</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15371&amp;p=160641#p160641"/>
<title type="html"><![CDATA[Re: VHDL: Licznik modulo 10 dwukierunkowy]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15371&amp;p=160641#p160641"><![CDATA[
<div class="quotetitle"><b>Quote:</b></div><div class="quotecontent"><br />Próbowałem dwa razy wykorzystać polecenie rising_edge w jednym procesie, ale nie wiem czy w tym języku takie coś można wykonać.<br /></div>Nie możesz tak robić <img src="https://forum.atnel.pl/images/smilies/icon_e_sad.gif" alt=":(" title="Smutny" /><br />Przeczytaj informacje pod linkiem <!-- m --><a class="postlink" href="http://stackoverflow.com/questions/19879960/vhdl-multiple-rising-edge-detections-inside-a-process-block" >http://stackoverflow.com/questions/1987 ... cess-block</a><!-- m -->. Masz tam wszystko na ten temat napisane. Wystarczy połączyć wyzwalanie klawiszy button1 i button2 w jeden sygnał i jego podać do rising_edge().<br /><br /><br />Dodatkowo jak liczysz w dół, to dochodzisz tylko do 1, bo jak się ma pojawić zero, to już wtedy zmieniasz wartość i nie masz zera <img src="https://forum.atnel.pl/images/smilies/icon_e_sad.gif" alt=":(" title="Smutny" /> A jeszcze dodatkowo nie wpisujesz wtedy wartości górnej jako 9 ...<br /> <br />-- <br />Pozdrawiam,<br />Robert<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=3427">rskup</a> — 14 maja 2016, o 23:58</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[bastik]]></name></author>
<updated>2016-05-14T21:30:47+01:00</updated>
<published>2016-05-14T21:30:47+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15371&amp;p=160629#p160629</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15371&amp;p=160629#p160629"/>
<title type="html"><![CDATA[Re: VHDL: Licznik modulo 10 dwukierunkowy]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15371&amp;p=160629#p160629"><![CDATA[
Jeszcze jedno pytanie, jak zrobić licznik modulo10 tak żeby po naciśnięciu &quot;button1&quot; zliczał do góry, a po naciśnięciu &quot;button2&quot; do dołu? Próbowałem dwa razy wykorzystać polecenie rising_edge w jednym procesie, ale nie wiem czy w tym języku takie coś można wykonać.<br />(Ps. Post pod postem, ale tu chodzi o inne rozwiązanie tego zadania i nie chciałem żeby wyszedł z tego jeden duży post z trzema różnymi kodami programu).<br /><br />Ten program działa dobrze:<br />[syntax=vhdl]library IEEE;<br />use IEEE.std_logic_1164.all, IEEE.numeric_std.all;<br /><br />ENTITY counter is <br />generic (n:natural :=4);<br />port(<br />button1:in std_logic;<br />clear:in std_logic;<br />C: out std_logic;<br />OUT1: out std_logic_vector(n-1 downto 0)<br />);<br />END counter;<br /><br />ARCHITECTURE beh of counter is<br />begin<br /> <br />p0:process (button1, clear) is<br />variable licz: unsigned (n-1 downto 0);<br />begin<br />if clear = '1' then<br />licz:= (others=&gt;'0');<br />elsif rising_edge (button1) then<br />licz:=licz+1;<br />if licz=10 then<br />licz:=(others=&gt;'0');<br />C&lt;='1';<br />else C&lt;='0';<br />end if;<br />end if;<br /><br />OUT1&lt;=std_logic_vector(licz);<br />end process p0;<br />end architecture beh;[/syntax]<br /><br />Ten natomiast nie działa w ogóle<br />[syntax=vhdl]library IEEE;<br />use IEEE.std_logic_1164.all, IEEE.numeric_std.all;<br /><br />ENTITY counter is <br />generic (n:natural :=4);<br />port(<br />button1:in std_logic;<br />button2:in std_logic;<br />clear:in std_logic;<br />C: out std_logic;<br />OUT1: out std_logic_vector(n-1 downto 0)<br />);<br />END counter;<br /><br />ARCHITECTURE beh of counter is<br />begin<br /> <br />p0:process (button1, clear) is<br />variable licz: unsigned (n-1 downto 0);<br />begin<br />if clear = '1' then<br />licz:= (others=&gt;'0');<br />elsif rising_edge (button1) then<br />licz:=licz+1;<br />if licz=10 then<br />licz:=(others=&gt;'0');<br />C&lt;='1';<br />else C&lt;='0';<br />end if;<br /><br />elsif rising_edge (button2) then<br />licz:=licz-1;<br />if licz=0 then<br />licz:=(others=&gt;'1');<br />C&lt;='1';<br />else C&lt;='0';<br />end if;<br />end if;<br />OUT1&lt;=std_logic_vector(licz);<br />end process p0;<br />end architecture beh;[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=8145">bastik</a> — 14 maja 2016, o 21:30</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[bastik]]></name></author>
<updated>2016-05-14T14:18:58+01:00</updated>
<published>2016-05-14T14:18:58+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15371&amp;p=160595#p160595</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15371&amp;p=160595#p160595"/>
<title type="html"><![CDATA[Re: VHDL: Licznik modulo 10 dwukierunkowy]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15371&amp;p=160595#p160595"><![CDATA[
Poprawiłem działa, dziękuje za pomoc <img src="https://forum.atnel.pl/images/smilies/icon_e_smile.gif" alt=":)" title="Szczęśliwy" /> <br />[syntax=vhdl]library ieee;<br />use ieee.std_logic_1164.all;<br />use ieee.numeric_std.all;<br />use ieee.std_logic_unsigned.all;<br /> <br />entity licznik is<br />generic (n: natural :=4);<br />        port (<br />                Clk: in std_ulogic;<br />                Rst: in std_ulogic;<br />                Dir: in std_ulogic;<br />                Licz: out std_ulogic_vector(n-1 downto 0));<br />end entity licznik;<br /> <br />architecture beh of licznik is<br />begin<br />        process (Rst, Dir, Clk)<br />        variable Q: unsigned (n-1 downto 0);<br />begin<br />        if Rst = '1' then Q:= &quot;0000&quot;;<br />        elsif rising_edge (Clk) then<br />        if Dir ='1' then<br />Q:=Q+1;<br />if Q=10 then Q:= &quot;0000&quot;;<br />end if;<br />else<br />Q:=Q-1;<br />if Q=15 then Q:= &quot;1001&quot;;<br />end if;<br />       end if;<br />       end if;<br />Licz &lt;= std_ulogic_vector(Q);<br />end process;<br />end architecture beh;[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=8145">bastik</a> — 14 maja 2016, o 14:18</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[rskup]]></name></author>
<updated>2016-05-13T21:14:24+01:00</updated>
<published>2016-05-13T21:14:24+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15371&amp;p=160564#p160564</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15371&amp;p=160564#p160564"/>
<title type="html"><![CDATA[Re: VHDL: Licznik modulo 10 dwukierunkowy]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15371&amp;p=160564#p160564"><![CDATA[
Jakbys formatował kod, to byś od razu zauważył niepoprawne zagnieżdzenie warunków:<br />[syntax=vhdl]if Dir ='1' then<br />        Q:=Q+1;<br />        if Q=10 then Q:= &quot;0000&quot;;<br />        end if;<br />        if Dir ='0' then<br />                Q:=Q-1;<br />                if Q=0 then Q:= &quot;1010&quot;;<br />                end if;<br />        end if;<br />end if;[/syntax]<br /><br />-- <br />Pozdrawiam,<br />Robert<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=3427">rskup</a> — 13 maja 2016, o 21:14</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[bastik]]></name></author>
<updated>2016-05-13T21:05:34+01:00</updated>
<published>2016-05-13T21:05:34+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15371&amp;p=160562#p160562</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15371&amp;p=160562#p160562"/>
<title type="html"><![CDATA[VHDL: Licznik modulo 10 dwukierunkowy]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15371&amp;p=160562#p160562"><![CDATA[
Witam<br />Otóż chce zaprojektować blok licznika modulo10 w języku VHDL, zliczanie od 0 do 9 działa, reset też działa, a po zmianie kierunku (Dir=0) nie chce działać. I w związku z tym mam prośbę czy ktoś mógłby sprawdzić kod i pomóc mi znaleźć błąd? <br />[syntax=vhdl]library ieee;<br />use ieee.std_logic_1164.all;<br />use ieee.numeric_std.all;<br />use ieee.std_logic_unsigned.all;<br /><br />entity licznik is<br />generic (n: natural :=4);<br />port (<br />Clk: in std_ulogic;<br />Rst: in std_ulogic;<br />Dir: in std_ulogic;<br />Licz: out std_ulogic_vector(n-1 downto 0));<br />end entity licznik;<br /><br />architecture beh of licznik is<br />begin<br />process (Rst, Dir, Clk)<br />variable Q: unsigned (n-1 downto 0);<br />begin<br />if Rst = '0' then Q:= &quot;0000&quot;;<br />elsif rising_edge (Clk) then <br />if Dir ='1' then <br />Q:=Q+1;<br />if Q=10 then Q:= &quot;0000&quot;;<br />end if;<br />if Dir ='0' then<br />Q:=Q-1;<br />if Q=0 then Q:= &quot;1010&quot;;<br />end if;<br />end if;<br />end if;<br />end if;<br />Licz &lt;= std_ulogic_vector(Q);<br />end process;<br />end architecture beh;[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=8145">bastik</a> — 13 maja 2016, o 21:05</p><hr />
]]></content>
</entry>
</feed>