すべての入力がx
とclk = 1
の場合、出力値はQpl
になりますが、出力されません。次のコードの問題点は何ですか?VHDLデザインで予期しない結果が発生しました
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
--This is a D Flip-Flop with Synchronous Reset,Set and Clock Enable(posedge clk).
--Note that the reset input has the highest priority,Set being the next highest
--priority and clock enable having the lowest priority.
ENTITY syn IS
PORT (
Q : OUT std_logic; -- Data output
CLK : IN std_logic; -- Clock input
Qpl : IN std_logic;
RESET : IN std_logic; -- Synchronous reset input
D : IN std_logic; -- Data input
SET : IN std_logic -- Synchronous set input
);
END syn;
ARCHITECTURE Behavioral OF syn IS --architecture of the circuit.
BEGIN
--"begin" statement for architecture.
PROCESS (CLK) --process with sensitivity list.
BEGIN
--"begin" statment for the process.
IF (CLK'EVENT AND CLK = '1') THEN --This makes the process synchronous(with clock)
IF (RESET = '1') THEN
Q <= '0';
ELSE
IF (SET = '1') THEN
Q <= D;
ELSE
Q <= Qpl;
END IF;
END IF;
END IF;
END PROCESS; --end of process statement.
END Behavioral;
以下の図は、上記デザインの波形と望ましい動作要件を示しています。波形図から
![waveform](https://i.stack.imgur.com/875Dm.png)
'SET'は' D'を適用するのに適していないことに注意してください。 "reset"はレジスタを '0'に設定し、setは通常レジスタを '1'に設定します。通常の名前は "load"または "enable"です。私は "負荷"が最善の選択だと思います。 – JHBonarius