--三人表决器(三种不同的描述方式) vhdl
-- three-input majority voter
-- the entity declaration is followed by three alternative architectures which achieve the same functionality in different ways.
entity maj is
port(a,b,c : in bit; m : out bit);
end maj;
--dataflow style architecture
architecture concurrent of maj is
begin
--selected signal assignment statement (concurrent)
with a&b&c select
m <= '1' when 110|101|011|111,'0' when others;
end concurrent;
--structural style architecture
architecture structure of maj is
--declare components used in architecture
component and2 port(in1, in2 : in bit; out1 : out bit);
end component;
component or3 port(in1, in2, in3 : in bit; out1 : out bit);
end component;
--declare local signals
signal w1, w2, w3 : bit;
begin
--component instantiation statements.
--ports of component are mapped to signals
--within architecture by position.
gate1 : and2 port map (a, b, w1);
gate2 : and2 port map (b, c, w2);
gate3 : and2 port map (a, c, w3);
gate4 : or3 port map (w1, w2, w3, m);
end structure;
--behavioural style architecture using a look-up table
architecture using_table of maj is
begin
process(a,b,c)
constant lookuptable : bit_vector(0 to 7) := 00010111;
variable index : natural;
begin
index := 0; --index must be cleared each time process executes
if a = '1' then index := index 1; end if;
if b = '1' then index := index 2; end if;
if c = '1' then index := index 4; end if;
m <= lookuptable(index);
end process;
end using_table;
【服务器数据恢复】某银行服务器磁盘阵列硬盘坏道离线的数据恢复案例
瑞萨MCU助力中国新能源基建持续创新(上)
5G虽然发展迅速,但仍需要进一步提高其安全性
DMC640M运动控制器的硬件性能及在机械手上下料中的应用
新唐科技N588H250介绍
三人表决器:VHDL源代码
特斯拉信息娱乐系统价格下降40%
苹果13pro max新配色 苹果13pro max颜色有哪些
PIN射频微波开关电路设计与仿真
SK海力士最新DDR5 EEC内存条展示,采用1znm内存制造工艺制造
震惊!高通CFO将加盟英特尔?
日本三菱重工开发的首款国产小型喷气式客机交付货期将会延迟
高通宣布已与LG电子签署一项新的5年期专利授权协议
usb-c接口是什么意思_usb-c接口有什么用
中国宽带速率状况报告,在下载速率方面,中国电信比中国移动略胜一筹
深度解析七大汽车芯片产业等细分领域机遇与挑战
蔚来汽车定下2018年目标 ES8计划销售2-3万辆
搭载MT7621A MIPS双核880MHz处理器 小米路由器Pro上架
使用NVIDIA Jetson Orin为边缘AI应用程序提供动力
物联网和人工智能哪些应用可以翻转我们的生活