[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
相关推荐
悲喜自渡72116 小时前
FPGA开发方式
fpga开发
芯门1 天前
FPGA商用级ISP(三):自动白平衡(AWB)算法实现与 FPGA 架构解析
图像处理·计算机视觉·fpga开发
jz_ddk1 天前
[实战] 从冲击响应函数计算 FIR 系数
python·fpga开发·信号处理·fir·根升余弦·信号成形
不吃橘子的橘猫1 天前
《集成电路设计》复习资料2(设计基础与方法)
学习·算法·fpga开发·集成电路·仿真·半导体
不吃橘子的橘猫2 天前
《集成电路设计》复习资料4(Verilog HDL概述)
学习·算法·fpga开发·集成电路·仿真·半导体
ShiMetaPi2 天前
GM-3568JHF丨ARM+FPGA异构开发板应用开发教程:13 PN532 NFC读卡案例
arm开发·fpga开发
国科安芯2 天前
空间站机械臂中MCU与CANFD抗辐照芯片的集成研究
单片机·嵌入式硬件·fpga开发·架构·risc-v
ShiMetaPi2 天前
GM-3568JHF丨ARM+FPGA异构开发板应用开发教程:11 RS485读写案例
arm开发·fpga开发·rk3568
156082072193 天前
国产时钟AU5615芯片调试记录
fpga开发
嵌入式-老费3 天前
Linux camera驱动开发(特殊的cpu+fpga芯片)
图像处理·驱动开发·fpga开发