[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
相关推荐
2601_9618454236 分钟前
2027考研数学大纲|数一数二数三
考研·fpga开发·ar·vr·mr·oneflow
X_xcccc4 小时前
2026年嵌入式智能核心,从异构计算到敏捷开发的硬核指南
fpga开发·敏捷流程·zynq-7000·fpga板卡定制
9527华安5 小时前
FPGA实现GTX Transceivers Wizard传输2路视频,基于aurora 8b10b编解码架构,提供4套工程源码和技术支持
fpga开发·aurora·gtx·高速接口·高速收发器·transceivers
泛联新安7 小时前
VHawk-CDC:国内首款自主可控跨时钟域分析验证工具,破解FPGA设计CDC验证难题
fpga·跨时钟域·验证工具
ALINX技术博客7 小时前
【黑金云课堂】FPGA技术教程Linux开发:摄像头GPU渲染显示/Qt OpenGLES使用
linux·qt·fpga开发·gpu
S&Z34637 小时前
SZ901下载器烧写国产Flash指南
fpga开发
liuluyang5308 小时前
Verilog-1995风格,reg变量声明两次
fpga开发
cjie2219 小时前
安路好用的调试工具VPI
fpga开发
chenlance1 天前
基于FPGA的激光器多通道数据采集与波形控制系统设计
fpga开发
9527华安1 天前
FPGA实现GTP高速收发器2路视频传输,基于aurora 8b10b编解码架构,提供4套工程源码和技术支持
图像处理·fpga开发·aurora·高速收发器·8b10b·derdes