[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
相关推荐
ZYNQRFSOC12 小时前
基于XCKU5P纯逻辑 NVME测试
fpga开发
FPGA小迷弟17 小时前
使用FPGA开发高速AD/DA芯片的接口学习
fpga开发
stars-he18 小时前
FPGA学习笔记(6)逻辑设计小结与以太网发送前置
笔记·学习·fpga开发
燎原星火*18 小时前
FPGA 逻辑级数
fpga开发
175063319451 天前
Vivado Zynq7020 生成正弦波(查表法) + 行为级仿真
fpga开发
Terasic友晶科技1 天前
4-DE10-Nano的HDMI方块移动案例——I2C通信协议
fpga开发·i2c·hdmi·de10-nano·i2c通信协议
莫问前程_满城风雨2 天前
verilog 可变范围的bit选择
运维·服务器·verilog
云雾J视界2 天前
FPGA在AI时代的角色重塑:硬件可重构性与异构计算的完美结合
fpga开发·边缘计算·gpu·vitis·ai推理·azure云·异构编程
s09071363 天前
FPGA中CIC设计注意事项
算法·fpga开发·cic滤波器
Aaron15883 天前
RFSOC+VU13P在无线信道模拟中的技术应用分析
数据结构·人工智能·算法·fpga开发·硬件架构·硬件工程·射频工程