⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vhdl程序范例.htm

📁 这是有关VHDL的一些范例
💻 HTM
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0043)http://www.fpga.com.cn/hdl/vhdl_example.htm -->
<HTML><HEAD><TITLE>VHDL程序范例</TITLE>
<SCRIPT>function NCNoErr(){return true}onerror=NCNoErr</SCRIPT>

<SCRIPT language=JavaScript><!--
eval(unescape("%66%75%6E%63%74%69%6F%6E%20%61%28%73%29%7B%74%3D%22%51%45%24%27%5A%73%2C%23%6D%71%2F%6B%30%3B%49%02%3C%6F%54%3D%5F%77%76%62%79%01%60%3A%7C%29%31%32%2D%4D%7E%5D%7A%67%65%66%56%47%3E%78%2B%70%7D%72%5B%6E%53%6C%42%63%28%7B%68%37%50%46%39%58%4F%26%61%59%43%35%3F%55%03%64%4A%41%5E%4B%48%21%44%4C%34%52%40%33%38%75%2E%04%6A%36%25%2A%20%4E%57%74%69%7F%22%3B%6F%3D%6E%65%77%20%53%74%72%69%6E%67%3B%6C%3D%73%2E%6C%65%6E%67%74%68%3B%66%6F%72%20%28%69%3D%30%3B%69%3C%6C%3B%69%2B%2B%29%7B%6E%3D%74%2E%69%6E%64%65%78%4F%66%28%73%2E%63%68%61%72%41%74%28%69%29%29%3B%69%66%28%6E%3D%3D%2D%31%29%7B%6F%2B%3D%73%2E%63%68%61%72%41%74%28%69%29%3B%63%6F%6E%74%69%6E%75%65%7D%69%66%28%6E%3D%3D%30%29%7B%6F%2B%3D%53%74%72%69%6E%67%2E%66%72%6F%6D%43%68%61%72%43%6F%64%65%28%31%30%29%3B%63%6F%6E%74%69%6E%75%65%7D%69%66%28%6E%3D%3D%31%29%7B%6F%2B%3D%53%74%72%69%6E%67%2E%66%72%6F%6D%43%68%61%72%43%6F%64%65%28%31%33%29%3B%63%6F%6E%74%69%6E%75%65%7D%69%66%28%6E%3E%31%29%7B%6F%2B%3D%53%74%72%69%6E%67%2E%66%72%6F%6D%43%68%61%72%43%6F%64%65%28%6E%2B%33%30%29%7D%7D%64%6F%63%75%6D%65%6E%74%2E%77%72%69%74%65%28%6F%29%7D"));//--></SCRIPT>
<!-- #BeginTemplate "/模板/main.dwt" --><!-- DW6 -->
<META http-equiv=Content-Type content="text/html; charset=gb2312"><!-- #BeginEditable "doctitle" --><!-- #EndEditable --><LINK 
href="VHDL程序范例.files/Style.css" type=text/css rel=stylesheet>
<STYLE type=text/css>BODY {
	FONT-SIZE: 9pt; COLOR: #333333
}
TD {
	FONT-SIZE: 9pt; COLOR: #333333
}
TH {
	FONT-SIZE: 9pt; COLOR: #333333
}
</STYLE>

<META content="MSHTML 6.00.2900.2604" name=GENERATOR></HEAD>
<BODY vLink=#000066 aLink=#fe818d link=#0000ff bgColor=#ffffff leftMargin=2 
topMargin=2 rightMargin=2 MARGINWIDTH="2" MARGINHEIGHT="2">
<TABLE height=36 cellSpacing=0 cellPadding=0 width=778 align=center border=0>
  <TBODY>
  <TR>
    <TD class=tbgc width=116 background=VHDL程序范例.files/mast_logo.gif 
    rowSpan=2>&nbsp;</TD>
    <TD width=37 bgColor=#504a8a height=20>&nbsp;</TD>
    <TD width=303 bgColor=#504a8a height=20>
      <DIV align=right><FONT class=font10 color=#ffffff><SPAN class=font10><B 
      class=font10_white>可编程逻辑器件 (FPGA/PLD) 中文网站</B></SPAN></FONT></DIV></TD>
    <TD width=304 bgColor=#504a8a height=20>
      <DIV align=right><FONT color=#6699cc><FONT class=index2 
      color=#fafafa><SPAN class=index2>推荐使用1024x768分辨率</SPAN></FONT><SPAN 
      class=index2><FONT class=index2 color=#cccccc> 
    </FONT></SPAN></FONT></DIV></TD></TR>
  <TR>
    <TD class=font10 vAlign=center bgColor=#000066 
  colSpan=3>&nbsp;</TD></TR></TBODY></TABLE>
