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.

创建 16 D flip-flops。有时只修改一组触发器的一部分很有用。使能字节的输入控制是否应在该周期内写入 16 个寄存器中的每个字节。byteena[1] 控制上字节 d[15:8],而 byteena[0] 控制下字节 d[7:0]。

cs 复制代码
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 <= 0;
            else if(byteena[0])     //从这里开始错误!!!
                q[7:0] <= d[7:0];  
            else if(byteena[1])
                q[15:8] <= d[15:8];  
        end
endmodule
相关推荐
风_峰6 小时前
Ubuntu Linux SD卡分区操作
嵌入式硬件·ubuntu·fpga开发
FPGA_Linuxer6 小时前
FPGA 40 DAC线缆和光模块带光纤实现40G UDP差异
网络协议·fpga开发·udp
风_峰20 小时前
Petalinux相关配置——ZYNQ通过eMMC启动
嵌入式硬件·ubuntu·fpga开发
风_峰20 小时前
【ZYNQ开发篇】Petalinux和电脑端的静态ip地址配置
网络·嵌入式硬件·tcp/ip·ubuntu·fpga开发
碎碎思21 小时前
一块板子,玩转 HDMI、USB、FPGA ——聊聊开源项目 HDMI2USB-Numato-Opsis
fpga开发
ooo-p1 天前
FPGA学习篇——Verilog学习Led灯的实现
学习·fpga开发
嵌入式-老费1 天前
Zynq开发实践(FPGA之选择开发板)
fpga开发
风_峰1 天前
PuTTY软件访问ZYNQ板卡的Linux系统
linux·服务器·嵌入式硬件·fpga开发
电子凉冰2 天前
FPGA入门-状态机
fpga开发
Aczone282 天前
硬件(十)IMX6ULL 中断与时钟配置
arm开发·单片机·嵌入式硬件·fpga开发