-- Copyright © 1993 by McGraw-Hill, Inc. and Zainalabedin Navabi
-- FIGURE 4.24
-- ENTITIY DECLERATION OF NIBBLE COMPARATOR FOR TEST BENCH :
ENTITY nibble_comparator_test_bench IS
END nibble_comparator_test_bench ;
--
-- TEST BENCH FOR ITERATIVE ARCHITECTURE OF NIBBLE COMPARATOR :
ARCHITECTURE input_output OF nibble_comparator_test_bench IS
COMPONENT comp4 PORT (a, b : IN bit_vector (3 DOWNTO 0);
a_gt_b, a_eq_b, a_lt_b : IN BIT;
a_gt_b_out, a_eq_b_out, a_lt_b_out : OUT BIT);
END COMPONENT;
FOR a1 : comp4 USE ENTITY WORK.nibble_comparator(iterative);
SIGNAL a, b : BIT_VECTOR (3 DOWNTO 0);
SIGNAL eql, lss, gtr : BIT;
SIGNAL vdd : BIT := '1';
SIGNAL gnd : BIT := '0';
BEGIN
a1: comp4 PORT MAP (a, b, gnd, vdd, gnd, gtr, eql, lss);
a2: a <= "0000", ---- a = b (steady state)
"1111" AFTER 0500 NS, -- a > b (worst case)
"1110" AFTER 1500 NS, -- a < b (worst case)
"1110" AFTER 2500 NS, -- a > b (need bit 1 info)
"1010" AFTER 3500 NS, -- a < b (need bit 2 info)
"0000" AFTER 4000 NS, -- a < b (steady state, prepare for next)
"1111" AFTER 4500 NS, -- a = b (worst case)
"0000" AFTER 5000 NS, -- a < b (need bit 3 only, best case)
"0000" AFTER 5500 NS, -- a = b (worst case)
"1111" AFTER 6000 NS; -- a > b (need bit 3 only, best case)
a3 : b <= "0000", ---- a = b (steady state)
"1110" AFTER 0500 NS, -- a > b (worst case)
"1111" AFTER 1500 NS, -- a < b (worst case)
"1100" AFTER 2500 NS, -- a > b (need bit 1 info)
"1100" AFTER 3500 NS, -- a < b (need bit 2 info)
"1111" AFTER 4000 NS, -- a < b (steady state, prepare for next)
"1111" AFTER 4500 NS, -- a = b (worst case)
"1111" AFTER 5000 NS, -- a < b (need bit 3 only, best case)
"0000" AFTER 5500 NS, -- a = b (worst case)
"0000" AFTER 6000 NS; -- a > b (need bit 3 only, best case)
END input_output;