我无法弄清楚如何取两个std_logic_vector的绝对值(31 downto 0);
这是代码的一个例子:
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all; -- for the signed, unsigned types and arithmetic ops
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
...
...
port (
X: in std_logic_vector(31 downto 0);
Y: in std_logic_vector(31 downto 0);
F: out std_logic_vector(31 downto 0)
);
..
..
..
process(X,Y)
begin
F <= abs(X-Y) --this doesnt work
Run Code Online (Sandbox Code Playgroud) vhdl ×1