





















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






















Package example is
type nineval is (z0,z1,z2,r0,r1,r2,f0,f1,f2); type t_cluster is arary (0 to 15) or nineval; type t_clus_vec is array (natural range <>) of t_cluster; function resolve (s : t_clus_vec) return t_cluster; subtype t_wclus is resolve_cluster t_cluster; constant undriven : t_wclus;
End example;
For I in s’range loop if s(I) /= undriven then drive_count := drive_count + 1; if drive_count = 1 then result := a (I); else result : = undriven end if; End loop Return result; -- return value End resolve_cluster; -- end function End cluspack; -- end package
FUNCTION f
(a,b : integer; signal c : std_logic_vector ) return BOOLEAN is
Begin
(sequential statements)
END f1;
Architecture behave of convert is function vector_to_int (s : log8) return integer is variable result : integer := 0; begin for I in 0 to 7 loop result : = result * 2: if s(I) = ‘1’ then result := result + 1; end if; end loop; return result; end vector_to_int; Begin o1 <= vector_to_int(i1); End behave; Docsity.com