异或
用逻辑图和VHDL语言设计一个异或门 说来也感动,一个学期过去了,终于写了第一个属于自己的代码。虽然十分简单(惭愧) 一、要求 用逻辑图和VHDL语言设计一个异或门 二、代码 library ieee; use ieee.std_logic_1164.all; entity myxor is port(x,y:in std_logic; z:out std_logic); end myxor; architecture one of myxor is signal r0,r1,r2,r3:std_logic; begin r0<=not x; r1<=not y; r2<=x and r1; r3<=y and r0; z<=r2 or r3; end one; 关于代码 其中signal 不能 定义在process和subprogram当中(包括function和procedure)中,只可定义在其外部 三、RTL viewer 异或表达式x⊕y=xy(非)+x(非)y 四、电路图 来源: oschina 链接: https://my.oschina.net/u/4443770/blog/3159706