[HDLBits] Conditional

Given four unsigned numbers, find the minimum. Unsigned numbers can be compared with standard comparison operators (a < b). Use the conditional operator to make two-way min circuits, then compose a few of them to create a 4-way min circuit. You'll probably want some wire vectors for the intermediate results.

复制代码
module top_module (
    input [7:0] a, b, c, d,
    output [7:0] min);//
    wire [7:0] res1,res2;
	assign res1= a<b?a:b;
    assign res2= c<d?c:d;
    assign min=res1<res2?res1:res2;
    // assign intermediate_result1 = compare? true: false;

endmodule
相关推荐
3有青年9 小时前
Altera FPGA操作系统支持的情况分析
fpga开发
国科安芯10 小时前
卫星通讯导航FPGA供电单元DCDC芯片ASP4644S2B可靠性分析
单片机·嵌入式硬件·fpga开发·架构·安全性测试
stars-he13 小时前
FPGA学习笔记-图书馆存包柜,乒乓球游戏电路设计
笔记·学习·fpga开发
从此不归路13 小时前
FPGA 结构与 CAD 设计(第3章)下
ide·fpga开发
YprgDay14 小时前
Vivado单独综合某一模块查看资源消耗
fpga开发·vivado
Joshua-a15 小时前
高云FPGA在线调试/逻辑分析仪简要使用流程
嵌入式硬件·fpga开发·高云
博览鸿蒙1 天前
FPGA 工程中常见的基础硬件问题
fpga开发
GateWorld2 天前
FPGA 实现无毛刺时钟切换
fpga开发·实战·无毛刺时钟
Seraphina_Lily2 天前
从接口选型到体系结构认知——谈 CPU–FPGA–DSP 异构处理系统与同构冗余设计
fpga开发
Seraphina_Lily2 天前
CPU–FPGA–DSP 异构系统中的总线接口选型——为什么 CPU 用 eLBC,而 DSP 用 XINTF?
fpga开发