As part of a lecture series on verilog HDL for FPGA programming I have been given this piece of code to create a signed 8-bit greater-than comparator. I have simulated this in xillinx ISE and it shows that the syntax is correct. However I do not understand the begin:comparison
line. I understand that in the procedural @always(*)
block a begin and end statement is needed, however, in this case when the :comparison
is removed the module no longer compiles.
My best guess would be that the :comparison
is referring to the sgt = intA > int B;
line however I cant understand why or find much information about begin and end statements in that form.
module sgtc(input [7:0] a,b, output reg sgt);
always@(*) begin:comparison
integer intA, intB;
intA = a;
intB = b;
sgt = intA > intB;
end
endmodule