[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
相关推荐
博览鸿蒙4 分钟前
基于FPGA技术的数字存储示波器设计探讨
fpga开发
Saniffer_SH6 分钟前
【高清视频】企业级NVMe SSD (E3.S, U.2)和消费类M.2 SSD拆解分析
服务器·网络·数据库·驱动开发·测试工具·fpga开发·压力测试
嵌入式-老费25 分钟前
Linux camera驱动开发(ARM、FPGA、DDR共享总线)
图像处理·驱动开发·fpga开发
尤老师FPGA1 小时前
HDMI数据的接收发送实验(五)
fpga开发
范纹杉想快点毕业1 小时前
Zynq-7000 PS端开发深度技术指南:从硬件架构到实战应用
fpga开发·硬件架构
FPGA小迷弟1 小时前
FPGA工业常用接口:FPGA 的 SPI 总线多从机通信设计与时序优化
学习·fpga开发·verilog·fpga·modelsim
雨洛lhw11 小时前
基于 FPGA 的主机 IP 自动配置方案设计
udp·mac·ip·fpga·dhcp
Flamingˢ11 小时前
基于ARM的裸机程序设计和开发(一):Zynq SoC FPGA的诞生
arm开发·fpga开发
迎风打盹儿11 小时前
FPGA实现AGC自动增益控制:原理详解与Verilog实战
fpga·vivado·verilog hdl·agc·数字自动增益控制