[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
相关推荐
乌恩大侠12 小时前
【OAI】 USRP 在conf文件中的配置,RU选项
fpga开发
qq_小单车1 天前
xilinx-DNA
fpga开发·xilinx
Flamingˢ2 天前
FPGA中的嵌入式块存储器RAM:从原理到实现的完整指南
fpga开发
Flamingˢ2 天前
FPGA中的存储器模型:从IP核到ROM的深度解析与应用实例
网络协议·tcp/ip·fpga开发
FPGA小c鸡2 天前
【FPGA深度学习加速】RNN与LSTM硬件加速完全指南:从算法原理到硬件实现
rnn·深度学习·fpga开发
Aaron15882 天前
通信灵敏度计算与雷达灵敏度计算对比分析
网络·人工智能·深度学习·算法·fpga开发·信息与通信·信号处理
博览鸿蒙3 天前
IC 和 FPGA,到底区别在哪?
fpga开发
思尔芯S2C3 天前
FPGA原型验证实战:如何应对外设连接问题
fpga开发·risc-v·soc设计·prototyping·原型验证
Flamingˢ3 天前
FPGA实战:VGA成像原理、时序详解与Verilog控制器设计与验证
fpga开发
FPGA_小田老师3 天前
xilinx原语:OSERDES2(并串转换器)原语详解
fpga开发·lvds·xilinx原语·oserdese·并串转换