in reply to Re: Decmal to 16 bit binary number
in thread Decmal to 16 bit binary number

1. Big-endian. Here, the bits of the low-value byte are stored in the byte of the target location with the lowest address. You can do this is perl using my $BEbin = pack 'n', 1263;
2. Little-endian Here, the bits of the low-value byte are stored in the byte of the target location with the highest address You can do this is perl using my $LEbin = pack 'v', 1263;
Shouldn't this be the other way around?
In Big-endian, the bytes are stored in memory in order eg: 0x1263 would be 0x1263.
In Little-endian, 0x1263 would be stored as 0x6312.

Update: Edited for formatting

Replies are listed 'Best First'.
Re^3: Decmal to 16 bit binary number
by BrowserUk (Patriarch) on Nov 01, 2007 at 14:01 UTC