Aug 4, 2009 #1 C chetha Newbie level 1 Joined Aug 4, 2009 Messages 1 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,288 Hi I am trying to implement a 40 bit counter in systemC I had ttried with the following code sc_bv <40> counter; ............ ............ counter = counter.to_ulong()+1; Even I tried counter.to_uint64()+1 also The issue I am facing is after FFFFFFFF the counter value is 0 but not 1FFFFFFFF Is there any short cut other than splitting the counter into 8 and 32 bit wide vectors ans incrementing them separately Regards Chethan
Hi I am trying to implement a 40 bit counter in systemC I had ttried with the following code sc_bv <40> counter; ............ ............ counter = counter.to_ulong()+1; Even I tried counter.to_uint64()+1 also The issue I am facing is after FFFFFFFF the counter value is 0 but not 1FFFFFFFF Is there any short cut other than splitting the counter into 8 and 32 bit wide vectors ans incrementing them separately Regards Chethan
Aug 8, 2009 #2 S sheik_vb Member level 3 Joined Jul 21, 2006 Messages 58 Helped 3 Reputation 6 Reaction score 0 Trophy points 1,286 Activity points 1,510 Hi Chetan, you declared the counter as ulong. ulong is nothing but 32-bit. Thats y u'r counter value become 0 after FFFFFFFF.
Hi Chetan, you declared the counter as ulong. ulong is nothing but 32-bit. Thats y u'r counter value become 0 after FFFFFFFF.