Microsoft AGB-00001 Spécifications Page 53

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 144
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 52
How to Write Synthesizable VHDL
VHDL Reference Manual 3-27
architecture example of some_entity is
begin
process (clk)
begin
if clk = '1' and clk'event then
if reset = '1' then
c <= '0';
else
c <= a and c; -- c is fed back directly
end if;
end if;
end process;
end example;
This method eliminates the intermediate signal b.
Feedback on Variables
Variables exist within a process, and preserve their data as processes
suspend and reactivate. Feedback is created whenever variables are
used (placed on the right hand side of an assignment or used in a
conditional statement) before they are assigned (placed on the left
hand side of an assignment.)
Feedback paths typically contain registers, so to use feedback in a
process you will usually want to insert a conditional statement that
implies a clock into the process. The following example shows how
registered feedback is created (to form a counter function) from the
use of a variable in a process:
process (clk)
variable Count: integer range 0 to 255;
begin
if clk = '1' and clk'event then
if reset = '1' then
Count := 0;
elsif Count = 255 then
Count := 0;
else
Count := Count + 1; -- Counter feeds back
end if;
end if;
C <= Count;
end process;
In this example, the counter output (C) is assigned the value of the
variable Count, creating an 8-bit counter on the design output. In the
above example, eight flip-flops are generated for the output C, and the
feedback logic for variable Count is folded into the logic for C.
Note: Variables only imply registers when used within process
statements. If a variable is declared inside a function or procedure,
the variable is local to the subprogram; it exists only within the scope
of the subprogram.
Vue de la page 52
1 2 ... 48 49 50 51 52 53 54 55 56 57 58 ... 143 144

Commentaires sur ces manuels

Pas de commentaire