[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
相关推荐
嵌入式软硬件攻城狮1 小时前
9.读写DDR测试
fpga开发
幻智星科技6 小时前
多通道数据采集DMA设计详解
fpga开发·udp·硬件架构
泡泡糖的中文规格书11 小时前
HDLbits 1.4 学习笔记
fpga开发
智感子1 天前
FPGA触发采集:预触发、多通道同步与软硬件分工怎么落地
fpga开发
156082072192 天前
关于AGC性能测试
fpga开发
威嵌神州2 天前
国产化加固计算机项目选型笔记|板卡、整机、平板与定制模块评估要点
笔记·fpga开发·电脑
泡泡糖的中文规格书2 天前
HDLbits 1.2 学习笔记
fpga开发·学习笔记·verilog
樱木花道長2 天前
AMD Ross 深度系列 5:实战演示 —— MATLAB 到 FPGA,edge-detection 边缘检测全流程
fpga开发
吉他英雄一里3 天前
FPGA--RAM
fpga开发
szxinmai主板定制专家3 天前
储能 EMS、微网控制器选型:RK3588、RK3576、RK3568+FPGA 怎么选?多网、多 CAN、EMC 设计权衡
人工智能·深度学习·机器学习·fpga开发·工业网关·rk3576·电力网关