回覆列表
-
1 # eb一歲就可帥了
-
2 # 使用者8451710051916
module eda_top(clk, rst_n, din, dout);
input clk;
input rst_n;
input din;
output dout;
module1_name instance1(
.clk(clk),
.rst_n(rst_n),
.din(din),
.dout(dout1)
);
module2_name instance2(
.clk(clk),
.rst_n(rst_n),
.din(dout1),
.dout(dout2)
);
assign dout = dout2;
endmodule
LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;ENTITYselect1_8ISPORT(Q:INSTD_LOGIC_VECTOR(3DOWNTO0);sel:INSTD_LOGIC_VECTOR(2DOWNTO0);D0,D1,D2,D3,D4,D5,D6,D7:OUTSTD_LOGIC_VECTOR(3DOWNTO0));ENDselect1_8;ARCHITECTUREabcOFselect1_8ISBEGINPROCESS(sel)BEGINCASEselISWHEN"000"=>D0<=Q;WHEN"001"=>D1<=Q;WHEN"010"=>D2<=Q;WHEN"011"=>D3<=Q;WHEN"100"=>D4<=Q;WHEN"101"=>D5<=Q;WHEN"110"=>D6<=Q;WHENOTHERS=>D7<=Q;ENDCASE;ENDPROCESS;ENDabc;