📄 magcomp.v
字号:
//
// Verilog module for an unsigned magnitude comparator
//
// input(s): a, b
// output(s): a_gtet_b
//
module mag_comp_unsign (a, b, a_gtet_b);
input [7:0]a;
input [7:0]b;
output a_gtet_b;
// since we will be assigning to this, make it a reg
reg a_gtet_b;
// modify the output on a change with a or b
always @(a or b)
begin
// this implementation is a simple if statment. by
// structuring the comparsion like this, The circuit
// will be small and compact.
if (a >= b)
a_gtet_b = 1'b1;
else
a_gtet_b = 1'b0;
end
endmodule
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -