【发布时间】:2015-10-17 08:02:12
【问题描述】:
我不会如何写这个问题的真值表所以我不能做这个问题,谁能帮我理解这个问题让我们做什么?非常感谢。
增量器是一种组合电路,可将输入无符号整数 (X) 加 1。输出无符号整数 (Y) 的位数与输入相同。没有输出进位,输入字符串全是 1 递增到全 0。
a) 使用输入 A0 、 B0 和 C0 编写全加器方程。 (又名辛)
b) 用 A0 = X0 , B0 = ‘0’ 和 C0 = ‘1 替换,然后化简。
c) 用输入 Ai、Bi 和 Ci 编写全加器方程。
d) 代入 Ai = Xi 和 Bi = ‘0’,然后化简。
e) 考虑一个 6 位纹波加法器,它的 A = X、B = 0 和 Cin = ‘1’。显然,这将是一个增量器。使用您在 (b) 和 (d) 中得出的简化电路画出 6 位增量器的结构图。 (标记所有实例和信号。)
VHDL 可用于模拟各个门的时间延迟。有关信号分配的 BNF 语法,请参阅您的讲义。延迟格式由模拟器使用,但被合成器忽略。使用以下语句对 2 输入门和反相器进行编码。
使用具有 4 ns 延迟的语句对 2 输入与门进行编码,Y
使用具有 4 ns 延迟的语句对 2 输入 XOR 门进行编码,Y
使用具有 1 ns 延迟的语句的代码反相器,Y 创建一个名为 PLA03 的新目录,然后启动一个名为 PLA03 的新 ModelSim 项目。始终将实体/架构放在自己的源文件中,并使用实体名称作为文件名。
f) 为 (b) 中的简化电路编写实体/架构。将实体命名为 IncStage0
g) 为 (d) 中的简化电路编写实体/架构。将实体命名为 IncStageI
h) 在 (e) 中为您的 6 位增量器编写一个名为 Inc6 的实体和一个结构体系结构。请记住将输入和输出声明为无符号。
library ieee;
use ieee.std_logic_1164.all;
Use ieee.numeric_std.all;
Entity IncStage0 is
port(
X:in unsigned;
S: out unsigned;
Cout: out unsigned);
End Entity IncStage0;
Architecture behaviour of IncStage0 is
Begin
S <= not X after 4 ns;
Cout <= X;
End Architecture behaviour;
library ieee;
use ieee.std_logic_1164.all;
Use ieee.numeric_std.all;
Entity IncStageI is
port(
X:in unsigned;
Cin: in unsigned;
S: out unsigned;
Cout:out unsigned);
End Entity IncStageI;
Architecture stageI of IncStageI is
Begin
S <= X xor Cin after 4 ns;
Cout <= X and Cin after 4 ns;
End Architecture stageI;
library ieee;
use ieee.std_logic_1164.all;
Use ieee.numeric_std.all;
Entity Inc6 is
port(
X:in unsigned (5 downto 0);
Y:out unsigned (5 downto 0));
End Entity Inc6;
Architecture behaviour of Inc6 is
signal C:unsigned (5 downto 0);
Component IncStage0
port(
X:in unsigned;
S: out unsigned;
Cout: out unsigned);
End Component ;
Component IncStageI
port(
X:in unsigned;
Cin: in unsigned;
S: out unsigned;
Cout:out unsigned);
End Component;
Begin
I0: IncStage0
port map(X=>X, S=>Y, Cout=>C);
I1: IncStageI
port map(X=>X, S=>Y, Cout=>C,Cin=>C);
I2: IncStageI
port map(X=>X, S=>Y, Cout=>C,Cin=>C);
I3: IncStageI
port map(X=>X, S=>Y, Cout=>C,Cin=>C);
I4: IncStageI
port map(X=>X, S=>Y, Cout=>C,Cin=>C);
I5: IncStageI
port map(X=>X, S=>Y, Cout=>C,Cin=>C);
End Architecture behaviour;
Library ieee;
Use ieee.std_logic_1164.all;
Use ieee.numeric_std.all;
Entity TBInc6 is
End Entity TBInc6;
Architecture rtl of TBInc6 is
signal tbX,tbY: unsigned(5 downto 0);
Begin
DUT: Entity work.Inc6 port map(X => tbX, Y => tbY);
Main: Process
Begin
for i in 0 to 63 loop
tbX <= to_unsigned(i,6);
wait for 30 ns;
end loop;
Wait;
End Process Main;
End Architecture rtl;
【问题讨论】:
-
10/10 作业复制粘贴。 (话又说回来,我也在这样做是啊。)
-
是的!那么你知道如何完成这项任务了吗?
-
是的,与 Lior 我的兄弟兄弟团队合作
-
但是我们的老师让我们将输入和输出声明为无符号
-
Unsigned 告诉工具 - 以及任何阅读代码的人 - 将一组位解释为无符号数,而不是有符号数或其他任何内容。 std_logic_vector 让您猜测并使算术更容易出现愚蠢的错误。我更喜欢为不总是数字但可能是指令、字符等的单词保留 std_logic_vector。
标签: vhdl