memory problems need boolean data type 
Author Message
 memory problems need boolean data type

Need help on memory problem.

I am doing programming in VLSI. I am handling huge circuits of size 10,000 lines. I have to declare arrays of size 1000 x 1000. In most of the arrays I will be storing only 1 or 0. So I need a boolean type so that I can conserve memory. I am running into memory problems when I run this program for large circuits. I could have done it with linked lists, since it was needed in a shortperiod of time I resorted to arrays. If anybody can help me out, I will be thankful to them.

Rajani Koneru (Southern Illinois University).



Sun, 28 Sep 1997 03:00:00 GMT  
 memory problems need boolean data type

Quote:
>Need help on memory problem.
>I am doing programming in VLSI. I am handling huge circuits of size
>10,000 lines. I have to declare arrays of size 1000 x 1000. In most of
>the arrays I will be storing only 1 or 0. So I need a boolean type so
>that I can conserve memory. I am running into memory problems when I
>run this program for large circuits. I could have done it with linked
>lists, since it was needed in a shortperiod of time I resorted to
>arrays. If anybody can help me out, I will be thankful to them.
>Rajani Koneru (Southern Illinois University).

It sounds like you need a bit map.  Try writing some routines for a
generic one dimensional bit map.  Then you can use an array of these
bitmaps to simulate your 1000x1000 array.

The basic idea behind the bit map is to declare an array of chars.  You
can then set the Nth bit with
        array[N>>8] |= 1 << (N&7);

Of course, this assumes characters are 8 bits long.  It also assumes N
is unsigned, but you get the basic idea.

Dave

--

AT&T Bell Laboratories    (908)946-1107
943 Holmdel Road
Holmdel, NJ 07733



Tue, 30 Sep 1997 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. boolean data type in C

2. boolean data type in MIDL

3. C++ data type for VB Boolean

4. ATL data type for VB Object data Type

5. SQL timestamp data type - correspondency with c++ data type

6. OLE data types / standard data types

7. Mapping ADO data types with C++ data types

8. One memory allocation function - multiple data types?

9. type of boolean in c?

10. A builtin boolean type

11. Serializing an enum type and Boolean variable

12. VB boolean type in IDL

 

 
Powered by phpBB® Forum Software