Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to increment a sc bitvector of width > 32

Status
Not open for further replies.

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 Chetan,

you declared the counter as ulong.
ulong is nothing but 32-bit.
Thats y u'r counter value become 0 after FFFFFFFF.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top