[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
相关推荐
知识充实人生18 小时前
FPGA设计杂谈之十一:时序报告中时钟的上升沿与下降沿详解
fpga开发·时序分析·rise·fall·negedge·posedge
FPGA小迷弟2 天前
FPGA工程师面试题汇总(二十五)
网络协议·tcp/ip·fpga开发·verilog·fpga
Flamingˢ2 天前
ZYNQ + OV5640 + HDMI 视频系统调试记录:一次 RGB888 与 RGB565 引发的黑屏问题
arm开发·嵌入式硬件·fpga开发·vim·音视频
Flamingˢ2 天前
YNQ + OV5640 视频系统开发(二):OV5640_Data IP 核源码解析
arm开发·嵌入式硬件·网络协议·tcp/ip·fpga开发·vim·音视频
Flamingˢ2 天前
ZYNQ + OV5640 视频系统开发(三):AXI VDMA 帧缓存原理
arm开发·嵌入式硬件·fpga开发·vim·音视频
通信小呆呆2 天前
噪声体制近程雷达信号处理:从理论推导到SoC系统实现
信号处理·fpga·雷达·噪声雷达
LabVIEW开发3 天前
LabVIEW振动信号采集分析
fpga开发·labview·labview知识·labview功能·labview程序
发光的沙子3 天前
FPGA----vitis生成静态链接库
fpga开发
FPGA小迷弟3 天前
FPGA工程师面试题汇总(二十四)
网络协议·tcp/ip·fpga开发·verilog·fpga
cici158743 天前
基于FPGA的任意四位除法器设计与实现
fpga开发