本文主要是介绍FPGA之16:1复选器,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
每个slice 都有一个F8MUX。F8MUX原语:
MUXF8 MUXF8_inst(
.0(0),Il Output of MUX to general routing
.I0(10),//Input(tie to MUXF7L/LO out)
.I1(11),/IInput(tie to MUXF7 L/LO out)
.S(S)
//Input select to MUX
):
F8MUX T FIAMUX fI F7BMUX H.UE 27 1(16:1#T-个 slice 中只能实现一个16:1多路复选器,如图下图所示。
16:1复选器不经过 D触发器的对应代码:always@(*)
case((BX,AX,SELB[1:0]))
4b0000:AMUX=DATA_A[O]:
4b0001:AMUX=DATA_A[1]:
4b0010:AMUX=DATA_A[2]:
4'b0011:AMUX=DATA_A[3]:
4'b0100:AMUX=DATA_B[O]:
4'b0101:AMUX=DATA B[I]:
4b0110:AMUX=DATA B[2]:
4b0111:AMUX=DATA B[3]:
4b1000:AMUX=DATA_C[O]:
4b1001:AMUX=DATA_C[I]:
4b1010:AMUX=DATA_C[2]:
4b1011:AMUX=DATA_C[3]:
4b1100:AMUX=DATA_D[O]:
4b1101:AMUX=DATA D[1]:
4b110:AMUX=DATA_D[2]:
4b1111:AMUX=DATA D[3]:
default:AMUX=l'bx:
endcase
16:1复选器经过D触发器的对应代码:
always@(posedge CLK)
case((BX.AX,SELB[L:0])
4'b0000:AMUX <=DATA_A[0]:
4b0001:AMUX <=DATA_A[1]:
4b0010:AMUX <=DATA_A[2]:
4b0011:AMUX <=DATA_A[3]:
4b0100: AMUX <=DATA_B[0]:
4b0101:AMUX <=DATA B[1):
4'b0110: AMUX <=DATA B[2]:
4b0111:AMUX <=DATA B[3]:
4b1000: AMUX <=DATA_C[0]:
4b1001: AMUX<=DATA_C[I]:
4b1010: AMUX <=DATA_C[2]:
4b1011:AMUX <=DATA_C[3]:
4b1100: AMUX <=DATA_D[O];
4b1101: AMUX <=DATA_D[1]:
4b1110: AMUX <=DATA_D[2]:
4b1111:AMUX<=DATA_D[3]:
default: AMUX <= l'bx;
endcase
这篇关于FPGA之16:1复选器的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!