在VHDL语言测试台中,声明“”t1 : time;t2 : time;“”模拟以皮秒为单位。架构中的分配是‘t1: now -- assign time to t1 t2: now -- assign time to t2 later in test bench。“”“问:如何将ps (t2-t1)中的增量时间转换为频率?Hz或MHz或KHz都无关紧要。
我知道VHDL中的一个组件是:
一个可重用的VHDL子模块,可以用VHDL码的元器件声明在另一个数字逻辑电路中进行声明。这有助于轻松实现分层设计。
但是,谁能向我解释/展示我应该在下图中的VHDL代码中声明哪些组件?
例如,这是正确的吗?
architecture Behavioral of ALU1Bit is
component Adder1Bit
port(
carryIn: IN std_logic;
A: IN std_logic;
B: IN std_logic;
output: OUT std_logic;
F: OUT std_logic
);
end comp
我对vhdl和系统verilog完全陌生。我必须重新编写包含以下行的vhdl文件:
library ieee;
use ieee.std_logic_1164.all;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
我是否必须包括一些符合系统verilog标准的类似库?在系统verilog中,代码应该是什么样的呢?
我在VHDL中有一个X值数组,声明为进程中的一个变量。我想计算for循环中所有值的平均值。如果我手动写出3个值,一切正常(在硬件上测试):
entity MyEntity is
Port(
Enable : IN STD_LOGIC ;
CLK : IN STD_LOGIC;
SpeedOut : OUT INTEGER
);
end MyEntity;
Average : process
type SampleArray is Array (2 downto 0) of INTEGER;
variable Speed
我是VHDL的新手,我有一段代码,我就是找不出其中的错误。传达的信息是:
Error (10500): VHDL syntax error at 3badder.vhd(6) near text "3"; expecting an identifier
我的代码:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity 3badder is
port( a
要测试的设计是用VHDL编写的,它的端口使用这样的无约束记录:
type forward_stream is record
data : std_ulogic_vector;
-- further members
...
end record;
这些端口现在应该从systemverilog驱动。有没有任何方法可以使用vhdl记录类型的测试台信号?如果是这样,我如何约束systemverilog中的记录?
还是必须创建一个VHDL包来约束记录并将其作为要在testbench中使用的类型提供?
由于HDL支持在不同的工具之间有很大的不同,我特别询问questasim
我写了一个简单的全加器,它使用了2个加法器和一个OR门。VHDL代码非常简单
library ieee;
use ieee.std_logic_1164.all;
entity ha is
port( x: in std_logic;
y: in std_logic;
s: out std_logic;
c: out std_logic);
end;
architecture x of ha is
begin
s <= x xor y;
c <= x and y;
end;
和
library ieee;
use ieee.std_
我有一个布尔函数minimize,我想用VHDL创建它。我用电路创建了它,它工作得很完美,但当我用VHDL创建它时,它给出了不同的输出。有人可以检查我的布尔函数和代码并帮助调试吗?
下面是布尔函数
Q0 = A0 + A1 + (~A2 * ~A3 * ~B0 * (B1 + ~B2 * B3))
下面是我用于布尔函数的代码:
Q0 <= (A0) or (A1) or (not A2 and not A3 and not B0 and B1) or (not A2 and not A3 and not B0 and not B2 and B3);
update @user1155120的评论是正确的:
这是告诉你错误在某个领域-这里的其他作业
我有乘法运算,我错误地认为这些运算的作用和加法一样。是我的错。
我正在使用VHDL编写一个基本的ALU。
下面是抛出错误的代码:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
use ieee.std_logic_misc.all;
entity alu is
port (
A, B : in unsigned(31 downto 0);
sel : in unsigned(2 d
如果我有一个VHDL加法器,它把两个数字相加在一起:
entity adder is
port(
clk : in std_logic;
sync_rst : in std_logic;
signal_A_in : in signed(31 downto 0);
signal_B_in : in signed(31 downto 0);
result_out : out signed(31 downto 0)
);
end adder;
我有两个选择,一个是将signal_A_in和signal_B
我希望替换Verilog模块()中的一些通用同步代码。代码是一个标准的2触发器同步器.
always @ (posedge clk_i or posedge rst)
begin
if (rst)
begin
rx_sync_tmp <= 1'b1;
rx_sync <= 1'b1;
end
else
begin
rx_sync_tmp <= rx_i;
rx_sync <= rx_sync_tmp;
end
end
VHDL中的实体声明也很简单:
e
我正在用累加器编码一个4位二进制加法器:
library ieee;
use ieee.std_logic_1164.all;
entity binadder is
port(n,clk,sh:in bit;
x,y:inout std_logic_vector(3 downto 0);
co:inout bit;
done:out bit);
end binadder;
architecture binadder of binadder is
signal state: integer range 0 to 3;
s
我现在正在用VHDL做一些练习,我需要你们的一些帮助,一些指导来推动我走上正确的道路。
代码如下:
signal clk,reset:std_logic
signal q:unsigned(3 downto 0);
process(clk,reset)
variable count:integer range 0 to 15;
begin
if (reset=’1’) then
q<=(others=>’0’);
count :=0;
elsif (clk’event and clk=’1’) then
count:=conv
晚上好,我正试图用vhdl实现一个8位的全加器,但为此我需要使用8个完整的1位满加法器。我知道如何做8位全加器,但我不知道如何使用8位全加器。我有这样的代码:
library IEEE;
use IEEE.std_logic_1164.all;
entity onebitfulladder is
port (num1, num2, carry_in : in std_logic;
result, carry_out : out std_logic);
end onebitfulladder;
architecture behavior of onebitfulladder is
si
假设下面的VHDL组件:
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity adder is
port
(
iClk : in std_logic;
iDataA : in unsigned(7 downto 0);
iDataB : in unsigned(7 downto 0);
iDataC : in unsigned(7 downto 0);
oResultA : out unsign