Hi All,
My aim is to supply a hexadecimal value and print its binary value.
I have written a small piece of code for the same:
$input = 23; #any decimal value
$hex1 = sprintf ("%x",$input);
$binary = unpack 'B*', pack 'H*', $hex1;
@fields1 = unpack 'A4A4', $binary;
print "$fields1[1] $fie
"Dharshana Eswaran" schreef:
> $input = 23; #any decimal value
> $hex1 = sprintf ("%x",$input);
> $binary = unpack 'B*', pack 'H*', $hex1;
> @fields1 = unpack 'A4A4', $binary;
> print "$fields1[1] $fields1[0]";# i need to print the Lower
> Nibble first and then the Higher nibble
>
> But
Thank you Dr.Ruud. It solved my problem. :-)
Thanks and Regards,
Dharshana
On 5/3/07, Dr.Ruud <[EMAIL PROTECTED]> wrote:
"Dharshana Eswaran" schreef:
> $input = 23; #any decimal value
> $hex1 = sprintf ("%x",$input);
> $binary = unpack 'B*', pack 'H*', $hex1;
> @fields1 = unpack 'A4A4', $
Dharshana Eswaran wrote:
> Hi All,
Hello,
> My aim is to supply a hexadecimal value and print its binary value.
>
> I have written a small piece of code for the same:
>
> $input = 23; #any decimal value
> $hex1 = sprintf ("%x",$input);
> $binary = unpack 'B*', pack 'H*', $hex1;
> @fields1 =