ver_dffeveri.html

来自「verilog的入门级别的例子(转载)」· HTML 代码 · 共 307 行

HTML
307
字号
<html><head>	<title>Verilog HDL: Instantiating a DFFE</title>	<meta name="keywords" content="support, technical support, Atlas, solutions, devices, example, arithmetic">	<meta name="description" content="Altera offers users design examples for use in designs for Altera devices.">	<meta name="date" content="2001-11-09">	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">	<link rel="stylesheet" type="text/css" href="/js.lib/style.css">	<link rel="stylesheet" type="text/css" href="/js.lib/style_form.css"></head><!--stopindex--><BODY BGCOLOR="#ffffff" marginwidth="0" marginheight="0" rightmargin="0" topmargin="0" leftmargin="0"><!-- Toolbar Header --><table cellSpacing=0 cellPadding=0 width="100%" border=0 nowrap><tr>	<td><table width="100%" border="0" cellspacing="0" cellpadding="0" nowrap><tr>	<td bgcolor="#0182C4" align="left"><img src="/common/template/altera_left.jpg" width="578" height="60" usemap="#banner_l" border="0" align="left" alt="Altera Homepage"><map name="banner_l"><area shape="rect" coords="9,16,158,55" href="/index.jsp"></map></td><td bgcolor="#0182C4" align="right"><img src="/common/template/altera_right.gif" width="181" height="62" usemap="#altera_right" border="0" alt="Altera Quicklinks"><map name="altera_right"><area shape="rect" coords="5,8,54,54" href="/support/software/sof-download_center.html" alt="Download" title="Download"><area shape="rect" coords="63,11,110,54" href="/support/licensing/lic-index.html" alt="Licensing" title="Licensing"><area shape="rect" coords="122,10,170,56" href="/literature/lit-index.html" alt="Literature" title="Literature"></map></td></tr></table><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr>    <td bgcolor="#0182C4" height="2" width="161">&nbsp;</td><!-- begin top level navigation (top) --><td bgcolor="#000000" height="2" colspan="3"><img src="/common/template/support.gif" width="617" height="19" usemap="#support" border="0" alt="Global Navigation Bar"><map name="support"><area shape="rect" coords="0,0,54,19" href="/index.jsp" alt="Altera Home"><area shape="rect" coords="56,0,127,19" href="/products/prd-index.html" alt="Altera Products"><area shape="rect" coords="130,0,198,19" href="/support/spt-index.html" alt="Altera Support Center"><area shape="rect" coords="200,0,315,19" href="/solutions/sln-index.html" alt="Altera System Solutions"><area shape="rect" coords="318,0,442,19" href="/education/edu-index.html" alt="Altera Education"><area shape="rect" coords="445,0,534,19" href="http://buy.altera.com/ecommerce/index.html" alt="Altera Buy On-Line"><area shape="rect" coords="538,0,608,19" href="/corporate/crp-index.html" alt="Altera Corporate"></map></td><!-- end top level navigation (top) --></tr><tr>    <td bgcolor="#e0e0e0" height="2"><img src="/common/template/search.gif" width="161" height="19" alt="Search Here" border="0"></td><!-- begin second level navigation (top) --><td bgcolor="#747474" height="2" colspan="3"><img src="/common/template/support_examples.gif" width="617" height="19" usemap="#support_examples" border="0" alt="Second Level Navigation Bar"><map name="support_examples"><area shape="rect" coords="0,2,87,17" href="http://www.altera.com/mysupport" alt="Altera mySupport"><area shape="rect" coords="92,0,224,18" href="/support/kdb/spt-search_kdb.html" alt="Knowledge Database"><area shape="rect" coords="231,0,305,19" href="/support/software/sof-index.html" alt="Software"><area shape="rect" coords="308,1,381,18" href="/support/devices/dvs-index.html" alt="Altera Devices"><area shape="rect" coords="390,1,524,21" href="/support/examples/exm-index.html" alt="Design Examples"></map></td><!-- end second level navigation (top) --></tr><tr> 	<td valign="top" bgcolor="#e0e0e0" width="161" height="1%" align="center"> 	<script language="JavaScript">			document.writeln("<form name='search_altera' method=GET accept-charset='iso-8859-1' action='/cgi-bin/devsearch.pl'>");			document.writeln("	<table border=0 cellpadding=3 cellspacing=0 bgcolor=#e0e0e0>");			document.writeln("	<tr> ");			document.writeln("		<td valign=middle height='1'>");			document.writeln("			<input type=hidden name=col value='corp'>");			document.write("			<input type=text name=qt maxlength=180 size=");			if (navigator.appName.toUpperCase().indexOf("MICROSOFT")>=0) {				document.writeln("11>");			} else {				document.writeln("6>");			}			document.writeln("<input type=image value=GO name='submit' src='/common/template/go.gif' width='27' height='27' align='absmiddle' alt='GO' border='0'>");			document.writeln("		</td>");			document.writeln("	</tr>");			document.writeln("<tr><td>&nbsp;<font class='footer'><a href='http://search.altera.com/?ql=a'>Advanced</a>");			document.writeln("&nbsp;&nbsp;&nbsp;&nbsp;<a href='http://search.altera.com/help/?la=en'>Help</a></font></td></tr>");			document.writeln("	</table>");			document.writeln("</form>");	</script>	<noscript>                        <form name="search_altera" method=GET accept-charset="iso-8859-1" action="/cgi-bin/devsearch.pl">                              <table border=0 cellpadding=3 cellspacing=0 bgcolor=#e0e0e0>                              <tr>                                      <td valign=middle height="1">                                              <input type=hidden name=col value="corp">                                              <input type=text name=qt maxlength=180 size=6>                                              <input type=image value=GO name="submit" src="/common/template/go.gif" width="27" height="27" align="absmiddle" alt="GO" border="0">                                      </td>                              </tr>                        <tr><td>&nbsp;<font class="footer"><a href=http://search.altera.com/?ql=a>Advanced</a>                        &nbsp;&nbsp;&nbsp;<a href=http://search.altera.com/help/?la=en>Help</a></font></td></tr>                              </table>                        </form>        	</noscript>		    <p><table border=0 cellspacing=0 cellpadding=0>	<tr> 		<td bgcolor="#e0e0e0" valign="top"> 			<table border=0 cellspacing=0 cellpadding=0 width=161 bgcolor="#e0e0e0" style="br {line-height: 6pt;}">			<tr> 				<td rowspan="50"><img src="/common/template/spacer.gif" width="4" height="4" alt="" border="0"></td>				<td></td>			</tr><!-- begin left navigation --><tr>	<td class="category"><br><b>Devices</b></td></tr><tr>	<td class="menu">&nbsp;&nbsp;<a href="/support/examples/stratix/exm-stratix.html" class="menu">Stratix</a></td></tr><tr>	<td class="menu">&nbsp;&nbsp;<a href="/support/examples/cyclone/exm-cyclone.html" class="menu">Cyclone</a></td></tr><tr>	<td class="menu">&nbsp;&nbsp;<a href="/support/examples/exm-apex2.html" class="menu">APEX II</a></td></tr><tr>	<td class="category"><br><b>Functionality</b></td></tr><tr>	<td class="menu">&nbsp;&nbsp;<a href="/support/examples/exm-arithmetic.html" class="menu">Arithmetic</a></td></tr><tr>	<td class="menu">&nbsp;&nbsp;<a href="/support/examples/exm-memory.html" class="menu">Memory</a></td></tr><tr>	<td class="menu">&nbsp;&nbsp;<a href="/support/examples/exm-bus_io.html" class="menu">Bus & I/O</a></td></tr><tr>	<td class="menu">&nbsp;&nbsp;<a href="/support/examples/exm-logic.html" class="menu">Logic</a></td></tr><tr>	<td class="menu">&nbsp;&nbsp;<a href="/support/examples/dsp/exm-dsp.html" class="menu">DSP</a></td></tr><tr>	<td class="category"><br><b>Entry Method</b></td></tr><tr>	<td class="menu">&nbsp;&nbsp;<a href="/support/examples/quartus/quartus.html" class="menu">Quartus II Projects</a></td></tr><tr>	<td class="menu">&nbsp;&nbsp;<a href="/support/examples/tcl/tcl.html" class="menu">TCL</a></td></tr><tr>	<td class="menu">&nbsp;&nbsp;<a href="/support/examples/vhdl/vhdl.html" class="menu">VHDL</a></td></tr><tr>	<td class="menu" bgcolor="white">&nbsp;&nbsp;<a href="/support/examples/verilog/verilog.html" class="menu"><font color="#ff6600">Verilog HDL</font></a></td></tr><tr>	<td class="submenu" bgcolor="white">	</td><tr><tr>	<td class="menu">&nbsp;&nbsp;<a href="/support/examples/ged/ged.html" class="menu">Graphic Editor</a></td></tr><tr>	<td class="menu">&nbsp;&nbsp;<a href="/support/examples/ahdl/ahdl.html" class="menu">AHDL</a></td></tr><!-- end left navigation -->            </table>		</td>	</tr>	</table></p>	</td>	<td rowspan="3" width="15"><img src="/common/template/spacer.gif" width="15" height="15" alt="" border="0"></td>    <td rowspan="3" valign="top" bgcolor="#ffffff"><br>	<!--startindex--><!-- begin content -->	<!-- begin content --><H2>Verilog HDL: Instantiating a DFFE</H2><P>This example describes how to generate a D flipflop with enable (DFFE) behaviorally with asynchronous preset and reset signals. Both the preset and reset signals are active low, controlling the output of the DFFE whenever either signal goes low.</P>For more information on using this example in your project, go to:<UL TYPE=DISC>	<LI><A HREF="verilog.html#using">How to Use Verilog HDL Examples</A> 		<LI>MAX+PLUS&nbsp;II Help</UL></P><HR noshade><P><B><I>dffeveri.v</I></B></P><PRE>module dffeveri (q, d, clk, ena, rsn, prn);// port declarationinput   d, clk, ena, rsn, prn;output  q;reg     q;always @ (posedge clk or negedge rsn or negedge prn) begin//asynchronous active-low preset    if (~prn)        begin        if (rsn)            q = 1'b1;        else            q = 1'bx;        end//asynchronous active-low reset     else if (~rsn)        q = 1'b0;//enable     else if (ena)		q = d;endendmodule</PRE><HR noshade><h2>Feedback</h2><p>Did this information help you?</p><p>If no, please log onto <a href="https://mysupport.altera.com/eservice/">mySupport</a> to file a technical request or enhancement.</p><p><hr noshade></p><font size="-1">Altera does not warrant that this solution will work for the customer's intended purpose and disclaims all liability for use of or reliance on the solution.</font><!-- end content --><!--stopindex-->		<p>&nbsp;</p>    </td>	<td rowspan="3" width="15"><img src="/common/template/spacer.gif" width="15" height="15" alt="" border="0"></td>	</tr>  <tr valign="top">     <td bgcolor="#e0e0e0" valign="top" width="161"> 	&nbsp;	</td></tr><tr> 	<td bgcolor=#e0e0e0 valign="bottom" width="161" height="2">       <p class="footer">	  <br>&nbsp;&nbsp;Contact Us<br>		&nbsp;&nbsp;<a href="/corporate/contact/info/con-feedback_form.jsp">Please Give Us Feedback</a><br>		&nbsp;&nbsp;<a href="/corporate/contact/signup/con-signup.jsp">Sign Up for E-mail Updates</a></p>	</td></tr><!-- Footer Information --> <tr><td bgcolor="#0182C4" colspan="4" align="right"><img src="/common/template/footer_user.gif" width="761" height="18" usemap="#footer_user" border="0" alt="footer"><map name="footer_user"><area shape="rect" coords="521,3,578,16" href="/common/new_user.html" alt="New User to the Altera Web Site" title="New User to the Altera Web Site"><area shape="rect" coords="587,4,631,15" href="/common/sitemap.html" alt="Altera Site Map" title="Altera Site Map"><area shape="rect" coords="643,3,684,14" href="/common/privacy.html" alt="Altera Privacy Policy" title="Altera Privacy Policy"><area shape="rect" coords="690,3,757,14" href="/common/legal.html" alt="Altera Legal Notice" title="Altera Legal Notice"></map></td> </tr><tr>	<td width="161">&nbsp;</td>	<td colspan="3" width="100%"class="footer"><br><!-- begin top level navigation (bottom) --><a href=/index.jsp>Home</a>&nbsp;|&nbsp;<a href=/products/prd-index.html>Products</a>&nbsp;|&nbsp;<a href=/support/spt-index.html>Support</a>&nbsp;|&nbsp;<a href=/solutions/sln-index.html>System Solutions</a>&nbsp;|&nbsp;<a href=/education/edu-index.html>Education & Events</a>&nbsp;|&nbsp;<a href=http://buy.altera.com/ecommerce/>Buy On-Line</a>&nbsp;|&nbsp;<a href=/corporate/crp-index.html>Corporate</a><br><!-- end top level navigation (bottom) --> <!-- begin second level navigation (bottom) --><a href=/mysupport >mySupport</a>&nbsp;|&nbsp;<a href=/support/kdb/spt-search_kdb.html>Knowledge Database</a>&nbsp;|&nbsp;<a href=/support/software/sof-index.html>Software</a>&nbsp;|&nbsp;<a href=/support/devices/dvs-index.html>Devices</a>&nbsp;|&nbsp;<a href=/support/examples/exm-index.html>Design Examples</a><br><!-- end second level navigation (bottom) -->		<p class="footer">Copyright &copy; 1995 - 2002 Altera Corporation, 101 Innovation Drive, San Jose, California 95134, USA.</p>		</td>	</tr>	</table>	</td></tr></table><!--startindex--></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?