Guest User

Untitled

a guest
Oct 18th, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. function finde( phi : std_logic_vector( 7 downto 0 ) ) return std_logic_vector is
  2. variable e: std_logic_vector( 7 downto 0 ):= ( 1=>'1' , others => '0' );
  3. variable gcdivisor: std_logic_vector( 7 downto 0 ):= ( others => '0' );
  4. variable one: std_logic_vector( 7 downto 0 ):= ( 0=>'1', others => '0' );
  5. begin
  6. for i in 0 to 9 loop
  7. e := e + "01";
  8. gcdivisor := gcd( e, phi );
  9.  
  10. if (gcdivisor = one ) then
  11. exit;
  12. end if;
  13. end loop;
  14.  
  15. return e;
  16.  
  17. end finde;
Add Comment
Please, Sign In to add comment