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"> </p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">#include <genlib.h></p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"> <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"> </span>DEF_LOFIG("counter");</p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes"> </span></p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes"> </span>LOCON("E",<span style="mso-spacerun: yes"> </span>IN, "E");</p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes"> </span>LOCON("ck",<span style="mso-spacerun: yes"> </span>IN, "ck");</p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes"> </span>LOCON("res",<span style="mso-spacerun: yes"> </span>IN, "res");</p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes"> </span>LOCON("vdd",<span style="mso-spacerun: yes"> </span>IN, "vdd");</p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes"> </span>LOCON("vss",<span style="mso-spacerun: yes"> </span>IN, "vss");</p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes"> </span>LOCON("A[0:3]",<span style="mso-spacerun: yes"> </span>INOUT, "A[0:3]");</p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes"> </span>LOCON("q_c",<span style="mso-spacerun: yes"> </span>OUT, "q_c");</p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"> <o:p> </o:p> </p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS("a2_y","an00", "E","A[0]", "c_1", "vdd" ,"vss",0);</p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS("a2_y","an01", "c_1","A[1]", "c_2", "vdd" ,"vss",0);</p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS("a2_y","an02", "c_2","A[2]", "c_3", "vdd" ,"vss",0);</p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS("a2_y","an03", "c_3","A[3]", "q_c", "vdd" ,"vss",0);</p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"> <o:p> </o:p> </p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS("xr2_y","xr00", "E","A[0]", "d_1", "vdd" ,"vss",0);</p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS("xr2_y","xr01", "c_1","A[1]", "d_2", "vdd" ,"vss",0);</p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS("xr2_y","xr02", "c_2","A[2]", "d_3", "vdd" ,"vss",0);</p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS("xr2_y","xr03", "c_3","A[3]", "d_4", "vdd" ,"vss",0);</p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"> <o:p> </o:p> </p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"> <o:p> </o:p> </p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS("dffres", "dff0", "d_1", "ck","res","A[0]","vdd","vss",0);</p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS("dffres", "dff1", "d_2", "ck","res","A[1]","vdd","vss",0);</p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS("dffres", "dff2", "d_3", "ck","res","A[2]","vdd","vss",0);</p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">LOINS("dffres", "dff3", "d_4", "ck","res","A[3]","vdd","vss",0);</p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"> <o:p> </o:p> </p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"> <o:p> </o:p> </p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes"> </span>SAVE_LOFIG();</p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0"><span style="mso-spacerun: yes"> </span>exit(0);</p> <p class="MsoNormal" style="margin-top: 0; margin-bottom: 0">}</p> </body> </html>