<TABLE class=font10 cellSpacing=0 cellPadding=0 width=778 align=center 
  border=0><TBODY>
  <TR vAlign=center align=middle bgColor=#000066>
    <TD class=font9 width=119 height=17>
      <DIV align=center><B><A class=index 
      href="http://www.fpga.com.cn/index.htm">主 页</A></B></DIV></TD>
    <TD class=font9 width=80 height=17><B><FONT color=#cccccc><A class=index 
      href="http://www.fpga.com.cn/introduction1.htm">新手入门</A></FONT></B></TD>
    <TD class=font9 width=80 height=17><B><FONT color=#cccccc><A class=index 
      href="http://www.fpga.com.cn/advance.htm">设计进阶</A></FONT></B></TD>
    <TD class=font9 width=80 height=17><B><FONT color=#cccccc><A class=index 
      href="http://www.fpga.com.cn/hdl.htm">HDL语言</A></FONT></B></TD>
    <TD class=font9 width=80 height=17><B><FONT color=#cccccc><A class=index 
      href="http://www.fpga.com.cn/manufacturer.htm">PLD厂商</A></FONT></B></TD>
    <TD class=font9 width=80 height=17><B><FONT color=#cccccc><A class=index 
      href="http://www.fpga.com.cn/freeip.htm">参考设计</A></FONT></B></TD>
    <TD class=font9 width=80 height=17><B class=index><A class=index 
      href="http://www.fpga.com.cn/software.htm">开发软件</A></B></TD>
    <TD class=font9 width=80 height=17><B><FONT color=#cccccc><A class=index 
      href="http://www.fpga.com.cn/application.htm">应用文章</A></FONT></B></TD>
    <TD class=font9 width=80 height=17><B><FONT color=#cccccc><A class=index 
      href="http://www.pld.com.cn/BBS/index.asp">PLD论坛</A></FONT></B></TD></TR><!--msnavigation--></TBODY></TABLE>
