Monday, December 12, 2011

What is the variable if a value of 38 base 10 is stored in a 1-byte memory location named Number1?

Err, Number1 would be the name of the variable...


Not sure what the question is here.


It could be of Type BYTE but that would depend on the language and how it defines it's variables.|||As read above, it is not clear what exactly you want to know.


Do you want to know the hexadecimal/binary representation of the decimal number 38?





38 = 1*32 +0*16 + 0*8 + 1*4 + 1*2 *0*1 = 100110 binary.


As you have a 1 byte memory location, you pad that value with leading zeros to a total of 8 bits:


00100110


Just in case here the hex-value: 0x26

No comments:

Post a Comment