Sei sulla pagina 1di 6

INSTITUTO

POLITCNICO NACIONAL

Unidad Profesional Interdisciplinaria de Ingeniera

Campus Hidalgo





Unida Lgica Aritmtica de 8 bits



Alumno

Oropeza Oropeza Brandon

Boleta

2016680051



Unidad de Aprendizaje

Circuitos Lgicos




Noviembre de 2017












Cdigo


library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use ieee.numeric_std.all;

entity aluuno is
Port ( hab: in std_logic;
sel: in std_logic_vector(2 downto 0);
a,b: in std_logic_vector(7 downto 0);
resultado: out std_logic_vector(7 downto 0);
c_sal: out std_logic);
end aluuno;

architecture aludos of aluuno is
signal tempo: std_logic_vector(8 downto 0);

begin
process (hab,a,b,sel)
begin
if hab='1' then
if (sel="000") then tempo<=std_logic_vector(unsigned('0'&a)+unsigned('0'&b));
elsif (sel="001") then tempo<=std_logic_vector((unsigned('0'&a)+1));
elsif (sel="010") then tempo<=std_logic_vector(unsigned('0'&a)-unsigned('0'&b));
elsif (sel="011") then tempo<=std_logic_vector(unsigned(0&a)-1);
elsif (sel="100") then tempo<='0'&(not A);
elsif (sel="101") then tempo<='0'&(not B);
elsif (sel="110") then tempo<='0'&(A or B);
else tempo<='0'&(A and B);
end if;
else tempo<="ZZZZZZZZZ";
end if;
end process;
resultado <=tempo(7 downto 0);
c_sal<=tempo(8);
end aludos;





Simulaciones






Si habilitadora est en estado bajo, la Si habilitadora est en estado alto, la
salida manda alta impedancia sin salida estar en funcin del modo de

importar lo que tengan las dems operacin que se elija.
entradas.



--Aritmtico

Binario



Decimal












Binario




Decimal












--Lgico

Potrebbero piacerti anche