无码av一区二区三区无码,在线观看老湿视频福利,日韩经典三级片,成 人色 网 站 欧美大片在线观看

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

HDLBits (19) — 更多擴(kuò)展

2022-01-25 01:06 作者:僚機(jī)Wingplane  | 我要投稿

本題鏈接:

https://hdlbits.01xz.net/wiki/Vector5

給定五個(gè) 1 位信號(hào)(a、b、c、d 和 e),25 位輸出向量是計(jì)算兩組 25 位輸出向量按位成對(duì)比較的結(jié)果。 如果被比較的兩位相等,則輸出應(yīng)為 1。

out[24] = ~a ^ a; ? // a == a, so out[24] is always 1.
out[23] = ~a ^ b;
out[22] = ~a ^ c;
...
out[ 1] = ~e ^ d;
out[ 0] = ~e ^ e;

如圖所示,使用擴(kuò)展運(yùn)算符和拼接運(yùn)算符可以更輕松地完成此操作。?

上面的向量是重復(fù)?5?次同一個(gè)輸入信號(hào)后按次序拼接,下面的向量是按次序拼接輸入信號(hào)后重復(fù)5次

題目

module top_module (
 ? ?input a, b, c, d, e,
 ? ?output [24:0] out );

答案

module top_module (
 ? ?input a, b, c, d, e,
 ? ?output [24:0] out );
 ? ?assign out = ~{{5{a}}, {5}, {5{c}}, {5s0sssss00s}, {5{e}}} ^ {5{a, b, c, d, e}};
endmodule
module top_module (
	input a, b, c, d, e,
	output [24:0] out
);

	wire [24:0] top, bottom;
	assign top ? ?= { {5{a}}, {5}, {5{c}}, {5s0sssss00s}, {5{e}} };
	assign bottom = {5{a,b,c,d,e}};
	assign out = ~top ^ bottom;
endmodule


HDLBits (19) — 更多擴(kuò)展的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
常州市| 开封市| 三穗县| 柳州市| 龙南县| 台南市| 芒康县| 无棣县| 虎林市| 星座| 远安县| 调兵山市| 三原县| 苍南县| 谷城县| 鄂尔多斯市| 丽水市| 遵义市| 沁阳市| 泸溪县| 荥经县| 西畴县| 宣汉县| 应城市| 上饶市| 林甸县| 泰州市| 海门市| 建平县| 高清| 商南县| 沅江市| 星子县| 迁西县| 香格里拉县| 宾阳县| 阳江市| 双辽市| 南木林县| 大悟县| 浙江省|