私はすでにこれを投稿していますが、何の答えもありませんので、もう一度試してみることにしました。私はVHDLでどこで間違っていますか?
以下の演算機能を実装しなければならないエンティティ:Substraction I1• - I2 入力オペランド1(I1)•:12ビット、入力オペランド2(I2)•2の補数 :8ビット、出力•2の補数 を(O):12ビット、オーバーフロー(V)•2の補数 とキャリーフラグ(C)は、それに応じて •有効なフラグを設定(VALID):計算された解が有効であるか
は、だから私は何をしていないかどうかを示しますか?ここで
は、それは次のようになります。
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
entity arithmetic is
port(I1 :in std_logic_vector(12-1 downto 0); -- Operand 1
I2 :in std_logic_vector(8-1 downto 0); -- Operand 2
O :out std_logic_vector(12-1 downto 0); -- Output
C :out std_logic; -- Carry Flag
V :out std_logic; -- Overflow Flag
VALID :out std_logic -- Flag to indicate if the solution is valid or not
);
end arithmetic;
architecture behavior of arithmetic is
begin
process(I1,I2)
begin
if ((unsigned(I1)-unsigned(I2)) > unsigned(I1)) and
((unsigned(I1)-unsigned(I2)) > unsigned(I2)) then
C <= '1';
else
C <= '0';
end if;
if I1(11)='1' and signed(std_logic_vector(unsigned(I1)-unsigned(I2)))>0
then
V <= '1';
else
V <= '0';
end if;
if unsigned(I1) < unsigned(I2) then
VALID <= '0';
else
VALID <= '1';
end if;
O <= std_logic_vector(unsigned(I1)-unsigned(I2));
end process;
end behavior;
何の構文ミスまたはそのようなものはありません。唯一の間違いは である:
エラーのために:
COMP2、SUB
I1 = 100000011110
I2 = 01000001
予想:
O = 011111011101
C = '0'、V = '1'、 VALID = '0'
が受信:
Oを= 011111011101
C = '0'、V = '1' とVALID = '1'
誰かが私のようになります助けることができる場合本当に感謝しています。