-- Copyright © 1993 by McGraw-Hill, Inc. and Zainalabedin Navabi
-- FIGURE 9.44
-- ENTITY DECLARATION OF PARWAN PROGRAM COUNTER UNIT :
LIBRARY cmos;
USE cmos.basic_utilities.ALL;
LIBRARY par_library;
USE par_library.par_utilities.ALL;
--
ENTITY program_counter_unit IS
PORT (i12 : IN twelve; o12 : OUT twelve;
increment, load_page, load_offset, reset, ck : IN qit);
END program_counter_unit;
--
-- BEHAVIORAL DESCRIPTION OF PARWAN PROGRAM COUNTER UNIT :
ARCHITECTURE behavioral OF program_counter_unit IS
BEGIN
PROCESS (ck)
VARIABLE internal_state : twelve := zero_12;
BEGIN
IF (ck = '0' ) THEN
IF reset = '1' THEN
internal_state := zero_12;
ELSIF increment = '1' THEN
internal_state := inc (internal_state);
ELSE
IF load_page = '1' THEN
internal_state (11 DOWNTO 8) := i12 (11 DOWNTO 8);
END IF;
IF load_offset = '1' THEN
internal_state (7 DOWNTO 0) := i12 (7 DOWNTO 0);
END IF;
END IF;
o12 <= internal_state;
END IF;
END PROCESS;
END behavioral;
--