hello,
I have a project to make a parity counter(counter that counts the ones in a bit vector) by using a function inside a package..I want to make a test bench for this function but I can't...so may anyone please help me?
here is the programe
PACKAGE package_functions IS
FUNCTION parity (a: bit_vector) RETURN bit;
END PACKAGE package_functions;
PACKAGE BODY package_functions IS
FUNCTION parity (a: bit_vector) RETURN bit IS
VARIABLE result: bit := '0'; -- default value
BEGIN
FOR i IN a'range LOOP
result := result XOR a(i);
END LOOP;
RETURN result;
END FUNCTION parity;
END PACKAGE BODY package_functions;
thanks in advanced.
I have a project to make a parity counter(counter that counts the ones in a bit vector) by using a function inside a package..I want to make a test bench for this function but I can't...so may anyone please help me?
here is the programe
PACKAGE package_functions IS
FUNCTION parity (a: bit_vector) RETURN bit;
END PACKAGE package_functions;
PACKAGE BODY package_functions IS
FUNCTION parity (a: bit_vector) RETURN bit IS
VARIABLE result: bit := '0'; -- default value
BEGIN
FOR i IN a'range LOOP
result := result XOR a(i);
END LOOP;
RETURN result;
END FUNCTION parity;
END PACKAGE BODY package_functions;
thanks in advanced.