
VHDL—Packages, Sub Programs, and Sequential Circuits 16.9
2. The function body is as follows:
function get_xor4 (Signal M, N, O, P: in Std_Logic) return Std_Logic is
Signal temp: out Std_Logic; -- declare a local signal temp.
; -- declarations of logic signals M, N, O, and P are already given in the
arguments.
begin
temp: = M xor N xor O xor P; -- find the four variable XOR of M, N, O,
and P.
return temp;
end get_xor4;
3. Signal A, B, C, D: in Std_Logic_Vector;
Signal Q: out Std_Logic;
Q: = get_xor4 (A, B, C, D); -- function get_xor returning the four variable
xor into Q.
Points to Remember
1. Function does a subset of computations ...