UTNianos

Versión completa: [APORTE] 2º Parcial [TDI]
Actualmente estas viendo una versión simplificada de nuestro contenido. Ver la versión completa con el formato correcto.
Adjunto segundo parcial de Técnicas Digitales I tomado por Camilo Rodriguez Carabajales.

[attachment=5026]

[attachment=5027]
Dejo el VHDL del ejercicio 4, si alguien me lo corrige estarí[/code]a genial =D

--vhdl de maquina de estados conversion natural->complementoa2
library ieee;
use ieee.std_logic_1164.all;
--
entity maqestados is
port (y: in std_logic; z: out std_logic);
end maqestados;
--
architecture logica of maqestados is
type tipo_estado is (a,b,c,d,e,f,g);
signal estado: tipo_estado:=a;
signal est_prox: tipo_estado;
begin
process (estado)
begin
case estado is
when a=>if y='0' then z='0'; est_prox<=b; elsif y='1' then z='1'; est_prox<=c;
when b=>if y='0' then z='0'; est_prox<=d; elsif y='1' then z='1'; est_prox<=e;
when c=>if y='0' the z='1'; est_prox<=e; elsif y='1' then z='0'; est_prox<=e;
when d=>if y='0' the z='0'; est_prox<=f; elsif y='1' then z='1'; est_prox<=g;
when e=>if y='0' the z='1'; est_prox<=g; elsif y='1' then z='0'; est_prox<=g;
when f=>if y='0' the z='0'; est_prox<=a; elsif y='1' then z='1'; est_prox<=a;
when g=>if y='0' the z='1'; est_prox<=a; elsif y='1' then z='0'; est_prox<=a;
end case;
end process;
end logica;


Off-topic:
Falta agregar VHDL a la barra de código del editor de mensaje brunodiaz ... no sé si tiene sentido, se usa en TDI y no sé si alguna otra materia también.

--vhdl de maquina de estados conversion natural->complementoa2
library ieee;
use ieee.std_logic_1164.all;
--
entity maqestados is
port (y: in std_logic; z: out std_logic);
end maqestados;
--
architecture logica of maqestados is
type tipo_estado is (a,b,c,d,e,f,g);
signal estado: tipo_estado:=a;
signal est_prox: tipo_estado;
begin
process (estado)
begin
case estado is
when a=>if y='0' then z='0'; est_prox<=b; elsif y='1' then z='1'; est_prox<=c;
when b=>if y='0' then z='0'; est_prox<=d; elsif y='1' then z='1'; est_prox<=e;
when c=>if y='0' the z='1'; est_prox<=e; elsif y='1' then z='0'; est_prox<=e;
when d=>if y='0' the z='0'; est_prox<=f; elsif y='1' then z='1'; est_prox<=g;
when e=>if y='0' the z='1'; est_prox<=g; elsif y='1' then z='0'; est_prox<=g;
when f=>if y='0' the z='0'; est_prox<=a; elsif y='1' then z='1'; est_prox<=a;
when g=>if y='0' the z='1'; est_prox<=a; elsif y='1' then z='0'; est_prox<=a;
end case;
end process;
end logica;


matyary. Listo =)
Buenísimo, quedó 10pts.


--vhdl de maquina de estados conversion natural->complementoa2
library ieee;
use ieee.std_logic_1164.all;
--
entity maqestados is
port (y: in std_logic; z: out std_logic);
end maqestados;
--
architecture logica of maqestados is
type tipo_estado is (a,b,c,d,e,f,g);
signal estado: tipo_estado:=a;
signal est_prox: tipo_estado;
begin
process (estado)
begin
case estado is
when a=>if y='0' then z='0'; est_prox<=b; elsif y='1' then z='1'; est_prox<=c;
when b=>if y='0' then z='0'; est_prox<=d; elsif y='1' then z='1'; est_prox<=e;
when c=>if y='0' then z='1'; est_prox<=e; elsif y='1' then z='0'; est_prox<=e;
when d=>if y='0' then z='0'; est_prox<=f; elsif y='1' then z='1'; est_prox<=g;
when e=>if y='0' then z='1'; est_prox<=g; elsif y='1' then z='0'; est_prox<=g;
when f=>if y='0' then z='0'; est_prox<=a; elsif y='1' then z='1'; est_prox<=a;
when g=>if y='0' then z='1'; est_prox<=a; elsif y='1' then z='0'; est_prox<=a;
end case;
end process;
end logica;

URLs de referencia