helimpopo
Newbie level 3
- Joined
- Apr 2, 2012
- Messages
- 3
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Location
- Beijing,China
- Activity points
- 1,328
Code:
TC_int = TC | 1'b0;
LEQ_int = LEQ | 1'b0;
TC determines whether the number is signed or unsigned, so what does TC|1'b0 mean? Is there any difference between signal TC and TC_int? TC is a one bit signal.
Another question.
I find the verilog code of ALU very interesting. The coder wrote the CMP like:
Code:
if ( TC === 1'b0 ) begin // unsigned numbers
result = 0;
for (i = 0; i <= sign; i = i + 1) begin
a_is_0 = A[i] === 1'b0;
b_is_1 = B[i] === 1'b1;
result = (a_is_0 & b_is_1) |
(a_is_0 & result) |
(b_is_1 & result);
end // loop
What are the advantages by writing a comparator like this? If I were the writer, I could only come up with the '<' and '>' symbols. There may be some considerations in systhesized circuits, but how can I know these tiny differences?