| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:半加器In Reply To:半加器 Posted by:KMP at 2006-03-16 19:03:49 --------------------------------------------------------------------------------------------------------------------
--实验题号 : Ex1-4
--项目名称 : 双2选1(3选1)多路选择器
--文件名 : muxk.vhd
--作者 : 庞杨
--班号. : 计43
--创建日期 : 2006-03-16
--目标芯片 : EP1C6Q240C8
--电路模式 :
--时钟选择 :
--演示说明 :
--功能描述 : 用层次化描述方法设计双2选1(3选1)多路选择器
--------------------------------------------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
entity MUX21A is
port(a,b:in BIT;
s:in BIT;
y:out BIT);
end entity;
ARCHITECTURE one OF MUX21A IS
BEGIN
y <= a WHEN s = '0' ELSE b;
END ARCHITECTURE one ;
entity muxk is
port(a1,a2,a3:in BIT;
s0,s1:in BIT;
outy:out BIT);
end entity;
architecture two of muxk is
component MUX21A
port(a,b:in BIT;
s:in BIT;
y:out BIT);
end component;
signal tmp:BIT;
begin
u1:MUX21A port map
(a=>a2,b=>a3,s=>s0,y=>tmp);
u2:MUX21A port map
(a=>a1,b=>tmp,s=>s1,y=>outy);
end architecture two;
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator