[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
相关推荐
国科安芯5 小时前
ASC8T245S:把 8 位并行总线稳稳“跨过“电压域的双电源收发器
网络·分布式·单片机·嵌入式硬件·fpga开发·架构
HUSTCH20215 小时前
DW IP详解
fpga开发
明德扬5 小时前
Xilinx下载文件里的BIT、BIN、MCS有什么区别?先分清JTAG配置和Flash启动
fpga开发·fpga
IT信息时代8 小时前
FPGA技术未来竞争发展出路
fpga开发
昆山森启智能科技有限公司11 小时前
FPGA控制器
fpga开发
昆山森启智能科技有限公司11 小时前
基于深度学习GPU(ORIN NX)+FPGA双光谱视频处理模块
人工智能·深度学习·fpga开发
LCMICRO-1331084774611 小时前
国产长芯微LD151完全P2P替代ADP151,是一款超低噪声、低压差线性稳压器
单片机·嵌入式硬件·fpga开发·硬件工程·电子工程师·线性稳压器·adp151
X_xcccc1 天前
2026高端FPGA选型指南与核心供应商解析
fpga开发
Terasic友晶科技1 天前
【教程】Agilex 5 SOC FPGA的HPS端如何响应FPGA端中断(二)——修改Quartus工程(GHRD工程)
fpga开发·terasic·agilex 5 soc·ghrd工程
sramdram1 天前
FPGA系统SRAM外扩芯片选型与工程应用要点
fpga开发·sram·fpga系统·外扩芯片·sram外扩芯片