[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
相关推荐
FPGA-ADDA10 小时前
第五篇(下):智能无线电与6G候选技术——从机器学习到通感一体化
人工智能·机器学习·信号处理·fpga·通信系统
maverick_11111 小时前
【FPGA】关于两个数相加的“坑”
c语言·matlab·fpga开发
碎碎思11 小时前
经典复活:3dfx Voodoo 显卡,正在被 FPGA“重做一遍”
fpga开发
listhi52013 小时前
基于FPGA的电压表与串口通信系统设计
fpga开发
rit843249914 小时前
基于FPGA的数字秒表设计(Verilog实现)
fpga开发
tiantianuser16 小时前
RDMA设计64:数据吞吐量性能测试分析
网络·fpga开发·rdma·fpga设计·高速传输·roce v2
木心术116 小时前
OpenClaw FPGA工程开发全流程指南
fpga开发
dadaobusi1 天前
ZeBu的runClk原理
fpga开发
第二层皮-合肥1 天前
50天学习FPGA第32天-添加HDL属性调试
学习·fpga开发
minglie11 天前
MAC,PHY,变压器,RJ45
fpga开发