假如3个单元格为C1:C3
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Add = Target.Address
i = Target.Value
If Add >= "$C$1" And Add <= "$C$3" Then
Range("C1:C3") = 0
Range(Add) = i
End If
Application.EnableEvents = True
End Sub
4,3选1数据选择器的VHDL程序
LIBRARY IEEE;
USe IEEE.STD_LOGIC_1164.ALL;
ENTITY mux31a IS
PORT(a1,a2,a3,s0,s1:IN STD_LOGIC;
outy:OUT STD_LOGIC);
END ENTITY mux31a;
ARCHITECTURE one OF mux31a IS
SIGNAL tmp: STD_LOGIC_VECTOR(1 DOWNTO 0);
BEGIN
tmp<=s0 & s1;
PROCESS(tmp) BEGIN
CASE tmp IS
WHEN "00"=>outy<=a1;
WHEN "01"=>outy<=a2;
WHEN "10"=>outy<=a3;
WHEN OTHERS=>NULL;
END CASE;END PROCESS;
END ARCHITECTURE one;
已经运行了 可以