posted 23 years ago
Hi Hema,
No need to remember this!! just stick to the basics
256 is the representation of that particular number in decimal format ( where the base is 10 ) .. so the number's value is equal to --256= 2*10(2) + 5*10(1) + 6*10(0) -- i use the notation 10(2) == 10 raised to the power 2 == 10*10 = 100.
if u just remember the powers of 2 ( 1,2,4,8,16,32,64,128,256,512,1024... ) or the powers of 16( 1,16,256.... ) just like u remember the powers of 10 ( 1,10,100,1000.... ) it would all become very natural.
256 in binary representation = 1*2(8) +0*........
so its 1000 0000
( its 1*16(2) + 0*16(1) + 0*16(0)
so its 100 in hex
to take a smaller number 15 = 8 + 4 + 2 + 1
= 1*2(3) + 1*2(2) + 1*2(1) + 1*2(0)
= 1111 in binary...
hope this helps.. please note that the game is slightly diff for negative numbers.. ( 2's complement rep )
cheers,
vivek