[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
相关推荐
洋洋Young1 天前
【Xilinx FPGA】DDR3 SDRAM 控制器
fpga开发·xilinx
碎碎思1 天前
在 FPGA 里跑 SDR 和 FT8:一个 32 MHz 全频谱无线电的硬核实现
fpga开发
EVERSPIN1 天前
USB3.0接口转换高性能图像传感和数据采集方案
fpga开发·usb3.0·接口转换·usb3.0接口转换
Macbethad1 天前
串口服务器技术报告:从RS232/485到MODBUS TCP的工业通信演进
fpga开发
GateWorld1 天前
FPGA DSP模块使用中不易察觉的坑
fpga开发·ip·实战经验·fpga dsp使用
minglie12 天前
用vio_uart测试verilog
fpga开发
Terasic友晶科技2 天前
6-DE10-Nano的HDMI方块移动案例——使用Modelsim仿真I2C控制器
fpga开发·仿真·modelsim·hdmi·i2c_controller
我爱C编程2 天前
【仿真测试】基于FPGA的2ASK扩频通信链路实现,包含帧同步,定时点,扩频伪码同步,信道,误码统计
fpga开发·帧同步·定时点·ask·扩频通信·扩频伪码同步
minglie12 天前
Wokwi组件
fpga开发
qq_337599462 天前
FPGA知识点
经验分享·fpga开发