DLD Lab Prog
DLD Lab Prog
library ieee;
use ieee.std_logic_1164.all;
entity basicgates is
port (
input_1: in std_logic;
input_2: in std_logic;
and_result: out std_logic
or result: out std_logic;
not_result: out std_logic;
);
end basicgates;
MULTIPLEXER PROGRAM
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity demux is
Port ( i : in std_logic;
sel : in std_logic_vector(1 downto 0);
z : out std_logic_vector(3 downto 0));
end demux;
entity demux is
Port ( i : in std_logic;
sel : in std_logic_vector(1 downto 0);
z : out std_logic_vector(3 downto 0));
end demux;
end Behavioral;
K-MAP
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity kmap is
Port ( a : in std_logic;
b : in std_logic;
c : in std_logic;
d : in std_logic;
y : out std_logic);
end kmap;
begin
y<=((a and not b) or(b and d) or(c and not(d)));
end Behavioral;
BCD PROGRAM
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity bcd is
Port ( sel : in std_logic_vector(3 downto 0);
z : out std_logic_vector(15 downto 0));
end bcd;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity decode is
Port ( sel : in std_logic_vector(2 downto 0);
zout : out std_logic_vector(7 downto 0));
end decode;