[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
相关推荐
Mr-pn-junction3 小时前
clk_gate
单片机·嵌入式硬件·fpga开发
知行合一←_←15 小时前
误码仪与时钟极性
fpga开发
upper202015 小时前
vivado使用那些事之综合策略
fpga开发·vivado·vivado综合策略
2CM_Embed16 小时前
Quartus II 工程编译与 FPGA 下载流程记录
嵌入式硬件·fpga开发
千寻xun18 小时前
视频图像学习笔记
fpga开发
国科安芯1 天前
航天电子模拟前端三大支柱:精密运放、高速运放与电压监控的协同设计方法——ASL8522S/ASL622S/ASL706S技术解析
前端·单片机·嵌入式硬件·fpga开发·架构·安全性测试
謓泽2 天前
【6.26】芯片测试入门 从零搭自动化测试框架|PyVISA+OOP 保姆级教程
stm32·单片机·fpga开发·雷达·tr
乌恩大侠2 天前
【AI-RAN】面向电信行业的 NVIDIA DGX BasePOD
人工智能·fpga开发·o-ru
传感器与混合集成电路3 天前
伺服数据采集控制模块系统集成实战手册:接口设计要点、上电顺序与开发环境配置全解析
fpga开发
xxLearn3 天前
Vivado 2025.2 下载程序时提示:“ERROR : invalid command name ps7_init“
fpga开发