Professional Documents
Culture Documents
Segemvtupdate
Segemvtupdate
USE ieee.std_logic_1164.all;
ENTITY part5 IS
END part5;
COMPONENT mux_2bit_4to1
PORT ( S,U, V, W, X,Y,Z : IN STD_LOGIC_VECTOR(2 DOWNTO 0);
M : OUT STD_LOGIC_VECTOR(2 DOWNTO 0));
END COMPONENT;
COMPONENT char_7seg
PORT ( C : IN STD_LOGIC_VECTOR(2 DOWNTO 0);
Display : OUT STD_LOGIC_VECTOR(0 TO 6));
END COMPONENT;
begin
M5: mux_2bit_4to1 PORT MAP (Ch_Sel, Ch0, Ch1, Ch2, Ch3, Ch4, Ch5, H5_Ch);
M4: mux_2bit_4to1 PORT MAP (Ch_Sel, Ch5, Ch0, Ch1, Ch2, Ch3, Ch4, H0_Ch);
M3: mux_2bit_4to1 PORT MAP (Ch_Sel, Ch4, Ch5, Ch0, Ch1, Ch2, Ch3, H1_Ch);
M2: mux_2bit_4to1 PORT MAP (Ch_Sel, Ch3, Ch4, Ch5, Ch0, Ch1, Ch2, H2_Ch);
M1: mux_2bit_4to1 PORT MAP (Ch_Sel, Ch2, Ch3, Ch4, Ch5, Ch0, Ch1, H3_Ch);
M0: mux_2bit_4to1 PORT MAP (Ch_Sel, Ch1, Ch2, Ch3, Ch4, Ch5, Ch0, H4_Ch);
END Behavior;
//////////////////////////////////////////
library ieee;
use IEEE.STD_LOGIC_1164.all;
entity PART8 is
PORT (SW : IN STD_LOGIC_VECTOR(9 DOWNTO 7);
LEDR : OUT STD_LOGIC_VECTOR(9 DOWNTO 7);
Q,L,R : OUT STD_LOGIC_VECTOR(0 TO 6);
X,Y,U: OUT STD_LOGIC_VECTOR(0 TO 6));
end entity PART8 ;
architecture st of PART8 is
COMPONENT MUXA
PORT (G1,G2,G3,G4,G5,G6 : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
sel : in std_logic_vector(2 downto 0);
M: OUT std_logic_vector (3 DOWNTO 0) );
end COMPONENT ;
COMPONENT seg
PORT (C : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
Seven_Segment : OUT STD_LOGIC_VECTOR(0 TO 6));
end component ;
signal m,v,j,g,B: std_logic_vector(3 downto 0);
signal H5_Ch,H4_Ch,H3_Ch,H2_Ch,H1_Ch,H0_Ch: std_logic_vector(3 downto 0);
signal sel : std_logic_vector(2 downto 0);
begin
LEDR <=sel;
sel <= sw(9 downto 7);
m <= "0000" ;
v <= "0001" ;
j <= "0010" ;
g <= "0011" ;
B <= "0100" ;
M0 : MUXA port map (B,B,m,v,j,g,sel,H0_Ch) ;
end Behavior;
library ieee;
use ieee.std_logic_1164.all;
entity MUXA is
port ( G1 : in std_logic_vector(3 downto 0);
G2 : in std_logic_vector(3 downto 0);
G3 : in std_logic_vector(3 downto 0);
G4 : in std_logic_vector(3 downto 0);
G5 : in std_logic_vector(3 downto 0);
G6 : in std_logic_vector(3 downto 0);
sel : in std_logic_vector(2 downto 0);
M : out std_logic_vector(3 downto 0));
end entity;
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY mux_2bit_4to1 IS
PORT (S,U, V, W, X,Y,Z : IN STD_LOGIC_VECTOR(2 DOWNTO 0);
M : OUT STD_LOGIC_VECTOR(2 DOWNTO 0));
END mux_2bit_4to1;
begin
with S select
M <= U when "000",
V when "001",
W when "010",
X when "011",
Y when "100",
Z when "101",
END Behavior;
--------------------------7-seg-----------------------------------------
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY char_7seg IS
PORT ( C : IN STD_LOGIC_VECTOR(2 DOWNTO 0);
Display : OUT STD_LOGIC_VECTOR(0 TO 6));
END char_7seg;
begin
with C select
END Behavior;
-----------------------------------------------------------------