OpenCores
URL https://opencores.org/ocsvn/lcd/lcd/trunk

Subversion Repositories lcd

[/] [lcd/] [web_uploads/] [counter.shtml] - Rev 6

Compare with Previous | Blame | View Log

<html>
 
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>4-bit Counter</title>
</head>
 
<body bgcolor="#99CCFF">
 
<p class="MsoNormal"><font size="4"><b>.c file of 4-bit counter</b></font></p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">#include &lt;genlib.h&gt;</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">&nbsp;<o:p>
</o:p>
</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">main()</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">{</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes">&nbsp;&nbsp;
</span>DEF_LOFIG(&quot;counter&quot;);</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes">&nbsp;&nbsp;</span></p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes">&nbsp;&nbsp;
</span>LOCON(&quot;E&quot;,<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>IN, &quot;E&quot;);</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes">&nbsp;&nbsp;
</span>LOCON(&quot;ck&quot;,<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>IN, &quot;ck&quot;);</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes">&nbsp;&nbsp;
</span>LOCON(&quot;res&quot;,<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>IN, &quot;res&quot;);</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes">&nbsp;&nbsp;
</span>LOCON(&quot;vdd&quot;,<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>IN, &quot;vdd&quot;);</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes">&nbsp;&nbsp;
</span>LOCON(&quot;vss&quot;,<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>IN, &quot;vss&quot;);</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes">&nbsp;&nbsp;
</span>LOCON(&quot;A[0:3]&quot;,<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>INOUT, &quot;A[0:3]&quot;);</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes">&nbsp;&nbsp;
</span>LOCON(&quot;q_c&quot;,<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>OUT, &quot;q_c&quot;);</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">&nbsp;<o:p>
</o:p>
</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS(&quot;a2_y&quot;,&quot;an00&quot;,
&quot;E&quot;,&quot;A[0]&quot;, &quot;c_1&quot;, &quot;vdd&quot; ,&quot;vss&quot;,0);</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS(&quot;a2_y&quot;,&quot;an01&quot;,
&quot;c_1&quot;,&quot;A[1]&quot;, &quot;c_2&quot;, &quot;vdd&quot; ,&quot;vss&quot;,0);</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS(&quot;a2_y&quot;,&quot;an02&quot;,
&quot;c_2&quot;,&quot;A[2]&quot;, &quot;c_3&quot;, &quot;vdd&quot; ,&quot;vss&quot;,0);</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS(&quot;a2_y&quot;,&quot;an03&quot;,
&quot;c_3&quot;,&quot;A[3]&quot;, &quot;q_c&quot;, &quot;vdd&quot; ,&quot;vss&quot;,0);</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">&nbsp;<o:p>
</o:p>
</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS(&quot;xr2_y&quot;,&quot;xr00&quot;,
&quot;E&quot;,&quot;A[0]&quot;, &quot;d_1&quot;, &quot;vdd&quot; ,&quot;vss&quot;,0);</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS(&quot;xr2_y&quot;,&quot;xr01&quot;,
&quot;c_1&quot;,&quot;A[1]&quot;, &quot;d_2&quot;, &quot;vdd&quot; ,&quot;vss&quot;,0);</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS(&quot;xr2_y&quot;,&quot;xr02&quot;,
&quot;c_2&quot;,&quot;A[2]&quot;, &quot;d_3&quot;, &quot;vdd&quot; ,&quot;vss&quot;,0);</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS(&quot;xr2_y&quot;,&quot;xr03&quot;,
&quot;c_3&quot;,&quot;A[3]&quot;, &quot;d_4&quot;, &quot;vdd&quot; ,&quot;vss&quot;,0);</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">&nbsp;<o:p>
</o:p>
</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">&nbsp;<o:p>
</o:p>
</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS(&quot;dffres&quot;,
&quot;dff0&quot;, &quot;d_1&quot;, &quot;ck&quot;,&quot;res&quot;,&quot;A[0]&quot;,&quot;vdd&quot;,&quot;vss&quot;,0);</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS(&quot;dffres&quot;,
&quot;dff1&quot;, &quot;d_2&quot;, &quot;ck&quot;,&quot;res&quot;,&quot;A[1]&quot;,&quot;vdd&quot;,&quot;vss&quot;,0);</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS(&quot;dffres&quot;,
&quot;dff2&quot;, &quot;d_3&quot;, &quot;ck&quot;,&quot;res&quot;,&quot;A[2]&quot;,&quot;vdd&quot;,&quot;vss&quot;,0);</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS(&quot;dffres&quot;,
&quot;dff3&quot;, &quot;d_4&quot;, &quot;ck&quot;,&quot;res&quot;,&quot;A[3]&quot;,&quot;vdd&quot;,&quot;vss&quot;,0);</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">&nbsp;<o:p>
</o:p>
</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">&nbsp;<o:p>
</o:p>
</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes">&nbsp;&nbsp;
</span>SAVE_LOFIG();</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes">&nbsp;&nbsp;
</span>exit(0);</p>
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">}</p>
 
</body>
 
</html>
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.