[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
相关推荐
博览鸿蒙8 小时前
FPGA 设计全流程科普,要用到的开发工具有哪些?
fpga开发
雨洛lhw11 小时前
相位可调分频器实现精准时钟同步
fpga开发·时间同步·时钟分频·相位可调
碎碎思19 小时前
KRS(Kratos Robotics Stack):让 Zynq / FPGA 机器人开发真正“跑”起来
fpga开发·机器人
Terasic友晶科技21 小时前
Altera FPGA 的 Avalon MM总线接口规范介绍(精简版)
fpga开发·接口·sopc·avalon总线
啊阿狸不会拉杆21 小时前
《数字信号处理》第10章-数字信号处理中的有限字长效应
算法·matlab·fpga开发·信号处理·数字信号处理·dsp
雨洛lhw2 天前
24bit AD采样高效数据打包方案解析
fpga开发·数据打包方式·ddr突发读写注意事项
XiaoChaoZhiNeng2 天前
Xilinx Vivado18.3 Modelsim 库编译与仿真
fpga开发
Flamingˢ2 天前
FPGA 显示系统学习路线:从 VGA 到 RGB TFT
学习·fpga开发
tiantianuser2 天前
RDMA设计37:RoCE v2 子系统模型设计
fpga开发·rdma·高速传输·cmac·roce v2
8K超高清2 天前
博冠8K广播级讯道摄像机获国际设计大奖
网络·算法·fpga开发·接口隔离原则·智能硬件