[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
相关推荐
FPGA-ADDA17 小时前
第一篇:从“软件无线电”到“单芯片无线电”——RFSoC如何重塑无线系统设计
arm开发·信号处理·fpga·通信系统·rfsoc
s090713619 小时前
【Zynq 进阶一】深度解析 PetaLinux 存储布局:NAND Flash 分区与 DDR 内存分配全攻略
linux·fpga开发·设备树·zynq·nand flash启动·flash分区
Kong_199420 小时前
芯片开发学习笔记·二十——时序报告分析
fpga开发·芯片开发
凌盛羽1 天前
使用python绘图分析电池充电曲线
开发语言·python·stm32·单片机·fpga开发·51单片机
尤老师FPGA1 天前
LVDS系列44:Xilinx Ultrascale系 ADC LVDS接口参考方法(六)
fpga开发
化屾为海1 天前
FPGA之PLL展频
fpga开发
GateWorld1 天前
FPGA内部模块详解之七 FPGA的“灵魂”加载——配置模块(Configuration)深度解析
fpga开发·fpga config
星华云1 天前
[FPGA]Spartan6 Uart可变波特率读写JY901P惯导模块
fpga开发·verilog·jy901p·spartan6·惯导
碎碎思1 天前
基于 Gowin FPGA 的 SDR 开源方案:从硬件到射频全栈打通
fpga开发
S&Z34632 天前
[SZ901]高级功能:远程调试
fpga开发