[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
相关推荐
GateWorld5 小时前
FPGA内部模块详解之九 FPGA内部模块的协同作战与设计流程精要
fpga开发·fpga设计流程
嵌入式-老费7 小时前
vivado hls的应用(hls需要verilog基础)
fpga开发
FPGA小迷弟12 小时前
FPGA工程师面试题汇总(九)
网络协议·tcp/ip·fpga开发·面试·verilog·fpga
fei_sun1 天前
逻辑设计概念及Vivado基础
fpga开发
发光的沙子1 天前
FPGA----vitis测试linux程序
fpga开发
初夏正浓1 天前
一文读懂“JESD204B”之链路建立与xilinx IP仿真
fpga开发·xilinx·jesd204b
FPGA-ADDA2 天前
第一篇:从“软件无线电”到“单芯片无线电”——RFSoC如何重塑无线系统设计
arm开发·信号处理·fpga·通信系统·rfsoc
s09071362 天前
【Zynq 进阶一】深度解析 PetaLinux 存储布局:NAND Flash 分区与 DDR 内存分配全攻略
linux·fpga开发·设备树·zynq·nand flash启动·flash分区
Kong_19942 天前
芯片开发学习笔记·二十——时序报告分析
fpga开发·芯片开发
凌盛羽2 天前
使用python绘图分析电池充电曲线
开发语言·python·stm32·单片机·fpga开发·51单片机