なお,D フリップフロップを例とすると,buffer と同様の動作は out を用い て以下のように記述可能です.
Bufferを使用した例 -- ライブラリ宣言 library IEEE; use IEEE.std_logic_1164.all; -- エンティティ宣言 entity D_FF is port ( D : in std_logic; CLK : in std_logic; QH : buffer std_logic ); QL : out std_logic ); end D_FF; -- アーキテクチャ本体 architecture D_FF_Body of D_FF is begin process(CLK) begin if CLK'event and CLK = '1' then QH <= D; end if; end process; QL <= not QH; end D_FF_Body; |
Bufferを使用しない例 -- ライブラリ宣言 library IEEE; use IEEE.std_logic_1164.all; -- エンティティ宣言 entity D_FF is port ( D : in std_logic; CLK : in std_logic; QH : out std_logic ); QL : out std_logic ); end D_FF; -- アーキテクチャ本体 architecture D_FF_Body of D_FF is signal TMP : std_logic; begin process(CLK) begin if CLK'event and CLK = '1' then TMP <= D; end if; end process; QH <= TMP; QL <= not TMP; end D_FF_Body; |