[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
相关推荐
Smart-佀13 小时前
FPGA入门:CAN总线原理与Verilog代码详解
单片机·嵌入式硬件·物联网·算法·fpga开发
丁劲犇14 小时前
B205mini FPGA工程粗浅解析:从架构到Trae开发介绍
ai·fpga开发·架构·ise·trae·b210·b205mini
应用市场15 小时前
无线充电器原理与电路设计详解——从电磁感应到完整实现
3d·fpga开发
ALINX技术博客18 小时前
【ALINX选型】AMD Kintex UltraScale+ 系列 FPGA 开发板速选
fpga开发
碎碎思18 小时前
从 HLS 到 RTL:高层次综合在 FPGA 设计中的价值与局限
fpga开发
s090713619 小时前
FPGA视频编码器:H.264/H.265实现核心技术解析
图像处理·算法·fpga开发·音视频·h.264
156082072191 天前
在vivado中,国产CH347芯片实现USB转JTAG的操作
fpga开发
数字芯片实验室1 天前
IP验证最终回归到时序级建模
网络·网络协议·tcp/ip·fpga开发
雨洛lhw1 天前
三模冗余资源量对比
fpga开发·三模冗余技术
XINVRY-FPGA1 天前
XC7VX690T-2FFG1761I Xilinx AMD FPGA Virtex-7
arm开发·嵌入式硬件·fpga开发·硬件工程·fpga