THIẾT KẾ SỐ- B3

download THIẾT KẾ SỐ- B3

of 19

Transcript of THIẾT KẾ SỐ- B3

  • 8/7/2019 THIT K S- B3

    1/19

    BI THO LUN S 3

    THIT K S BNG NGN NG M TPHN CNG - VHDL

    LP: IN T VIN THNG K2

    NHM THO LUN S 5

  • 8/7/2019 THIT K S- B3

    2/19

    DANH SCH NHM :

    NGUYN VN THC

    NGUYN HNG LM

    NGUYN VN QUYN

    BI XUN ANH

    BI DANH HONG PHM GIA TH

    V NH VINH

    O NH XUN

  • 8/7/2019 THIT K S- B3

    3/19

    MCH GII M 3-8

    -- LED 7 THANH

    library IEEE; use IEEE.STD_LOGIC_1164.all,IEEE.Numeric_STD.all; entity led72 is Port ( I : in STD_LOGIC_VECTOR (3 downto 0);

    Y : out std_logic_vector(6 downto 0)); end led72 ; architecture LOGIC of led72 is begin PROCESS (I)

  • 8/7/2019 THIT K S- B3

    4/19

    MCH GII M 3-8 BEGIN CASE I is

    when "0001" => Y Y Y Y Y Y Y Y Y

  • 8/7/2019 THIT K S- B3

    5/19

    M PHNG CHNG TRNH

    D:\TAI LIEU\VHDL\THUC

    HANH\led72\led72.qpf D:\TAI LIEU\VHDL\THUC

    HANH\led72\led72.vwf

  • 8/7/2019 THIT K S- B3

    6/19

    MCH GII M 3-8

    -- MACH GIAI MA 3_8 DUNG LENH elsif"

    library IEEE; use IEEE.STD_LOGIC_1164.all,IEEE.Numeric_std.all; entity mahoa3_8 is port (A: in integer range 0 to 7); Y: out unsigned (7 downto 0)); end entity mahoa3_8; architecture LOGIC of mahoa3_8 is begin process (A)

  • 8/7/2019 THIT K S- B3

    7/19

    MCH GII M 3-8 begin if(A=0) then Y

  • 8/7/2019 THIT K S- B3

    8/19

    MCH GII M 3-8

    -- MACH GIAI MA 3_8 DUNG LENH CASE "

    library IEEE; use IEEE.STD_LOGIC_1164.all,IEEE.Numeric_std.all; entity mahoa3_8 is port (A: in integer range 0 to 7); Y: out unsigned (7 downto 0)); end entity mahoa3_8; architecture LOGIC of mahoa3_8 is begin process (A)

    begin

  • 8/7/2019 THIT K S- B3

    9/19

    MCH GII M 3-8 case A is

    when 0 => Y Y Y Y Y Y Y Y

  • 8/7/2019 THIT K S- B3

    10/19

    MCH GII M 3-8 -- MACH GIAI MA 3_8 DUNG WITH A SELECT library IEEE; use IEEE.STD_LOGIC_1164.all,IEEE.Numeric_std.all; entity mahoa3_8 is port (A: in integer range 0 to 7); Y: out unsigned (7 downto 0));

    end entity mahoa3_8; architecture LOGIC of mahoa3_8 is begin process (A) begin

    with A select

  • 8/7/2019 THIT K S- B3

    11/19

    MCH GII M 3-8 Y

  • 8/7/2019 THIT K S- B3

    12/19

    MCH GII M 3-8

    -- MACH GIAI MA 3_8 DUNG FOR

    library IEEE; use IEEE.STD_LOGIC_1164.all,IEEE.Numeric_std.all; entity mahoa3_8 is port (A: in integer range 0 to 7);

    Y: out unsigned (7 downto 0)); end entity mahoa3_8; architecture LOGIC of mahoa3_8 is begin

    process (A)

  • 8/7/2019 THIT K S- B3

    13/19

  • 8/7/2019 THIT K S- B3

    14/19

    MCH GII M 3-8

    -- MACH GIAI MA 3_8 DUNG if

    library IEEE; use IEEE.STD_LOGIC_1164.all,IEEE.Numeric_std.all; entity mahoa3_8 is port (A: in integer range 0 to 7);

    Y: out unsigned (7 downto 0)); end entity mahoa3_8; architecture LOGIC of mahoa3_8 is begin

    process (A)

  • 8/7/2019 THIT K S- B3

    15/19

  • 8/7/2019 THIT K S- B3

    16/19

    CHNG TRNH CON

    -- CAC CHUONG TRINH CON DINH NGHIA ; --TREN TAP TIN HE THONG RIENG BIET ;

    Library IEEE; use Library

    IEEE.STD_LOGIC_1164.all,IEEE.Numeric_STD.all; package COLOR_TYPES is type pigmentcolorprime is ( red,yellow,Blue ); type pigmentcolorsec is ( Orange, violet,green); end package COLOR_TYPES ;

  • 8/7/2019 THIT K S- B3

    17/19

    CHNG TRNH CON use work.COLOR_TYPES.all; package SUBPROGS is

    procedure Mixcolor ( signal C1,C2: in pigmentcolorPrime; signal Mix : out pigmentcolorPrime); function Mixcolor (C1,C2: pigmentPrime);

    return pigmentseccolor; end package SUBPROGS; package body SUBPROGS is procedure Mixcolor ( signal C1,C2: in pigmentcolorPrime;

    signal Mix : out pigmentcolorsec) is

  • 8/7/2019 THIT K S- B3

    18/19

    CHNG TRNH CON begin if ( C1= red and C2= yellow ) then

    Mix

  • 8/7/2019 THIT K S- B3

    19/19

    CHNG TRNH CON begin if(C1=red and C2=yellow) then Mix:=violet; else (C1= yellow and C2=Blue ) then Mix:= Green;

    end if ; return Mix; end functon Mixcolor; end package body SUBPROGS;