[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
相关推荐
ALINX技术博客6 小时前
【黑金云课堂】FPGA技术教程Vitis开发:PS端SD读写
fpga开发·vitis·sd读写
泛联新安6 小时前
VHawk-Lint——军工FPGA/ASIC设计质量自主可控的基石
fpga·芯片设计·eda
派勤电子7 小时前
2026 支持 FPGA 工控机 AI 加速应用场景详解
gpu·fpga·npu·工控机·ai工控机·fpga工控机·工业级工控机
尤老师FPGA7 小时前
LVDS系列50:Xilinx Ultrascale系 ADC LVDS接口参考方法(十二)
fpga开发
zlinear数据采集卡7 小时前
模拟输入限流保护电路深度解析:从理论原理到ZLinear采集卡的实战设计
c语言·单片机·嵌入式硬件·fpga开发·自动化
Dillon Dong19 小时前
【风电控制】FPGA采集Vdc的ADC增益系数解析——从数字码到实际电压的桥梁
算法·fpga开发·变流器·风电控制
不会武功的火柴21 小时前
SystemVerilog语法(11)-面向对象编程下篇
面向对象·fpga·systemverilog·ic验证
ALINX技术博客1 天前
【黑金云课堂】FPGA技术教程FPGA基础:FIFO与Uart通信
fpga开发·uart·fpga·fifo
zlinear数据采集卡1 天前
定时器电路深度解析:从经典555到STM32定时器,从ZLinear采集卡的工程化设计实战
stm32·单片机·嵌入式硬件·fpga开发·自动化
逻辑诗篇1 天前
FT-M6678+JFM7VX690T互联调试
fpga开发