ENTITY full_adder IS
PORT(a,b,c_in;IN Bit;
sum,c_out;OUT Bit);
END full_adder;
ARCHITECTURE behavioural OF full_adder IS
BEGIN
PROCESS(a,b,c_in)
BEGIN
IF(a OR b OR c_in)=’0’ THEN
sum <=‘0’;
c_out <=‘0’;
ELSIF(a AND b AND c_in)=’1’ THEN
sum <=‘1’;
c_out <=‘1’;
ELSIF(a XOR b XOR c_in)=’0’ THEN
sum <=‘0’;
c_out <=‘1’;
ELSE
sum <=‘1’;
c_out <=‘0’;
END IF;
END PROCESS;
END behavioural;
上述描述中的标点符号是在全角状态下键入的,你需要将其改成半角字符才能通过编译。