[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
相关推荐
unicrom_深圳市由你创科技2 小时前
国产FPGA的芯片选型应该考虑哪些因素?
fpga开发
明德扬3 小时前
高速采集选 Direct RF 还是外置 ADC/FMC?从采样率、JESD204B 和开发周期对比
fpga开发·fpga
明德扬3 小时前
机器人为什么需要“感知—控制—计算”一体化?FPGA 多传感器底板设计要点
fpga开发·机器人·fpga
zlinear数据采集卡7 小时前
数据采集卡从入门到精通(46):趋势展望——软件定义硬件、AI分析与开源生态
arm开发·stm32·单片机·嵌入式硬件·fpga开发·开源
落chen1 天前
基于FPGA的SDRAM开发-进阶篇
fpga开发
飞猫的边缘AI1 天前
边缘AI-5: 了解最灵活的计算芯片FPGA
人工智能·fpga开发·ai芯片·边缘ai·计算芯片·边缘ai芯片·titanium edge
badboy1211 天前
Xilinx Vitis Core Development Kit 2025.2.1_Win+Linux
linux·fpga开发·xilinx
海盐nnn2 天前
面向 AI 的 FPGA 开发流程:别急着让它写代码,先把方向定好
fpga开发
zlinear数据采集卡2 天前
数据采集卡从入门到精通(38):上位机开发实战——Python/QT/LabVIEW的技术选型与分层架构
python·单片机·嵌入式硬件·qt·fpga开发·开源·labview
zlinear数据采集卡2 天前
数据采集卡从入门到精通(42):项目实战三——设备预测性维护系统,从布点到预警
开发语言·单片机·嵌入式硬件·安全·fpga开发