function INTVAL (VAL: MVL4_VECTOR) return INTEGER is variable SUM: INTEGER:= 0; begin for N in VAL'LOW to VAL'HIGH loop assert not(VAL(N) = 'X' or VAL(N) = 'Z') report "INTVAL inputs not 0 or 1" severity WARNING; if VAL(N) = '1' then SUM := SUM + (2**N); end if; end loop; return SUM; end INTVAL; --Figure 3.28 Declaration of a function to convert type MVL4_VECTOR --to typeINTEGER