SHOW:
|
|
- or go back to the newest paste.
| 1 | - | library ieee; |
| 1 | + | ya3ny maslan law fih AND gate ,hate3melo kda : |
| 2 | - | use ieee.std_logic_1164.all; |
| 2 | + | entity AND_GATE is |
| 3 | port (A,B : in std_vector(4 downto 0 ); | |
| 4 | - | entity Carry_Look_Ahead_adder is |
| 4 | + | Z: out std_vector(4 downto 0);); |
| 5 | - | port (A0,A1,A2,A3,B0,B1,B2,B3,SEL : in std_logic; |
| 5 | + | end AND_GATE ; |
| 6 | - | ZO,Z1,Z2,Z3: out std_logic); |
| 6 | + | |
| 7 | - | end Carry_Look_Ahead_adder; |
| 7 | + | architecture behavior of AND_GATE is |
| 8 | - | |
| 8 | + | |
| 9 | - | architecture behavior of Carry_Look_Ahead_adder is |
| 9 | + | BEGIN |
| 10 | - | begin |
| 10 | + | Z(0) <= A(0) AND B(0); |
| 11 | - | if (SEL = '1') then |
| 11 | + | Z(1) <= A(1) AND B(1); |
| 12 | - | Z0 <= A0 and B0; |
| 12 | + | Z(2) <= A(2) AND B(2); |
| 13 | - | Z1 <= A1 and B1; |
| 13 | + | Z(3) <= A(3) AND B(3); |
| 14 | - | Z2 <= A2 and B2; |
| 14 | + | end behavior; |