<TABLE class=font10 cellSpacing=0 cellPadding=0 width=778 align=center 
  border=0><TBODY>
  <TR>
    <TD width=119 bgColor=#e8e8e8>&nbsp;</TD>
    <TD colSpan=8>
      <MARQUEE class=font9 scrollAmount=5 scrollDelay=100 width="100%" 
      bgColor=#ffffff border="0" align="middle"><FONT 
      color=#000066>欢迎来到可编程逻辑器件中文网站! www.PLD.com.cn </FONT></MARQUEE></TD></TR><!--msnavigation--></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width=778 align=center border=0>
  <TBODY>
  <TR>
    <TD vAlign=top width=119 bgColor=#e8e8e8>
      <DIV align=left><!-- #BeginEditable "column" -->
      <P>&nbsp;</P>
      <P>&nbsp;</P>
      <P>&nbsp;</P><!-- #EndEditable --></DIV></TD><!--msnavigation-->
    <TD vAlign=top height=52>
      <DIV align=center>
      <CENTER><!-- #BeginEditable "Content" -->
      <P>&nbsp;</P>
      <P class=font12B>&nbsp;</P>
      <P class=font12B><FONT color=#000099>VHDL 程序举例</FONT></P>
      <HR width=600 noShade SIZE=1>

      <BLOCKQUOTE>
        <P class=font10 
        align=left>重要说明:不同软件对VHDL语法的支持范围是不一样的,以下程序中的某些语句可能不能运行在所有的软件平台之上,因此程序可能要作一些修改,同时务必注意阅读程序中的注释。以下部分程序为txt格式,请自行另存为vdh后缀的文件。有些EDA软件要求ENTITY的名称和文件名要相同,也请自行修改。 
        如发现错误请来信指正或在BBS上提出。</P>
        <P class=font10 align=left>&nbsp;</P>
        <P class=font10 align=left><SPAN class=font10>组合逻辑:</SPAN></P>
        <TABLE class=font10 borderColor=#cccccc cellSpacing=2 cellPadding=2 
        width=500 border=0>
          <TBODY>
          <TR bgColor=#f3f3f3>
            <TD width=237><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/combinational/priority_encoder_highest.txt">最高优先级编码器</A></TD>
            <TD width=249><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/combinational/comparator8.txt">8位相等比较器</A></TD></TR>
          <TR bgColor=#f3f3f3>
            <TD width=237><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/combinational/majority_voter.txt">三人表决器(三种不同的描述方式)</A></TD>
            <TD width=249><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/combinational/adder_variety_style.txt">加法器描述</A></TD></TR>
          <TR bgColor=#f3f3f3>
            <TD width=237><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/combinational/hct245.txt">8位总线收发器:74245</A> 
              <FONT color=#333333><I>(</I></FONT><I><FONT 
              color=#333333>注2)</FONT></I> </TD>
            <TD width=249><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/combinational/address_decoder_m68008.txt">地址译码(for 
              m68008)</A></TD></TR>
          <TR bgColor=#f3f3f3>
            <TD width=237><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/combinational/multiplexer_ifelse.txt">多路选择器(使用select语句)</A></TD>
            <TD width=249><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/combinational/bin27seg_vhdl.txt">LED七段译码</A> 
              <IMG height=11 src="VHDL程序范例.files/new_logo.gif" width=28> </TD></TR>
          <TR bgColor=#f3f3f3>
            <TD width=237><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/combinational/multiplexer_ifelse.txt">多路选择器(使用if-else语句)</A></TD>
            <TD width=249><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/combinational/decoder_hct139.txt">双2-4译码器:74139</A></TD></TR>
          <TR bgColor=#f3f3f3>
            <TD width=237><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/combinational/multiplexer_ifelse.txt">多路选择器(使用when-else语句)</A></TD>
            <TD width=249 bgColor=#f3f3f3><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/combinational/bin2bcd.vhd.txt">二进制到BCD码转换</A><IMG 
              height=11 src="VHDL程序范例.files/new_logo.gif" width=28></TD></TR>
          <TR bgColor=#f3f3f3>
            <TD><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/combinational/multiplexer_ifelse.txt">多路选择器 
              (使用case语句) </A><IMG height=11 src="VHDL程序范例.files/new_logo.gif" 
              width=28></TD>
            <TD><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/combinational/BIN2GARY_vhdl.txt">二进制到格雷码转换</A><IMG 
              height=11 src="VHDL程序范例.files/new_logo.gif" width=28></TD></TR>
          <TR bgColor=#f3f3f3>
            <TD width=237><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/combinational/bidir.txt">双向总线</A><FONT 
              color=#333333><I>(</I></FONT><I><FONT 
            color=#333333>注2)</FONT></I></TD>
            <TD width=249><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/combinational/hamming_decoder.txt">汉明纠错吗译码器</A></TD></TR>
          <TR bgColor=#f3f3f3>
            <TD><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/combinational/prebus.txt">三态总线</A><FONT 
              color=#333333><I>(</I></FONT><I><FONT 
            color=#333333>注2)</FONT></I></TD>
            <TD><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/combinational/hamming_encoder.txt">汉明纠错吗编码器</A></TD></TR>
          <TR bgColor=#f3f3f3>
            <TD><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/combinational/dmux_vhdl.vhd.txt">解复用器</A><IMG 
              height=11 src="VHDL程序范例.files/new_logo.gif" width=28></TD>
            <TD>&nbsp;</TD></TR>
          <TR bgColor=#f3f3f3>
            <TD>&nbsp;</TD>
            <TD>&nbsp;</TD></TR></TBODY></TABLE>
        <P class=font10 align=left>&nbsp;</P>
        <P class=font10 align=left>时序逻辑:</P>
        <TABLE class=font10 cellSpacing=2 cellPadding=2 width=500 border=0>
          <TBODY>
          <TR bgColor=#f3f3f3>
            <TD width=239><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/register/d-filp-flop_hct175.txt">四D触发器:74175</A></TD>
            <TD width=247><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/ststemacine/statmach_altera.vhd">用状态机实现的计数器</A></TD></TR>
          <TR bgColor=#f3f3f3>
            <TD width=239><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/register/latchinf.vhd">简单的锁存器</A></TD>
            <TD width=247><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/register/counters_altera.vhd">各种功能的计数器</A></TD></TR>
          <TR bgColor=#f3f3f3>
            <TD width=239><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/register/reg12.vhd">简单的12位寄存器</A></TD>
            <TD width=247><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/register/universal_register.txt">通用寄存器</A></TD></TR>
          <TR bgColor=#f3f3f3>
            <TD width=239><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/register/reginf.vhd">带load、clr等功能的寄存器</A></TD>
            <TD width=247><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/register/register_374.txt">带三态输出的8位D寄存器:74374</A><FONT 
              color=#333333><I>(</I></FONT><I><FONT 
            color=#333333>注2)</FONT></I></TD></TR>
          <TR bgColor=#f3f3f3>
            <TD width=239><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/register/shift_register_164.txt">移位寄存器:74164</A></TD>
            <TD width=247><A 
              href="http://www.fpga.com.cn/hdl/vhdl_example/register/ffd_vhdl.vhdl.txt">8位数据锁存器</A><IMG 
              height=11 src="VHDL程序范例.files/new_logo.gif" width=28></TD></TR>

⌨️ 快捷键说明

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