Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

VHDL 執行時的問題 (初學者)

可以的話請解釋一下程式碼

初學還不太懂

要執行時要打

force ... run ....

library IEEE;

use IEEE.STD_LOGIC_1164.ALL;

use IEEE.STD_LOGIC_unsigned.all;

use IEEE.STD_LOGIC_arith.all;

entity Full_Adder is

port( Ai ,Bi ,Ci : in STD_LOGIC;

S0 ,C0 : out STD_LOGIC ) ;

end Full_Adder;

architecture test of Full_Adder is

begin

S0 <= Ai XOR Bi XOR Ci ;

C0 <= (Ai and Bi) or (Ai and Ci) or (Bi and Ci) ;

end test;

library IEEE;

use IEEE.STD_LOGIC_1164.ALL;

use IEEE.STD_LOGIC_unsigned.all;

use IEEE.STD_LOGIC_arith.all;

entity add_2bit is

port (

A, B : in STD_LOGIC_vector (1 down to 0) ;

cin : in STD_LOGIC;

s : out STD_LOGIC_vector (1 down to 0) ;

Count : out STD_LOGIC ) ;

end add_2bit ;

architecture test2 of add_2bit is

signal c1 : STD_LOGIC;

component Full_Adder

port( Ai ,Bi ,Ci : in STD_LOGIC;

S0 ,C0 : out STD_LOGIC ) ;

end component;

begin

U1 : Full_Adder port map (A(0) ,B(0) ,cin ,S(0) ,c1);

U2 : Full_Adder port map (A(1) ,B(1) ,c1 ,S(1) ,cout);

end test2 ;

Update:

剛發現錯誤

down to

要打在一起 downto

Update 2:

還有 port 裡的 Count

要改成 cout

執行時出現

"malformed time value : force"

1 Answer

Rating
  • 2 decades ago
    Favorite Answer

    打 force A xx( 00~11 )之後要按enter

    再打 force B xx( 00~11 )之後也要按enter

    & 打 run 100之候還是要按enter

    懂了吧!!

    Source(s): 自己
Still have questions? Get your answers by asking now.