标签:
Using operators
Operators can be used to implement any combinational circuit. However, as will become apparent later, complex circuits are usually easier to write using sequential code, even if the circuit does not contain sequential logic.
Example Multiplexer
1 --------------------------------------- 2 LIBRARY ieee; 3 USE ieee.std_logic_1164.all; 4 --------------------------------------- 5 ENTITY mux IS 6 PORT ( a, b, c, d, s0, s1: IN STD_LOGIC; 7 y: OUT STD_LOGIC); 8 END mux; 9 --------------------------------------- 10 ARCHITECTURE pure_logic OF mux IS 11 BEGIN 12 y <= (a AND NOT s1 AND NOT s0) OR 13 (b AND NOT s1 AND s0) OR 14 (c AND s1 AND NOT s0) OR 15 (d AND s1 AND s0); 16 END pure_logic; 17 ---------------------------------------
标签:
原文地址:http://www.cnblogs.com/mengdie/p/4518317.html