<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > 循環(huán)冗余校驗碼的單片機及CPLD實現(xiàn)

          循環(huán)冗余校驗碼的單片機及CPLD實現(xiàn)

          作者: 時間:2012-03-20 來源:網(wǎng)絡(luò) 收藏

          4 冗余碼的

          冗余碼的硬件,其速度更快,性能更好,而且只占用極少的內(nèi)的資源。本人用Xilinx公司的XCV9536芯片,基于以下VHDL 代碼,了8位CRC碼生成電路。代碼下VHDL代碼,實現(xiàn)了8位CRC碼生成電路。代碼中,s_in為輸入串行數(shù)據(jù),q為輸出CRC碼,d_new為當前CRC碼。
          Library IEEE;
          use IEEE.std_logic_1164.all;
          entity crc is
          port(clk,s_in,reset:in STD_LOGIC,q:out STD_LOGIC_VECTOR (7 downto 0));
          end crc;
          architecture crc_arch of crc is
          signal t1,t2,t3:std_logic;
          signal d_new:std_logic_vector(7 downto 0);
          begin
          t1=d_new(0)xor s_in; --t1為最低位與輸入異或值
          t2=d_new(4)xor '1';
          t3=d_new(3)xor'1';
          process(clk,reset)
          begin
          if clk event and clk='1'then
          if reset='1'then
          d_new=x0; --復(fù)位時,CRC碼置零
          elsif t1='1'then
          d_new=t1d_new(7 downto 5)t2t3td_new(2 downto 1);--t1為1時的新CRC碼
          elsif t1='0'then
          d_new=t1d_new(7 downto 1); --t1為0時的新CRC碼
          end if;
          end if;
          end process;
          q=d_new;--輸出CRC碼
          end crc_arch;

          5 總結(jié)

          基于以上介紹的8位冗余碼的軟件及硬件實現(xiàn)方法,可以設(shè)計各種類型的循環(huán)冗余校檢方法。由上述例程可以看出,循環(huán)冗余碼校驗是一種可靠性高、易于實現(xiàn)的校驗方法。


          上一頁 1 2 下一頁

          評論


          相關(guān)推薦

          技術(shù)專區(qū)

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();