[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
相关推荐
chenlance15 小时前
基于FPGA的激光器多通道数据采集与波形控制系统设计
fpga开发
9527华安17 小时前
FPGA实现GTP高速收发器2路视频传输,基于aurora 8b10b编解码架构,提供4套工程源码和技术支持
图像处理·fpga开发·aurora·高速收发器·8b10b·derdes
cjie22118 小时前
lanczos插值引起的振铃现象
计算机视觉·fpga开发
liuluyang53018 小时前
Verilog 中 wire 与 wor 的区别详解
fpga开发·verilog
泛联新安18 小时前
国产化FPGA测试工具链--让你的FPGA设计验证更高效、更安全、更自主
fpga·eda·半导体
GateWorld2 天前
LCD显示技术完全指南:原理·制造·驱动·FPGA实现之点屏五 miniLVDS
fpga开发·lcd显示·fpga点亮屏幕·minilvds
nuoxin1142 天前
WILX1200HC-5TG144I替代 LCMXO2-1200HC-5TG144I(富利威)
人工智能·嵌入式硬件·fpga开发·电脑·硬件工程·dsp开发
Bahair_2 天前
【FPGA】使用fdatool设计滤波器系数,使用FIR Compiler导入系数联合滤波
fpga开发
qq_411262422 天前
硬件是ESP32-P4连接LAN8720A,正常初始化之后,设备DHCP失败
stm32·单片机·fpga开发
第二层皮-合肥3 天前
【数据采集专栏】时钟同步(有时钟卡方案)
fpga开发