[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
相关推荐
Terasic友晶科技6 小时前
第13篇:Linux程序访问控制FPGA端Switch<二>
fpga开发·嵌入式系统·de1-soc开发板
cjie22112 小时前
FWFT_FIFO和Standard_FIFO对比仿真
fpga开发
9527华安12 小时前
国产紫光同创FPGA实现SDI视频编解码,基于HSSTHP高速接口,提供3套工程源码和技术支持
fpga开发·紫光同创·sdi·高速接口·hssthp
hahaha601614 小时前
ARINC818协议一些说明综述
fpga开发
_Hello_Panda_15 小时前
FX10(CYUSB4014)USB3.2(10Gbps)开发笔记分享(1):硬件设计与开发环境搭建
笔记·fpga开发·fx10·cyusb4014
FakeOccupational19 小时前
fpga系列 HDL:tips 初始化错误排查 & 仿真和实际不符的可能原因
fpga开发
FakeOccupational20 小时前
fpga系列 HDL:verilog latch在fpga中的作用 & 避免latch的常见做法
fpga开发
S&Z34631 天前
[FPGA基础] RAM篇
fpga开发
绿算技术1 天前
存储新势力:助力DeepSeek一体机
人工智能·科技·缓存·fpga开发
9527华安1 天前
国产紫光同创FPGA视频采集转SDI编码输出,基于HSSTHP高速接口,提供2套工程源码和技术支持
fpga开发·音视频·紫光同创·sdi·高速接口·hssthp