[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
相关推荐
风_峰12 小时前
Petalinux相关配置——ZYNQ通过eMMC启动
嵌入式硬件·ubuntu·fpga开发
风_峰12 小时前
【ZYNQ开发篇】Petalinux和电脑端的静态ip地址配置
网络·嵌入式硬件·tcp/ip·ubuntu·fpga开发
碎碎思13 小时前
一块板子,玩转 HDMI、USB、FPGA ——聊聊开源项目 HDMI2USB-Numato-Opsis
fpga开发
ooo-p17 小时前
FPGA学习篇——Verilog学习Led灯的实现
学习·fpga开发
嵌入式-老费17 小时前
Zynq开发实践(FPGA之选择开发板)
fpga开发
风_峰21 小时前
PuTTY软件访问ZYNQ板卡的Linux系统
linux·服务器·嵌入式硬件·fpga开发
电子凉冰1 天前
FPGA入门-状态机
fpga开发
Aczone281 天前
硬件(十)IMX6ULL 中断与时钟配置
arm开发·单片机·嵌入式硬件·fpga开发
晓晓暮雨潇潇2 天前
Serdes专题(1)Serdes综述
fpga开发·serdes·diamond·latticeecp3
XINVRY-FPGA2 天前
XCKU15P-2FFVA1760I AMD 赛灵思 Xilinx Kintex UltraScale+ FPGA
arm开发·嵌入式硬件·阿里云·fpga开发·云计算·硬件工程·fpga