[HDLBits] Mt2015 muxdff

Taken from ECE253 2015 midterm question 5

Consider the sequential circuit below:

Assume that you want to implement hierarchical Verilog code for this circuit, using three instantiations of a submodule that has a flip-flop and multiplexer in it. Write a Verilog module (containing one flip-flop and multiplexer) named top_module for this submodule.

复制代码
module top_module (
	input clk,
	input L,
	input r_in,
	input q_in,
	output reg Q);
	wire D;
    assign D = L ? r_in : q_in;
    always@(posedge clk) Q<=D;
endmodule

这里体现出来,必须分开分步写各个器件。

相关推荐
硅农深芯15 小时前
六大核心芯片:MCU/SOC/DSP/FPGA/NPU/GPU 的区别与应用解析
单片机·嵌入式硬件·fpga开发
9527华安15 小时前
FPGA纯verilog实现JESD204B协议,基于AD9081数据接收,提供2套工程源码和技术支持
fpga开发·jesd204b·ad9081
FPGA技术实战16 小时前
基于XADC IP核的FPGA芯片温度读取设计
网络协议·tcp/ip·fpga开发
丸子的蓝口袋17 小时前
FPGA DONE信号震荡
fpga开发
CinzWS19 小时前
基于Cortex-M3 SoC的eFuse模块--实现与验证考量
fpga开发·架构·efuse
jumu20221 小时前
CEEMDAN - SE:神奇的信号处理组合
fpga开发
坏孩子的诺亚方舟21 小时前
FPGA系统架构设计实践6_工程实现概述
fpga开发·xilinx·实现
坏孩子的诺亚方舟1 天前
FPGA系统架构设计实践10_时钟网络
fpga·xilinx·时钟网络
FPGA小c鸡1 天前
Verilog核心语法速查:可综合写法、运算符陷阱与SV增强(附模板)
fpga开发
步达硬件1 天前
【FPGA】Verilog HDL编辑、RTL仿真、网表生成主流软件
fpga开发