[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
相关推荐
GateWorld16 小时前
LCD显示技术完全指南:原理·制造·驱动·FPGA实现之基础一
fpga开发·lcd显示·fpga点亮屏幕·minilvds
Coder-hong1 天前
TopJTAG Probe连接zynq
fpga开发
Aaron15881 天前
RFSOC+VU13P/VU9P+GPU多通道同步一体化解决方案
人工智能·嵌入式硬件·算法·matlab·fpga开发·硬件架构·基带工程
ALINX技术博客1 天前
【黑金云课堂】FPGA技术教程Linux开发:串行通信接口与实时时钟模块
linux·fpga开发
Felven1 天前
国产ZYNQ multiboot功能介绍与实现
linux·fpga开发·multiboot·国产zynq
cjie2212 天前
DDR3速率分档
fpga开发
坏孩子的诺亚方舟2 天前
open_prj22_IIC读写EEPROM、AD/DA、PLSYSMON
fpga开发·mpsoc
cjie2212 天前
仿真xilinx库加glbl()的作用
fpga开发
禾刀围玉2 天前
基于FPGA的卷积神经网络实现-方案构想
人工智能·fpga开发·cnn
Aaron15883 天前
全频段 SDR干扰源模块解决方案(星链干扰、LORA无人机干扰)
人工智能·算法·fpga开发·硬件架构·硬件工程·无人机·信息与通信