?? parity_verifier.vhd
字號:
-- 庫聲明
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use WORK.UART_PACKAGE.ALL;
-- 實體聲明
entity parity_verifier is
-- 類屬參數(shù)
generic (
DATA_LENGTH : integer := 8;
PARITY_RULE : PARITY := NONE );
-- 端口
port (
source : in std_logic_vector(DATA_LENGTH-1 downto 0);
parity : out std_logic );
end parity_verifier;
--}} End of automatically maintained section
-- 結(jié)構(gòu)體
architecture parity_verifier of parity_verifier is
begin
-- enter your statements here --
-- 按照校驗規(guī)則計算校驗位
with PARITY_RULE select
parity <= MultiXOR(source) when ODD, -- 奇校驗
( not MultiXOR(source) ) when EVEN, -- 偶校驗
'1' when others;
end parity_verifier;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -