sách gpt4 ai đã đi

Chương trình VHDL

In lại 作者:行者123 更新时间:2023-12-05 00:00:35 26 4
mua khóa gpt4 Nike

对于一个类,我被要求编写一个 VHDL 程序,该程序接受两个整数输入 A 和 B,并用 A+B 替换 A,用 A-B 替换 B。我编写了以下程序和测试平台。它完成了实现和行为语法检查,但它不会模拟。尽管我没有收到任何错误,但我确实收到了一些警告,指出 A 和 B 处于组合反馈循环中。有人可以阐明问题可能是什么吗?

模块:

 library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity Problem2 is
Port ( A : inout integer;
B : inout integer);
end Problem2;

architecture Behavioral of Problem2 is

procedure AB (signal A,B: inout integer) is
begin
A<=A+B after 20 ns;
B<=A-B after 30 ns;
end AB;

begin

AB(A=>A, B=>B);

end Behavioral;

试验台:
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;

ENTITY Problem2_test IS
END Problem2_test;

ARCHITECTURE behavior OF Problem2_test IS

-- Component Declaration for the Unit Under Test (UUT)

COMPONENT Problem2
PORT(
A : INOUT integer;
B : INOUT integer
);
END COMPONENT;


--BiDirs
signal A : integer;
signal B : integer;
-- No clocks detected in port list. Replace below with
-- appropriate port name

BEGIN

-- Instantiate the Unit Under Test (UUT)
uut: Problem2 PORT MAP (
A => A,
B => B
);

ABproc: process is
begin
A<=25;
B<=22;
wait;
end process;

END;

1 Câu trả lời

问题是:

  • 您的组件写入它自己的输入。这相当于一个无限循环。你这样做的原因是因为......
  • 问题的描述没有意义。

  • I was asked to write a VHDL procedure that takes two integer inputs A and B...



    美好的

    ...and replaces A with...



    什么?!

    你不能 替换 MỘT (或 B )因为你会遇到这个问题。您可以编写一个接受两个整数输入并给出两个整数输出的过程。然后这些输出可以输入一些寄存器,然后再输入输入,但是那里必须有一个寄存器来打破组合反馈循环。

    关于VHDL 程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9967836/

    26 4 0
    行者123
    Hồ sơ cá nhân

    Tôi là một lập trình viên xuất sắc, rất giỏi!

    Nhận phiếu giảm giá Didi Taxi miễn phí
    Mã giảm giá Didi Taxi
    Giấy chứng nhận ICP Bắc Kinh số 000000
    Hợp tác quảng cáo: 1813099741@qq.com 6ren.com