Professional Documents
Culture Documents
Laboratorium Sistem Digital: Tugas Pendahuluan
Laboratorium Sistem Digital: Tugas Pendahuluan
Tugas Pendahuluan
1. 32 bit 2 to 1 Multiplexer
VHDL CODE :
library ieee;
use ieee.std_logic_1164.all;
entity twomultiplexer is
port(
D1 : IN std_logic_vector (31 DOWNTO 0);
D2 : IN std_logic_vector (31 DOWNTO 0);
Y : OUT std_logic_vector (31 DOWNTO 0);
S : IN std_logic
);
end twomultiplexer;
architecture behavioral of twomultiplexer is
BEGIN
Y <= D1 when (S = '1') else D2;
END behavioral;
FUNCTIONAL SIMULATIONAL
TIMING SIMULATIONAL
2. 32 bit 4 to 1 Multiplexer
VHDL CODE :
library ieee;
use ieee.std_logic_1164.all;
entity formulti is
port (
D1 : IN STD_LOGIC_VECTOR (31 DOWNTO 0);
D2 : IN STD_LOGIC_VECTOR (31 DOWNTO 0);
D3 : IN STD_LOGIC_VECTOR (31 DOWNTO 0);
TIMING SIMULATIONAL
3. 5 bit 4 to 1 Multiplexer
VHDL CODE
library ieee;
use ieee.std_logic_1164.all;
entity formulti5bit is
port (
D1 : IN STD_LOGIC_VECTOR (4 DOWNTO 0);
D2 : IN STD_LOGIC_VECTOR (4 DOWNTO 0);
D3 : IN STD_LOGIC_VECTOR (4 DOWNTO 0);
D4 : IN STD_LOGIC_VECTOR (4 DOWNTO 0);
Y : OUT STD_LOGIC_VECTOR (4 DOWNTO 0);
S : IN STD_LOGIC_VECTOR (1 DOWNTO 0)
);
END formulti5bit;
architecture behavioral of formulti5bit is
BEGIN
Y <= D1 when (S = "00") else
D2 when (S = "01") else
D3 when (S = "10") else
D4;
END behavioral;
FUNCTIONAL SIMULATIONAL
TIMING SIMULATIONAL
4. KOMPARATOR
VHDL CODE
library ieee;
use ieee.std_logic_1164.all;
entity komparator is
port (
D1 : IN STD_LOGIC_VECTOR (31 DOWNTO 0);
D2 : IN STD_LOGIC_VECTOR (31 DOWNTO 0);
EQ : OUT STD_LOGIC
);
end komparator;
TIMING SIMULATION
5. BUS MERGING
VHDL CODE :
library ieee;
use ieee.std_logic_1164.all;
entity bus_merger is
port (
TIMING SIMULATION