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

Subversion Repositories lcd

[/] [lcd/] [web_uploads/] [counter.shtml] - Blame information for rev 6

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 6 root
<html>
2
 
3
<head>
4
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
5
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
6
<meta name="ProgId" content="FrontPage.Editor.Document">
7
<title>4-bit Counter</title>
8
</head>
9
 
10
<body bgcolor="#99CCFF">
11
 
12
<p class="MsoNormal"><font size="4"><b>.c file of 4-bit counter</b></font></p>
13
<p class="MsoNormal">&nbsp;</p>
14
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">#include &lt;genlib.h&gt;</p>
15
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">&nbsp;<o:p>
16
</o:p>
17
</p>
18
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">main()</p>
19
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">{</p>
20
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes">&nbsp;&nbsp;
21
</span>DEF_LOFIG(&quot;counter&quot;);</p>
22
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes">&nbsp;&nbsp;</span></p>
23
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes">&nbsp;&nbsp;
24
</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;
25
</span>IN, &quot;E&quot;);</p>
26
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes">&nbsp;&nbsp;
27
</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;
28
</span>IN, &quot;ck&quot;);</p>
29
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes">&nbsp;&nbsp;
30
</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;
31
</span>IN, &quot;res&quot;);</p>
32
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes">&nbsp;&nbsp;
33
</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;
34
</span>IN, &quot;vdd&quot;);</p>
35
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes">&nbsp;&nbsp;
36
</span>LOCON(&quot;vss&quot;,<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
37
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>IN, &quot;vss&quot;);</p>
38
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes">&nbsp;&nbsp;
39
</span>LOCON(&quot;A[0:3]&quot;,<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
40
</span>INOUT, &quot;A[0:3]&quot;);</p>
41
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes">&nbsp;&nbsp;
42
</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;
43
</span>OUT, &quot;q_c&quot;);</p>
44
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">&nbsp;<o:p>
45
</o:p>
46
</p>
47
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS(&quot;a2_y&quot;,&quot;an00&quot;,
48
&quot;E&quot;,&quot;A[0]&quot;, &quot;c_1&quot;, &quot;vdd&quot; ,&quot;vss&quot;,0);</p>
49
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS(&quot;a2_y&quot;,&quot;an01&quot;,
50
&quot;c_1&quot;,&quot;A[1]&quot;, &quot;c_2&quot;, &quot;vdd&quot; ,&quot;vss&quot;,0);</p>
51
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS(&quot;a2_y&quot;,&quot;an02&quot;,
52
&quot;c_2&quot;,&quot;A[2]&quot;, &quot;c_3&quot;, &quot;vdd&quot; ,&quot;vss&quot;,0);</p>
53
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS(&quot;a2_y&quot;,&quot;an03&quot;,
54
&quot;c_3&quot;,&quot;A[3]&quot;, &quot;q_c&quot;, &quot;vdd&quot; ,&quot;vss&quot;,0);</p>
55
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">&nbsp;<o:p>
56
</o:p>
57
</p>
58
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS(&quot;xr2_y&quot;,&quot;xr00&quot;,
59
&quot;E&quot;,&quot;A[0]&quot;, &quot;d_1&quot;, &quot;vdd&quot; ,&quot;vss&quot;,0);</p>
60
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS(&quot;xr2_y&quot;,&quot;xr01&quot;,
61
&quot;c_1&quot;,&quot;A[1]&quot;, &quot;d_2&quot;, &quot;vdd&quot; ,&quot;vss&quot;,0);</p>
62
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS(&quot;xr2_y&quot;,&quot;xr02&quot;,
63
&quot;c_2&quot;,&quot;A[2]&quot;, &quot;d_3&quot;, &quot;vdd&quot; ,&quot;vss&quot;,0);</p>
64
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS(&quot;xr2_y&quot;,&quot;xr03&quot;,
65
&quot;c_3&quot;,&quot;A[3]&quot;, &quot;d_4&quot;, &quot;vdd&quot; ,&quot;vss&quot;,0);</p>
66
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">&nbsp;<o:p>
67
</o:p>
68
</p>
69
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">&nbsp;<o:p>
70
</o:p>
71
</p>
72
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS(&quot;dffres&quot;,
73
&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>
74
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS(&quot;dffres&quot;,
75
&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>
76
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS(&quot;dffres&quot;,
77
&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>
78
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS(&quot;dffres&quot;,
79
&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>
80
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">&nbsp;<o:p>
81
</o:p>
82
</p>
83
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">&nbsp;<o:p>
84
</o:p>
85
</p>
86
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes">&nbsp;&nbsp;
87
</span>SAVE_LOFIG();</p>
88
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes">&nbsp;&nbsp;
89
</span>exit(0);</p>
90
<p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">}</p>
91
 
92
</body>
93
 
94
</html>

powered by: WebSVN 2.1.0

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