📄 mag4comp.v
字号:
`timescale 1ns / 1ps
//4-bit magnetude comparator
module mag4comp(input [3:0] a, //inputs to compare
input [3:0] b,
input aeqbin, //expansion inputs
input agtbin,
input altbin,
output aeqbout, //outputs
output agtbout,
output altbout);
assign aeqbout = ((a == b)&&(aeqbin == 1'b1))? 1'b1 : 1'b0;
assign agtbout = ((a > b)||((a == b)&&(agtbin == 1'b1)))? 1 : 0;
assign altbout = (a < b)|((a == b) & altbin);
endmodule
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -