Prévia do material em texto
Step 1 of 1 8.048E Write a VHDL code for an n-bit counter with counting sequence, library IEEE; use entity counter is generic (N: natural 2); port (CLK: in STD_LOGIC; COUNT: in STD_LOGIC_VECTOR(3 downto 0); Q: out STD_LOGIC_VECTOR(N-1 downto end counter; architecture counter_arch of counter is signal Q1: downto 0); begin process(CLK, COUNT) begin if (CLK'event and CLK='1') then if(COUNT"0000") then Q1'1', others =>'0'); end if; if(COUNT>="1000" and COUNT'0'); end if; end if; Q