Oct 20

VHDL reverse bus bits 不指定

RickySu , 14:27 , 技术经验 , 评论(0) , 引用(0) , 阅读(563) , Via 本站原创 | |
设计中经常由于大小端问题等等需要把一个Bus里所有比特的位置倒置一下,使原来bit0, bit1...bitN的顺序改为bitN, bitN-1, bit0.
以下是从xps_spi_2.00.b中截取的一段代码,用于解决这个问题。
spi_module.vhd , Line 541
if (LSB_first = '1') then
     for i in 0 to C_NUM_TRANSFER_BITS-1 loop
          Receive_Data(i) <= Shift_Reg(C_NUM_TRANSFER_BITS-1-i);
      end loop;
else
      Receive_Data <= Shift_Reg;
end if;
Tags: ,
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]