[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
相关推荐
绿算技术2 小时前
存储新势力:助力DeepSeek一体机
人工智能·科技·缓存·fpga开发
9527华安9 小时前
国产紫光同创FPGA视频采集转SDI编码输出,基于HSSTHP高速接口,提供2套工程源码和技术支持
fpga开发·音视频·紫光同创·sdi·高速接口·hssthp
S&Z346310 小时前
[FPGA基础] 原语简介篇
fpga开发
Dlrbw10 小时前
FPGA——DDS信号发生器设计
笔记·fpga开发
FPGA开源工坊15 小时前
FPGA上实现YOLOv5的一般过程
yolo·fpga开发
S&Z346320 小时前
[FPGA基础] UART篇
fpga开发
szxinmai主板定制专家1 天前
国产RK3568+FPGA以 ‌“实时控制+高精度采集+灵活扩展”‌ 为核心的解决方案
大数据·运维·网络·人工智能·fpga开发·机器人
FPGA_ADDA1 天前
基于FPGA 和DSP 的高性能6U VPX 采集处理板
fpga开发·dsp·6u vpx·8通道采集
__pop_1 天前
system verilog 语句 耗时规则
verilog
FakeOccupational1 天前
fpga系列 HDL:跨时钟域同步 脉冲展宽同步 Pulse Synchronization
fpga开发