babaduredi
Member level 1
- Joined
- Apr 28, 2011
- Messages
- 39
- Helped
- 9
- Reputation
- 18
- Reaction score
- 9
- Trophy points
- 1,288
- Location
- Bangalore
- Activity points
- 1,543
Hi,
While defining test case for a hardware, i had to use following in statement:
-8'd3;
Now this statement means -3 in decimal or 8-bit binary stored as 2's complement of binary 3, i.e 8'b1111_1101. Now when we write 8'b1111_1101, it can be -3 or (2^8)-3=253 in decimal. So how does compiler decide whether it's -3 or 253?
While defining test case for a hardware, i had to use following in statement:
-8'd3;
Now this statement means -3 in decimal or 8-bit binary stored as 2's complement of binary 3, i.e 8'b1111_1101. Now when we write 8'b1111_1101, it can be -3 or (2^8)-3=253 in decimal. So how does compiler decide whether it's -3 or 253?