[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
相关推荐
FPGA小c鸡15 小时前
FPGA卷积层流水线加速:从入门到精通(附完整SystemVerilog实现)
fpga开发
数字芯片实验室15 小时前
仿真器出bug了?分频时钟竞争的诡异仿真现象
fpga开发·bug
从此不归路16 小时前
FPGA 结构与 CAD 设计(第4章)下
fpga开发
Terasic友晶科技16 小时前
7-DE10-Nano的HDMI方块移动案例的整体实现(含Quartus完整工程免费下载)
fpga开发·i2c·pll·de10-nano·hdmi传输·方块移动案例·quartus prime
碎碎思17 小时前
使用 Arm Cortex-M1 实现低成本图像处理系统 的 FPGA 方案详解
arm开发·图像处理·人工智能·fpga开发
minglie118 小时前
PetaLinux工程目录设备树文件结构与作用
fpga开发
最遥远的瞬间18 小时前
二、FPGA程序固化
fpga开发
Ghost Face...18 小时前
内存调试:2T/3T模式配置实战指南
fpga开发
海涛高软18 小时前
Verlog实现串口的收发功能
fpga开发
从此不归路18 小时前
FPGA 结构与 CAD 设计(第4章)上
ide·fpga开发