[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
相关推荐
国科安芯1 天前
实战验证:ASM1042S2S CANFD收发器的质子单粒子效应试验与在轨性能
网络·人工智能·单片机·嵌入式硬件·物联网·fpga开发
国科安芯1 天前
ASP4644S电源芯片引脚功能与参考设计输出电压计算方法
网络·单片机·嵌入式硬件·fpga开发·性能优化
fonx1 天前
ZYNQ7010备忘
fpga开发
悲喜自渡7212 天前
FPGA开发方式
fpga开发
芯门2 天前
FPGA商用级ISP(三):自动白平衡(AWB)算法实现与 FPGA 架构解析
图像处理·计算机视觉·fpga开发
jz_ddk3 天前
[实战] 从冲击响应函数计算 FIR 系数
python·fpga开发·信号处理·fir·根升余弦·信号成形
不吃橘子的橘猫3 天前
《集成电路设计》复习资料2(设计基础与方法)
学习·算法·fpga开发·集成电路·仿真·半导体
不吃橘子的橘猫3 天前
《集成电路设计》复习资料4(Verilog HDL概述)
学习·算法·fpga开发·集成电路·仿真·半导体
ShiMetaPi3 天前
GM-3568JHF丨ARM+FPGA异构开发板应用开发教程:13 PN532 NFC读卡案例
arm开发·fpga开发
国科安芯3 天前
空间站机械臂中MCU与CANFD抗辐照芯片的集成研究
单片机·嵌入式硬件·fpga开发·架构·risc-v