DSD Assignment
DSD Assignment
Electronics Stream
Submitted to:Mr.Henok T.
Submission day: 8/7/2024G.C.
1. Design a combinational circuit (MUX 4 to 1) using hardware description language and prepare a
report.
● VHDL code
library IEEE;
use IEEE.std_logic_1164.all;
use work.all;
entity mux4to1 is
port(
Y:out std_logic
);
end mux4to1;
I(3);
end behav;
● Testbench code
library IEEE;
use IEEE.std_logic_1164.all;
entity mux4to1_tb is
end mux4to1_tb ;
component mux4to1
port(
);
end component;
process
begin
for i in 0 to 3 loop
for j in 0 to 15 loop
end loop;
end loop;
end process;
end tb_arch;
● Simulation waveform
WAVEFORM
● Synthesis, RTL viewer and Technology map viewer
SYNTHESIS IN QUARTUS:
RTL VIEWER:
TECHNOLOGY MAP VIEWER(POST MAPPING):
Part I
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY part1 IS
END part1;
BEGIN
END Behavior
Part II
library ieee;
use ieee.std_logic_1164.all;
entity 4bit is
port (
-- S
SW9: in std_logic;
-- X
SW3: in std_logic;
SW2: in std_logic;
SW1: in std_logic;
SWO : in std_logic;
--Y
SW7: in std_logic;
SW6 : in std_logic;
SW5: in std_logic;
SW4: in std_logic;
Unused
end 4bit;
begin
LEDR4 <= 0;
LEDR5 <= 0;
LEDR6 <= 0;
LEDR7 <= 0;
LEDR8 <= 0;
use ieee.std_logic_1164.all;
entity 2bit is
port (
- - SO AND S1
SW9 : in std_logic;
SW8: in std_logic;
- - UO AND U1
SW7: in std_logic;
SW6: in std_logic;
- - VO AND V1
SW5: in std_logic;
SW4: in std_logic;
- - WO AND W1
SW3: in std_logic;
SW2: in std_logic;
- - XO AND X1
SW1: in std_logic;
SWO: in std_logic;
- - MO AND M1
- - Unused
end 2bit;
begin
LEDR9 <= 0;
LEDRO <=(
(NOT (S8) AND (NOT (SW9) AND SW7) OR (SW9 AND SW5))
OR
(S8 AND (NOT (SW9) AND SW3) OR (SW9 AND SW1)))
);
LEDR1 <= (
LEDR2 <= 0;
LEDR3 <= 0;
LEDR4 <= 0;
LEDR5 <= 0;
LEDR6 <= 0;
LEDR7 <= 0;
LEDR8 <= 0;
Part IV
library IEEE;
use IEEE.std_logic_1164.all;
- - ENTITY seven_segment_decoder IS
- - Inputs
PORT (
c1: IN STD_LOGIC;
co: IN STD_LOGIC
);
- - Outputs
PORT (
HEXO: OUT STD_LOGIC_VECTOR(0 TO 6)
);
BEGIN
ΗΕΧ0 (0) <= NOT (c0 AND c1); - - Segment a (active low)
Part V
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY part5 IS
COMPONENT mux_2bit_4to1
END COMPONENT;
COMPONENT char_7seg
END COMPONENT;
BEGIN
U0: mux_2bit_4to1 PORT MAP (SW(9 DOWNTO 8), SW(7 DOWNTO 6), SW(5
DOWNTO 4),
...
END Behavior;
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY mux_2bit_4to1 IS
END Behavior;
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY char_7seg IS
END char_7seg;
END Behavior;