-- Copyright © 1993 by McGraw-Hill, Inc. and Zainalabedin Navabi
-- FIGURE 7.21
-- ENTITY DECLERATION OF 8-to-1 MULTIPLEXER :
USE WORK.basic_utilities.ALL;
ENTITY mux_8_to_1 IS
PORT (i7, i6, i5, i4, i3, i2, i1, i0 : IN qit;
s7, s6, s5, s4, s3, s2, s1, s0 : IN qit; z : OUT qit );
END mux_8_to_1;
--
-- IMPLEMENTING THE 8-to-1 MULTIPLEXER USING 8 CONCURRENT ASSIGNMENTS :
ARCHITECTURE multiple_assignments OF mux_8_to_1 IS
FUNCTION oring ( drivers : qit_vector) RETURN qit IS
VARIABLE accumulate : qit := '0';
BEGIN
FOR i IN drivers'RANGE LOOP
accumulate := accumulate OR drivers(i);
END LOOP;
RETURN accumulate;
END oring;
SIGNAL t : oring qit;
BEGIN
t <= i7 AND s7;
t <= i6 AND s6;
t <= i5 AND s5;
t <= i4 AND s4;
t <= i3 AND s3;
t <= i2 AND s2;
t <= i1 AND s1;
t <= i0 AND s0;
z <= t;
END multiple_assignments;