contenido

  1. ...


Diseñe un contador que realice dos conteos, binario ascendente y Gray ascendente. Se trata de realizar un tipo de conteo a la vez. El tipo de conteo es elegido por un terminal externo.

AFDContador = { Q , Σ, Γ=Q, δ, {Inicio} ,F }

Q = { 00,01,10,11 }

Σ = { 0 , 1 }

Γ = Q

F = { 00,01,10,11 }


00 01 10 11 0 0 0 0 1 1 1 1
Entradas Salidas
Qk Σ Qk+1 F
00 0 01 0
01 0 10 0
10 0 11 1
11 0 00 1
00 1 01 0
01 1 11 0
11 1 10 1
10 1 00 1





library ieee;
use ieee.std_logic_1164.all;

entity contador_moore is
port (
	clk :  in std_logic;
	  S :  in std_logic;
	  G : out std_logic_vector (1 downto 0));
end entity contador_moore;

architecture behavior of contador_moore is
	signal Qk  : std_logic_vector (1 downto 0):="00";
	signal Qk_1: std_logic_vector (1 downto 0);
begin

	Qk_1 <=	"01" when (Qk="00" and S='0') else
		"10" when (Qk="01" and S='0') else
		"11" when (Qk="10" and S='0') else
		"00" when (Qk="11" and S='0') else
				
		"01" when (Qk="00" and S='1') else
		"11" when (Qk="01" and S='1') else
		"10" when (Qk="11" and S='1') else
		"00" when (Qk="10" and S='1');

	G  <= Qk;
	
	regD: process (clk)
	begin
		if (clk'event and clk='1') then
			Qk <= Qk_1;
		end if;
	end process regD;

end architecture behavior;