VLSI Lab Experiment 7-1
VLSI Lab Experiment 7-1
Experiment No: 07
THEORY:
A bidirectional buffer includes first and second unidirectional buffer connected for retransmitting
signals and in opposite directions between first and second.
In bidirectional buffer, data can be transferred from both sides, chip enable is provided to enable
or disable chip. If CE=0, then the buffer is in high impedance state.
PROCEDURE:
4. Download Bitstream
OBSERVATIONS:
SIMULATION CODE:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity BidirectionalBuffer is
Port (
data_in : in std_logic_vector(3 downto 0); -- Input data lines
data_out : inout std_logic_vector(3 downto 0); -- Bidirectional data lines
clk : in std_logic; -- Clock signal
CE : in std_logic -- Chip Enable (Active HIGH)
);
end BidirectionalBuffer;
TESTBENCH CODE:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity BidirectionalBuffer_tb is
end BidirectionalBuffer_tb;
begin
-- Instantiate the Bidirectional Buffer
uut: BidirectionalBuffer
port map (
data_in => data_in_tb,
data_out => data_out_tb,
clk => clk_tb,
CE => CE_tb
);
-- Clock process
clk_process: process
begin
while now < 100 ns loop
clk_tb <= '0';
wait for 5 ns;
clk_tb <= '1';
wait for 5 ns;
end loop;
wait;
end process;
-- Stimulus Process
stim_proc: process
begin
-- Initial state: CE=0, data_out should be high impedance (Z)
CE_tb <= '0';
wait for 10 ns;
-- End simulation
wait;
end process;
end testbench;
RTL DIAGRAM:
WAVEFORM: