-- Copyright © 1993 by McGraw-Hill, Inc. and Zainalabedin Navabi
-- FIGURE 9.38
-- ENTITY DECLARATION OF PARWAN STATUS REGISTER UNIT :
LIBRARY cmos;
USE cmos.basic_utilities.ALL;
LIBRARY par_library;
USE par_library.par_utilities.ALL;
--
ENTITY status_register_unit IS
PORT (in_flags : IN nibble; out_status : OUT nibble;
load, cm_carry, ck : IN qit );
END status_register_unit;
--
-- BEHAVIORAL DESCRIPTION OF PARWAN STATUS REGISTER UNIT :
ARCHITECTURE behavioral OF status_register_unit IS
BEGIN
PROCESS (ck)
VARIABLE internal_state : nibble := "0000";
ALIAS internal_z : qit IS internal_state (1);
ALIAS internal_c : qit IS internal_state (2);
BEGIN
IF (ck = '0') THEN
IF (load = '1') THEN
internal_state := in_flags;
ELSIF (cm_carry = '1') THEN
internal_c := NOT internal_c;
END IF;
out_status <= internal_state;
END IF;
END PROCESS;
END behavioral;
--