非线性查找表
此项目是VHDL中的非线性查找表。在该VHDL项目中,在VHDL中实现了非线性查找表,该表用于即将来临协处理器的哈希函数中。哈希算法中使用的非线性运算利用并行的4位非线性运算,其中输入半字节(4位)被映射到另一个非线性4位值。了解更多请下载附件。
应用介绍
此项目是VHDL中的非线性查找表。
在该VHDL项目中,在VHDL中实现了非线性查找表,该表用于即将来临协处理器的哈希函数中。哈希算法中使用的非线性运算利用并行的4位非线性运算,其中输入半字节(4位)被映射到另一个非线性4位值。
非线性查找运算单元如下图所示:
查找表实现的详细信息如下:
本人在下方展示了非线性查找表实现的VHDL代码;想了解更多请下载附件。
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
-- fpga4student.com: FPGA projects, Verilog projects, VHDL projects
-- VHDL project: VHDL implementation of Lookup Table
---------------------------------------------------
-- Non-linear Lookup Table Implementation in VHDL--
---------------------------------------------------
entity non_linear_lookup is
port ( LUTIN: in std_logic_vector(7 downto 0);
LUTOUT: out std_logic_vector(7 downto 0)
);
end non_linear_lookup;
architecture Behavioral of non_linear_lookup is
signal MSN_in,LSN_in,MSN_out,LSN_out: std_logic_vector(3 downto 0);
begin
MSN_in <= LUTIN(7 downto 4);
LSN_in <= LUTIN(3 downto 0);
SBOX_1: process(MSN_in) begin
case(MSN_in) is
when "0000" => MSN_out <= "0001";
when "0001" => MSN_out <= "1011";
when "0010" => MSN_out <= "1001";
when "0011" => MSN_out <= "1100";
when "0100" => MSN_out <= "1101";
when "0101" => MSN_out <= "0110";
when "0110" => MSN_out <= "1111";
when "0111" => MSN_out <= "0011";
when "1000" => MSN_out <= "1110";
when "1001" => MSN_out <= "1000";
when "1010" => MSN_out <= "0111";
when "1011" => MSN_out <= "0100";
when "1100" => MSN_out <= "1010";
when "1101" => MSN_out <= "0010";
when "1110" => MSN_out <= "0101";
when "1111" => MSN_out <= "0000";
when others => MSN_out <= "0000";
end case;
end process;
SBOX_2: process(LSN_in) begin
case(LSN_in) is
when "0000" => LSN_out <= "1111";
when "0001" => LSN_out <= "0000";
when "0010" => LSN_out <= "1101";
when "0011" => LSN_out <= "0111";
when "0100" => LSN_out <= "1011";
when "0101" => LSN_out <= "1110";
when "0110" => LSN_out <= "0101";
when "0111" => LSN_out <= "1010";
when "1000" => LSN_out <= "1001";
when "1001" => LSN_out <= "0010";
when "1010" => LSN_out <= "1100";
when "1011" => LSN_out <= "0001";
when "1100" => LSN_out <= "0011";
when "1101" => LSN_out <= "0100";
when "1110" => LSN_out <= "1000";
when "1111" => LSN_out <= "0110";
when others => LSN_out <= "0000";
end case;
end process;
LUTOUT <= MSN_out & LSN_out;
end Behavioral;
©版权声明:本文内容由互联网用户自发贡献,版权归原创作者所有,本站不拥有所有权,也不承担相关法律责任。如果您发现本站中有涉嫌抄袭的内容,欢迎发送邮件至: www_apollocode_net@163.com 进行举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。
转载请注明出处: apollocode » 非线性查找表
文件列表(部分)
名称 | 大小 | 修改日期 |
---|---|---|
VHDL中的非线性查找表实现(附件).txt | 1.00 KB | 2020-04-07 |
3.png | 18.82 KB | 2020-04-06 |
5.png | 20.39 KB | 2020-04-07 |
LookupTable1.png | 17.56 KB | 2020-04-07 |
image | 0.00 KB | 2020-04-06 |
发表评论 取消回复