How does a 32 bit OS Windows represents 64 bits depth data using Matlab 7.10 (R2010a)

Hello All,
I am here with some sort of confusing question. I request all to help me to get rid off this confusion.
I am using Matlab (32 bit) in 32 bit Windows 7 OS. I am confused, if I generate any double precision bit depth data using Matlab inbuilt code ("rand"), how could it represent all 64 bits together? since my OS has limited capacity (i.e., 32 bit). I guess it may have some other option or Windows OS bit doesn't have any effect or relationship on representing a double precision number in matlab or any software.
For instance, default "rand" function will generate double bit depth data which is 64 bits. How all of 64 bits can be represented in 32 bit depth system?
Looking for all your favorable suggestions. Thanks.

1 Comment

I do not see the relation between your question and the tags "image processing", etc. Only "bit_depth" might matter here, as far as I can see.

Sign in to comment.

Answers (1)

No, rand does not create 64 bit values, but the reply has 53 bit resolution only. The internally used Mersenne-Twister algorithm produces two random 32 bit integers, and 53 bit of them are used to create a double value between 0 and 1. There is no interference with the number of bits the processor can handle.
You can bundle a block of bytes to represent an integer with a number of bits, which is larger than 8. This method allowed the 8 and 16 bit processors to work with 16, 32, 64 and even more bit integers also. E.g. odern SSE units operate on 128 or 256 bit integers, but they can be interpreted as operations on 16 or 32 bytes also. Therefore you can see the SSE operation as a kind of parallel processing.
The main difference between 32 and 64 bit processors is that the size of the memroy, which can be addressed and in consequence the possible size of arrays. For a direct addressing, 32 bit processor can operate on arrays with 2^32-1 elements only. But e.g. harddisks could have been much larger without (serious) troubles: When the direct addressing is not sufficient, you can use an indirect method. Therefore the address of a certian element can contain e.g. two 32bit integers: the 1st points to a table of harddisk sectors, the 2nd to the corresponding byte.
While a 64 bit processor can add a 64 bit values with 1 operation, a 32 bit processor required to add the lower and higher 32 bit parts separately considering the carry bit from the lower part in the addition of the upper part. But the same trick works for adding 512 bit integers on a 64 bit processor, when some more stages are considered. For the result the interbally used number of bits for the processor registers does not matter.

Categories

Find more on Images in Help Center and File Exchange

Asked:

on 8 Apr 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!