Está en la página 1de 7

UNIVERSIDAD TCNICA DE AMBATO

FISEI
Ingeniera en Electrnica y Comunicaciones
VLSI- DEBER
Integrantes:

Abigail Alds.
Edwin Gavilnez.
Christian Silva.
Daniela Sevilla.
Roberto Villacs.
Oscar Guzman.

Fecha de envio: 21 de julio


Fecha de entrega: 05 de agosto 2015.
Tema: maquina de Mealy y Moore.
Mquina de mealy

CDIGO VHDL

FLIP-FLOP-D

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity flip_f_d is
Port ( d ,r: in STD_LOGIC;
clk : in STD_LOGIC;
q : out STD_LOGIC);
end flip_f_d;
architecture Behavioral of flip_f_d is
begin
process (clk)
begin
if(clk'event and clk='1') then
q<= d;
end if;
end process;
end Behavioral;

INSTANCIACIN

library IEEE; -- importar la librera ieee

use IEEE.STD_LOGIC_1164.ALL; --hacer uso de todos sus metodos


entity det_cod is asignar nombre a la entidad
Port ( x : in STD_LOGIC; --declarar puertos entrada(x, clk) y salida(y)
clk : in STD_LOGIC;
y : out STD_LOGIC);
end det_cod; --cerrar la entidad
architecture Behavioral of det_cod is asignar nombre a la arquitectura
signal aux1,bux1,a1,b1,y1,A,B:std_logic; --declarar signals
begin
a1<= (A and B) or ( x and (not B)); --ecuacion para flipflop A
b1<= ((not x) and (not A)) or ( (not x) and B); --ecuacion para flipflop b
y1<= ((not x) and A and (not B)) or ( x and (not A) and B); --ecuacion para
salida
y<=y1; asignar valor a la salida
D1: entity work.flip_f_d -- instanciar flipflop tipo D
PORT MAP( --realizar mapeo de puertos
d=>a1,
clk=>clk,
q=>aux1
);
A<= aux1; --guardar el valor de salida de dicho flip-flop
D2: entity work.flip_f_d
PORT MAP(
d=>b1,
clk=>clk,
q=>bux1
);
B<=bux1;
end Behavioral;
SIMULACIN

TABLA DE VERDAD
X
0
0
0
0
1
1
1
1

A
0
0
1
1
0
0
1
1

B
0
1
0
1
0
1
0
1

A+
0
0
0
X
1
0
1
X

B+
1
1
0
X
0
0
0
X

DA
0
0
0
X
1
0
1
X

ECUACIONES
DA = AB +XB|
DB = X|A| + X|B
Y = X|AB| + XA|B

MAQUINA DE MOORE

DB
1
1
0
X
0
0
0
X

Y
0
0
1
0
0
1
0
0

1
0
1

0
0
1
0
1

Entidad

Cdigo
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity MOORE is
Port ( dato, clk, ena : in STD_LOGIC;
q0 : out STD_LOGIC;
q1 : out STD_LOGIC);
end MOORE;
architecture
type estados
signal sali:
signal aux1:
signal aux2:
begin

Behavioral of MOORE is
is (a,b,c,d,e);
std_logic_vector(1 downto 0);
estados;
estados;

--inclusin de la librera.
--declaracin de la entidad.
--declaracin de puertos.
--final de la entidad
--inicio de arquitectura
--variable enumerada creada.
-- signal para ayudarnos.

process (clk,ena)
begin
if (ena='0')then
aux2<=a;
elsif (ena='1')then
aux2<=aux1;

--inicio del process.

if (clk' event and clk='1')then

--funcionamiento por clk en


--flanco subida

case aux1 is
when a =>
if (dato='1')then
aux1<=e;

--comparacin del estado actual.

else

--condicin enable.

--asignacin de estado
--siguiente.

aux1<=b;
end if;
when b =>
if (dato='1')then
aux1<=c;
else
aux1<=b;
end if;
when c=>
if (dato='1')then
aux1<=e;
else
aux1<=d;
end if;
when d =>
if (dato='1')then
aux1<=c;
else
aux1<=b;
end if;
when e =>
if (dato='1')then
aux1<=e;
else
aux1<=d;
end if;
end
end
end
end

case;
if;
if;
process;

with aux2 select


sali<="00" when a,
"00" when
"01" when
"10" when
"00" when
q1<=sali(1);
q0<=sali(0);
end Behavioral;

--asignacin de salidas a los


--estados
b,
c,
d,
others;
--asignacin de la salida
--fin de arquitectura.

También podría gustarte