[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. byteena[1] controls the upper byte d[15:8], while byteena[0] controls the lower byte d[7: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
相关推荐
XINVRY-FPGA2 天前
XC7VX690T-2FFG1157I Xilinx AMD Virtex-7 FPGA
arm开发·人工智能·嵌入式硬件·深度学习·fpga开发·硬件工程·fpga
R.X. NLOS2 天前
Zynq AXI DMA 环回测试调试指南:从 Cache 一致性到 Vitis 同步机制
fpga
Terasic友晶科技2 天前
【案例展示】友晶科技全息传感器桥接解决方案
科技·fpga开发·holoscan·agilex 5·terasic
学习永无止境@2 天前
Verilog中有符号数计算
图像处理·算法·fpga开发
FPGA-ADDA2 天前
第四篇:射频数据转换器(RF-DAC)——重构模拟信号的关键
ai·fpga·rfsoc·vu13p·xczu47dr
学习永无止境@2 天前
Sobel边缘检测的MATLAB实现
图像处理·opencv·算法·计算机视觉·fpga开发
fei_sun2 天前
数字芯片流程
fpga开发
YaraMemo2 天前
射频链的构成
5g·fpga开发·信息与通信·信号处理·射频工程
fei_sun2 天前
逻辑设计工程技术基础
fpga开发
fei_sun2 天前
有限状态机设计基础
fpga开发