📄 parity.vhd
字号:
library ieee;
use ieee.std_logic_1164.all;
entity parity is
generic ( bus_size : integer := 8 );
port ( input_bus : in std_logic_vector (bus_size-1 downto 0);
even_numbits, odd_numbits : out std_logic ) ;
end parity ;
architecture behave of parity is
begin
process (input_bus)
variable temp: std_logic;
begin
temp := '0';
for i in input_bus'low to input_bus'high loop
temp := temp xor input_bus(i) ;
end loop ;
odd_numbits <= temp ;
even_numbits <= not temp;
end process;
end behave;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -