我有一个std_logic_vector,我需要知道它何时发生了一些变化.到目前为止我写了这个:
process (cp, l1)
begin
if rising_edge(cp) then
rL1 <= l1;
end if;
end process;
tickL1 <= rL1 xor l1;
Run Code Online (Sandbox Code Playgroud)
rL1是l1的延迟版本,l1是我正在检查更改的std_logic_vector.问题是xor返回std_logic_vector,但我只需要0或1.我怎么能得到它?
为什么每个人都对XOR有所了解?
changed <= '0' when rL1 = l1 else '1';
Run Code Online (Sandbox Code Playgroud)