What is the function of the below code?
A. To count number of ones in the given data
B. To count number of zeroes in the given data
C. To reverse the order of given data
D. To perform binary multiplication of two data inputs
Code:
ENTITY my_logic IS
PORT (din : STD_LOGIC_VECTOR(7 DOWNTO 0);
Count : STD_LOGIC_VECTOR(3 DOWNTO 0));
END my_logic;
ARCHITECTURE behavior OF my_logic IS
BEGIN
Count <= “0000”
PROCESS(din)
BEGIN
L1: FOR i IN 0 TO 7 LOOP
IF(din(i) = ‘1’) THEN
Count = count+1;
ELSE
NEXT L1;
END LOOP;
END PROCESS;
END behavior;
B. To count number of zeroes in the given data
C. To reverse the order of given data
D. To perform binary multiplication of two data inputs