Modified DLD Awneet Final
Modified DLD Awneet Final
Decoder
library ieee;
use ieee.std_logic_1164.all;
entity decoder_2to4 is
begin
output <= "1000" when enable = '1' and input = "00" else
"0000";
end dataflow;
ALU
library ieee;
use ieee.std_logic_1164.all;
entity alu_1bit is
port (
A : in std_logic;
B : in std_logic;
O1 : out std_logic;
O0 : out std_logic
);
component decoder_2to4 is
end component;
begin
INPUT_DEC<= (A&B);
control_decoder: decoder_2to4 port map (input => control,enable => '1',output =>
control_decoder_out);
or_decoder: decoder_2to4 port map ( input => INPUT_DEC, enable => control_decoder_out(3),
output => or_decoder_out); -- Enabled when control = "11" (Logical OR)
-- Assign the outputs directly from the operation decoders
end dataflow;