[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
相关推荐
s09071361 天前
Xilinx 7系列FPGA的FFT IP核简介
fpga开发·zynq·fft
FPGA小c鸡1 天前
Vivado_Quartus安装与配置完全指南
学习·fpga开发
FPGA_无线通信2 天前
OFDM 频偏补偿和相位跟踪(2)
算法·fpga开发
晓晓暮雨潇潇2 天前
Serdes专题(5)PCS IP配置
fpga开发·serdes·latticeecp3·pcs ip
国科安芯2 天前
AS32A601型MCU芯片flash模块的擦除和编程
java·linux·前端·单片机·嵌入式硬件·fpga开发·安全性测试
Aaron15882 天前
侦察、测向、识别、干扰一体化平台系统技术实现
人工智能·fpga开发·硬件架构·边缘计算·信息与通信·射频工程·基带工程
欢鸽儿2 天前
Vitis】Linux 下彻底清除启动界面 Recent Workspaces 历史路径
linux·嵌入式硬件·fpga
FPGA_无线通信3 天前
OFDM 频偏补偿和相位跟踪(1)
算法·fpga开发
HIZYUAN3 天前
AI时代,如何利用FPGA在无人机视觉等方面进行快速应用
stm32·单片机·fpga开发·视觉检测·无人机·fpga·光端机
釉色清风3 天前
openEuler 多样算力支持:CPU、GPU 与 FPGA 异构加速实战
fpga开发