List of Experiments
List of Experiments
Theory:
Use ieee.std_logic_arith_all;
Function of + Function
Return bit_vector is
Cout: = (a (i) and b (i)) OR (b (i) and Cin) OR (Cin And a (i));
Cin: = Cout
End loop;
Return sum;
End +
Begin
For I in 0 to 3 loop
Cout: = ((not a (i) and b (i)) or ((b (i) and cin) or ((not a (i) and cin)) ;
Cin: = cout;
End -;
Begin
Begin
F<= 0000;
When 010=>
F =p-q;
When 001=>
F =p+q;
When 100=>
F =p and q;
When 101=>
F<= p xor q;
When 110=>
F<=p or q:
F<= 1111;
End case;
End process;
End ALU_Beh;