Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Descrição do contador síncrono módulo 16
- library ieee;
- use ieee.std_logic_1164.all;
- entity csm16 is
- port(
- clock: in std_logic;
- clear: in std_logic;
- enable: in std_logic;
- q: out std_logic_vector(3 downto 0)
- );
- end csm16;
- architecture estrutural of csm16 is
- component ffjk
- port(
- j: in std_logic;
- k: in std_logic;
- clk: in std_logic;
- clr: in std_logic;
- q: out std_logic
- );
- end component;
- signal enable_aux: std_logic_vector(2 downto 0);
- signal q_aux: std_logic_vector(3 downto 0);
- begin
- ff0: ffjk port map (enable,enable,clock,clear,q_aux(0));
- ff1: ffjk port map (enable_aux(0),enable_aux(0),clock,clear,q_aux(1));
- ff2: ffjk port map (enable_aux(1),enable_aux(1),clock,clear,q_aux(2));
- ff3: ffjk port map (enable_aux(2),enable_aux(2),clock,clear,q_aux(3));
- enable_aux(0) <= q_aux(0) and enable;
- enable_aux(1) <= q_aux(1) and enable_aux(0);
- enable_aux(2) <= q_aux(2) and enable_aux(1);
- q <= q_aux; -- Primeira posição do vetor q_aux recebe a primeira posição do vetor q, a segunda posição do vetor q_aux recebe a segunda posição do vetor q, a terceira posição do vetor q_aux recebe a terceira posição do vetor q
- end estrutural;
Advertisement
Add Comment
Please, Sign In to add comment