您好,欢迎访问三七文档
BeijingTechshineTechnologyCo.TOPSUN44AiBiHiCi2-12-12-1BiAiHiCi00000110101011012-1BiAiBiAiHi•+•=BiAiCi•=half-adder.vhd,ab,c0s,c0,sBiAiHiCiHiCi10000201103101041101BeijingTechshineTechnologyCo.TOPSUN453-13-1Ci-1Ci3-13-1Ci-1BiAiSiCi00000001100101001101100101010111001111113-11111−−−−••+••+••+••=iiiiCBiAiCBiAiCBiAiCBiAiSi11−−•+•+•=iiCBiCAiBiAiCiAiBiHiCi-1748074817483fulladder.vhd,abcinAiBiCi-1c0sum,CiSiBiAiCi-1SiCiBeijingTechshineTechnologyCo.TOPSUN46Ci-1BiAiSiCiSiCi0000000110010100110110010101011100111111BeijingTechshineTechnologyCo.TOPSUN478884-1Ci-1Ci4-18add_8.vhd171717a0a7b0~b7cina0a7b0~b78cin999sum0~sum7coutsum0~sum7coutCi-1Bi(7..0)Ai(7..0)Si(7..0)Ci0000000000000000000000000100000000011111110111111100111111111111111110000000000000000100000001000000001111111100000000011111111100000000Bi(7..0)Ai(7..0)Ci-1Si(7..0)CiBeijingTechshineTechnologyCo.TOPSUN48NN4-1add_n..vhd9a0~a3b0~b3cin,a0~a3b0~b3Ai0~Ai3Bi0~Bi3cinCi-155sum0~sum3cout,sum0~sum3Si0~Si3,coutCiCi-1Bi(3..0)Ai(3..0)Si(3..0)Ci000000000000010000011101110011111111100000000100010000111100000111110000Bi(N-1..0)Ai(N-1..0)Ci-1Si(N-1..0)CiBeijingTechshineTechnologyCo.TOPSUN49AiBiDiCi6-16-16-16-1BiAiDiCi0000011110101100BiAiBiAiDi+=BiAiCi=6-26-26-21111−−−−+++=iiiiAiBiCCAiBiBiCAiBiCAiDi11−−++=iiBiCBiAiCAiCi6-2Ci-1BiAiDiCi000000011001010011011001010101BiAiCi-1Si(N-1..0)CiBeijingTechshineTechnologyCo.TOPSUN501100111111full_sub.vhdabdinAiBiCi-1subdoutDiCiCi-1BiAiDiCiDiCi00000001100101001101100101010111001111114/BeijingTechshineTechnologyCo.TOPSUN514/4//7-1ctl=107-14/add_sub.vhdadd_sub2.vhdadd_subna0~a3b0~b3q0~q4q4LEDa0~a3b0~b3,sub0~sub4sum0~sum4a0~a3b0~b3a0~a3b0~b3sub0~sub4sub4sum0~sum4sum4LEDBeijingTechshineTechnologyCo.TOPSUN524ArrayMultiplier4ParticalProductaba3b0a2b0a1b0a0b0OXCX-1CXPX8-1P8-1mux4.vhda0~a3,b0~b3,c0~c7,BeijingTechshineTechnologyCo.TOPSUN538-24X4BeijingTechshineTechnologyCo.TOPSUN544ABABABAB9-1AEQB=A’B’+AB=(AB)’AB=AB’AB=A’B9-1ABA=BABAB0010001001100101110044VHDLVHDL3VHDLlibraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;entitycompisport(a,b:instd_logic_vector(2downto0);sel_f:instd_logic_vector(1downto0);q:outBoolean);end;architectureaofcompisbeginprocess(sel_f,a,b)begincasesel_fiswhen”00”=q=a=b;when”01”=q=ab;when”10”=q=ab;whenothers=q=false;endcase;endprocess;enda;comp.vhdBeijingTechshineTechnologyCo.TOPSUN55A0~A3B0~B3CLKRSTA0~A3B0~B3CLKRSTAEQBA=BAGTBABALTB(AB)BeijingTechshineTechnologyCo.TOPSUN56161VHDL2if-when-elsecasewithselectVHDLwhenelseVHDL121libraryieee;useieee.std_logic_1164.all;entitymux2isport(a,b,sel:instd_logic;q:outstd_logic);end;architectureaofmux2isbeginq=awhensel=’0’elseb;end;161VHDLcase16110-110-1161selc.vhdDATA0~DATA15S0~S3ZS0~S3321BeijingTechshineTechnologyCo.TOPSUN5716-44-28-316-48-38-311-111-111-18-311-18-3EIN0N1N2N3N4N5N6N7NA2NA1NA0NGSNEON1XXXXXXXX11111011111111111100XXXXXXX0000010XXXXXX01001010XXXXX011010010XXXX0111011010XXX01111100010XX011111101010X01111111100100111111111101VHDLLIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;ENTITYENCODEISPORT(D:INSTD_LOGIC_VECTOR(7DOWNTO0);EIN:INSTD_LOGIC;A0N,A1N,A2N,GSN,EON:OUTSTD_LOGIC);ENDENCODE;ARCHITECTUREAOFENCODEISSIGNALQ:STD_LOGIC_VECTOR(2DOWNTO0);BEGINBeijingTechshineTechnologyCo.TOPSUN58A0N=Q(0);A1N=Q(1);A2N=Q(2);PROCESS(D)BEGINIFEIN=’1’THENQ=”111”;GSN=’1’;EON=’1’;ELSIFD(0)=’0’THENQ=”111”;GSN=’0’;EON=’1’;ELSIFD(1)=’0’THENQ=”110”;GSN=’0’;EON=’1’;ELSIFD(2)=’0’THENQ=”101”;GSN=’0’;EON=’1’;ELSIFD(3)=’0’THENQ=”100”;GSN=’0’;EON=’1’;ELSIFD(4)=’0’THENQ=”011”;GSN=’0’;EON=’1’;ELSIFD(5)=’0’THENQ=”010”;GSN=’0’;EON=’1’;ELSIFD(6)=’0’THENQ=”001”;GSN=’0’;EON=’1’;ELSIFD(7)=’0’THENQ=”000”;GSN=’0’;EON=’1’;ELSIFD=”11111111”THENQ=”111”;GSN=’1’;EON=’0’;ENDIF;ENDPROCESS;ENDA;encode.vhd16-4D0~D1516EINEONGSN2A0N~A3N11-18-3BeijingTechshineTechnologyCo.TOPSUN594-162-43-84-163-83-812-112-112-13-812-13-8G1G2AG2BABCY0NY1NY2NY3NY4NY5NY6NY7N0XXXXX111111111000000111111110000110111111100010110111111000111110111110010011110111100101111110111001101111110110011111111110VHDL3-8LIBRARYieee;USEieee.std_logic_1164.ALL;ENTITYdecoder3_8ISPORT(A,B,C,G1,G2A,G2B:INSTD_LOGIC;Y:OUTSTD_LOGIC_VECTOR(7DOWNTO0));ENDdecoder3_8;ARCHITECTUREfunOFdecoder3_8ISSIGNALindata:STD_LOGIC_VECTOR(2DOWNTO0);BEGINindata=C&B&A;encoder:BeijingTechshineTechnologyCo.TOPSUN60PROCESS(indata,G1,G2A,G2B)BEGINIF(G1='1'ANDG2A='0'ANDG2B='0')THENCASEindataISWHEN000=Y=11111110;WHEN001=Y=11111101;WHEN010=Y=11111011;WHEN011=Y=11110111;WHEN100=Y=11101111;WHEN101=Y=11011111;WHEN110=Y=10111111;WHEN111=Y=01111111;WHENOTHERS=Y=XXXXXXXX;ENDCASE;ELSEY=11111111;ENDIF;ENDPROCESSencoder;ENDfun;decoder3_8.vhd4-16ABCDG1G2AG2BG2CABCDG1G2AG2BG2CY0~Y151612-13-8BeijingTechshineTechnologyCo.TOPSUN614011842113-113-184218421B8B4B2B1/PP00001000010100100100111001000101011001101001110110000110011010101010110111001011010111100111111013-1842101B8B41X101B2B11X20113-18421BeijingTechshineTechnologyCo.TOPSUN62D0~D3NPP13-14BeijingTechshineTechnologyCo.TOPSUN63BCD4BCD14-114-1D3D2D1D0B4B3B2B1B0000000000000100001001000010
本文标题:5组合逻辑电路设计
链接地址:https://www.777doc.com/doc-3619456 .html