[HDLBits] Dff16e

Create 16 D flip-flops. It's sometimes useful to only modify parts of a group of flip-flops. The byte-enable inputs control whether each byte of the 16 registers should be written to on that cycle. byteena1 controls the upper byte d15:8, while byteena0 controls the lower byte d7:0.

resetn is a synchronous, active-low reset.

All DFFs should be triggered by the positive edge of clk.

复制代码
module top_module (
    input clk,
    input resetn,
    input [1:0] byteena,
    input [15:0] d,
    output [15:0] q
);
    always@(posedge clk) begin
        if(~resetn)
            q<=16'b0;
        else begin
            if(byteena[0])
                q[7:0]<=d[7:0];
            if(byteena[1])
                q[15:8]<=d[15:8];
        end
    end
endmodule
相关推荐
Szime11 小时前
AD9694 国产替代方案:四通道高速 ADC 在通信与雷达项目中的选型参考
单片机·嵌入式硬件·fpga开发
kaizq14 小时前
在线MakerChip虚拟FPGA设计动态仿真实践
fpga开发·mulerun·makerchip·virtualfpgalab·在线动态仿真·imacopilot
FPGA小徐15 小时前
OV5640 摄像头 DDR3 缓存 HDMI/VGA 显示系统详解与
fpga开发
Monkey of Semi16 小时前
ARTIX-7 FPGA 核心板学习之FPGA Xilinx 7 series 命名规则
fpga开发
ALINX技术博客16 小时前
【黑金云课堂】FPGA技术教程Vitis开发:TCP以太网通信
网络协议·tcp/ip·fpga开发
FPGA小徐18 小时前
FPGA 电赛信号叠加与分离项目 完整工程包
fpga开发
FPGA小徐18 小时前
FPGA在做信号处理相比cpu的优势对比
fpga开发
Szime18 小时前
AD9218国产替代方向:双通道10位105MSPS ADC深智微科技选型经验
fpga开发
江鸟的坚持18 小时前
xilinx xadc 例化
fpga开发·xadc·xilinx xadc
明德扬19 小时前
AD采集卡适配方案交流:模块、板卡与FPGA示例工程支持
fpga开发