Microsoft AGB-00001 Spécifications Page 50

  • 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 49
How to Write Synthesizable VHDL
3-24 VHDL Reference Manual
You can combine the asynchronous reset and preset to create an
asynchronous load:
library ieee;
use ieee.std_logic_1164.all;
library dataio;
use dataio.std_logic_ops.all;
entity asyn_load_cnt is
port(
clk : in std_logic;
ce : in std_logic;
reset : in std_logic;
preset : in std_logic;
load : in std_logic;
d : in std_logic_vector(7 downto 0);
q : buffer std_logic_vector(7 downto 0));
end;
architecture behavioral of asyn_load_cnt is
signal next_q : std_logic_vector(7 downto 0);
begin
next_q <= q + '1';
process(clk, reset, preset, load, d)
begin
for i in q'range loop
if (reset = '1') or (load = '1' and d(i) = '0') then
q(i) <= '0';
elsif (preset = '1') or (load = '1' and d(i) = '1') then
q(i) <= '1';
elsif (rising_edge(clk)) then
if (ce = '1') then
q(i) <= next_q(i);
end if;
end if;
end loop;
end process;
end behavioral;
This logic defines an 8 bit up counter, with asynchronous reset, preset,
load, and clock enable. Since the VHDL synthesis compiler requires
that the value assigned by the reset or preset condition be a constant
expression, a loop construct inside the process generates the logic for
each flip-flop individually.
Describing Finite State Machines
This section describes the relationship between various types of finite
state machines (FSMs), the VHDL description methods that are most
commonly used to specify them, and the logic that is generated as a
result of synthesis. Each example illustrates a single state machine.
(This is not a constraint of VHDL or the VHDL synthesizer, just a
simplification. Multiple state machines are supported in VHDL, and the
different machines can operate independently using multiple clocks.)
Vue de la page 49
1 2 ... 45 46 47 48 49 50 51 52 53 54 55 ... 143 144

Commentaires sur ces manuels

Pas de commentaire