【導(dǎo)讀】libraryieee;use;port(a,b:instd_logic;y:outstd_logic);endnand_2;y<=anandb;endnand2_1;libraryieee;use;port(a,b:instd_logic;y:outstd_logic);endnor_2;c:=a&b;when"00"=>y<='1';when"01"=>y<='0';when"10"=>y<='0';when"11"=>y<='0';whenothers=>y<='X';endcase;endprocess;endnor_2_1;libraryieee;use;port(a,b:instd_logic;s,co:outstd_logic);endhalf_adder;signalc,d:std_logic;c<=aorb;d<=anandb;co<=notd;s<=candd;endhalf1;libraryieee;use;port(a,b:instd_logic;c:outstd_logic);endentityor2a;c<=aorb;endarchitectureone;libraryieee;use;port(ain,bin,cin:instd_logic;cout,sum:outstd_logic);endentityf_adder1;port(a,b:instd_logic;co,s:outstd_logic);endponent;port(a,b:instd_logic;c:outstd_logic);endponent;signald,e,f:std_logic;u3:or2aportmap(a=>d,b=>f,c=>cout);endarchitecturefd1;libraryieee;use;port(a,b,c,g1,g2a,g2b:instd_logic;endt3to8;indata<=c&b&a;if(g1='1'andg2a='0'andg2b='0')then. when"000"=>y<="11111110";when"001"=>y<="11111101";when"011"=>y<="11111011";when"100"=>y<="11110111";when"101"=>y<="11011111";when"110"=>y<="10111111";when"111"=>y<="01111111";whenothers=>y<="XXXXXXXX";endcase;y<="11111111";endif;endprocess;endrtl;libraryieee;use;port(a,b,g2a,g2b:instd_logic;endt2to4;indata<=b&a;when"00"=>y<="0111";when"01"=>y<="1011";when"10"=>y<="1101";when"11"=>y<="1110";