|
- module hc153( //双路四选一数据选择器/多路复用器 VCC:Pin16 GND:Pin8
- input [3:0] X1, //[4位宽] 译码1输入 Pin:3,4,5,6
- input [3:0] X2, //[4位宽] 译码2输入 Pin:13,12,11,10
- input A, //地址线A(低位) Pin14
- input B, //地址线B(高位) Pin2
- input E1, //低电平使能译码1 高电平输出低电平 Pin1
- input E2, //低电平使能译码2 Pin15
- output Y1, //译码1输出 Pin7
- output Y2 //译码2输出 Pin9
- );
- assign Y1 = E1 ? 1'b0 : X1[{B,A}];
- assign Y2 = E2 ? 1'b0 : X2[{B,A}];
- endmodule
- module main(
- input clk, //50Mhz输入 Pin17
- output outA, //25Mhz输出 Pin40
- output outB //12.5Mhz输出 Pin42
- );
- reg A,B;
- hc153 U1(
- .X1(4'b1010),
- .X2(4'b1100),
- .A(A),
- .B(B),
- .E1(1'b0),
- .E2(1'b0),
- .Y1(outA),
- .Y2(outB)
- );
- always @(posedge clk) begin
- {B,A} <= {B,A} + 2'b1;
- end
- endmodule
复制代码 |
|