[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
相关推荐
Hi2024021712 分钟前
Cortex-A53 + GIC700 + Boot BRAM Vivado 全流程复现
arm·fpga·vivado
ALINX技术博客32 分钟前
【黑金云课堂】FPGA技术教程Linux开发:系统定制
linux·运维·fpga开发
塔能物联运维3 小时前
**塔能两相液冷:量化交易场景下的硬核验证,±1.5℃控温如何转化为真金白银**
人工智能·fpga开发·两相液冷
Eloudy4 小时前
Holoscan Sensor Bridge 入门指南(Getting Started)
gpu·fpga·rdma
西安景驰电子1 天前
PCIe 授时卡原理及应用
运维·服务器·windows·单片机·嵌入式硬件·fpga开发
落chen1 天前
基于Vivado的FIFO-IP核-强化篇
fpga开发
公众号:fuwuqiBMC1 天前
(转自“服务器BMC”)服务器BMC芯片——AST1840
运维·服务器·fpga开发
国科安芯1 天前
还是4位?ASC8T245S 与 ASC4T245S 的双向电平转换选型实战
单片机·嵌入式硬件·物联网·fpga开发·机器人·云计算
思尔芯S2C1 天前
白皮书|从RTL适配到硅前验证:如何构建有价值的FPGA原型平台
fpga开发·soc·芯片·验证·asic·prototyping·原型验证
Rambo.xia2 天前
接口协议避坑 · 第5篇:多器件级联时序踩坑实录
fpga开发