VHDL:Programmeringstips

From Robin

(Difference between revisions)
Jump to: navigation, search
Line 2: Line 2:
== Hvordan teste om alle bit i en std_logic_vector = '1' ==
== Hvordan teste om alle bit i en std_logic_vector = '1' ==
-
{{{
+
 
-
if A = (A'range => '1') then
+
if A = (A'range => '1') then
-
  ...
+
    ...
-
else
+
else
-
  ...
+
    ...
-
end if;
+
end if;
-
}}}
+
== Hvordan sette alle bit i en std_logic_vector like ==
== Hvordan sette alle bit i en std_logic_vector like ==
-
{{{
 
-
A <= (others => '1');
 
-
A_2D <= (others=>(others => '1'));    --hvis todimensjonalt array
+
A <= (others => '1');
-
}}}
+
 
 +
A_2D <= (others=>(others => '1'));    --hvis todimensjonalt array
 +
 
== Hvordan vente på en verdi som skal være stabil en periode ==
== Hvordan vente på en verdi som skal være stabil en periode ==
-
{{{
+
 
-
wait until (CLK='1' and CLK'stable(2 ns));
+
wait until (CLK='1' and CLK'stable(2 ns));
-
}}}
+

Revision as of 18:20, 7 March 2007

Contents

VHDL Programmeringstips

Hvordan teste om alle bit i en std_logic_vector = '1'

if A = (A'range => '1') then
   ...
else
   ...
end if;

Hvordan sette alle bit i en std_logic_vector like

A <= (others => '1');
A_2D <= (others=>(others => '1'));    --hvis todimensjonalt array


Hvordan vente på en verdi som skal være stabil en periode

wait until (CLK='1' and CLK'stable(2 ns));
Personal tools
Front page