[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

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

相关推荐
ThreeYear_s3 小时前
【FPGA+DSP系列】——PWM电平光耦转换电路实验分析----电路原理分析,器件选型
单片机·嵌入式硬件·fpga开发
FPGA_小田老师16 小时前
FPGA语法基础(一):Verilog 数组清零方法详解
fpga开发·verilog语法·数组清零·verilog数组清零
奋斗的牛马1 天前
FPGA--zynq学习 PS与PL交互(二) HP接口
单片机·嵌入式硬件·学习·fpga开发·信息与通信
ThreeYear_s1 天前
【FPGA+DSP系列】——CCS联合proteus仿真DSP工程,以TMS320f28027芯片为例,LED闪烁仿真。
单片机·fpga开发·proteus
LCMICRO-133108477461 天前
长芯微LPS5820完全P2P替代NCP51820,LPS5820 是一款高速半桥驱动器,可用来驱动半 桥功率拓扑的 GaN 功率管。
stm32·单片机·嵌入式硬件·fpga开发·硬件工程
云雾J视界1 天前
预测电流控制在光伏逆变器中的低延迟实现:华为FPGA加速方案与并网稳定性验证
华为·fpga开发·dsp·光伏逆变器·mpcc
国科安芯2 天前
核电厂执行器控制系统中的抗辐照MCU选型:为什么需要150krad(Si) TID指标?
服务器·单片机·嵌入式硬件·fpga开发·架构
云数据构建师2 天前
TB62262FTAG芯片应用和设计电路图
单片机·嵌入式硬件·fpga开发
XINVRY-FPGA2 天前
5CEFA9F23I7N Altera CycloneV E(Enhanced)FPGA
人工智能·嵌入式硬件·计算机视觉·fpga开发·硬件工程·dsp开发·fpga
Shang180989357262 天前
T41NQ/T41N高性能低功耗SOC芯片 软硬件资料T41NQ适用于各种AIoT应用,适用于智能安防、智能家居,机器视觉等领域方案
驱动开发·嵌入式硬件·计算机视觉·fpga开发·信息与通信·t41nq