It depends on the encoding but if we assume standard ASCII encodings, the representation is the same for all systems, the only difference being the number of leading 0 bits per character.
7-bit ASCII (ISO/IEC 646):
1100100 1100001 1100100 1100100 1111001 0000000
8-bit ASCII (ISO/IEC 8859, Windows-1252 and UTF8):
01100100 01100001 01100100 01100100 01111001 00000000
UTF16:
00000000 01100100 00000000 01100001 00000000 01100100
00000000 01100100 00000000 01111001 00000000 00000000
To perform these conversions, convert each character to its ASCII representation (in decimal):
d = 100
a = 97
d = 100
d = 100
y = 121
For completeness, we should also include the null-terminator, character code 0.
null = 0
Now convert each decimal value to its 8-bit representation in hexadecimal:
100 = 0x64
97 = 0x61
100 = 0x64
100 = 0x64
121 = 0x79
0 = 0x00
Convert each hexadecimal digit to its 4-bit binary representation:
0x6 = 0110
0x4 = 0100
0x6 = 0110
0x1 = 0001
0x6 = 0110
0x4 = 0100
0x6 = 0110
0x4 = 0100
0x7 = 0111
0x9 = 1001
0x0 = 0000
0x0 = 0000
Place the binary codes in sequence.
"daddy" = 01100100 01100001 01100100 01100100 01111001 00000000
Finally, add or remove leading zero bits to suit the actual encoding.
0100110101100001011100110110111101101110
That depends on your string encoding. In ascii, for example: H = 72 = 1001000 i = 105 = 1101001
356 in binary is101100100
Decimal 30 = binary 11110. The decimal binary code (BCD), however, is 11 0000.
14 decimal in binary is 11102. In octal it is 168 and in hexadecimal it is 0E16.
Say
0100110101100001011100110110111101101110
110001010110000100100
01
01
Thompson (with capital T): 0101010001101000011011110110110101110000011100110110111101101110
01100111 01101111 01101111 01100100 01100010 01111001 01100101 = goodbye in binary
Thompson (with capital T): 0101010001101000011011110110110101110000011100110110111101101110
That IS the binary code.
That depends on your string encoding. In ascii, for example: H = 72 = 1001000 i = 105 = 1101001
To represent the name "Sam" in binary code, you need to convert each letter to its ASCII value and then to binary. The ASCII values for 'S', 'a', and 'm' are 83, 97, and 109, respectively. In binary, these values are represented as: 'S' = 01010011, 'a' = 01100001, and 'm' = 01101101. Therefore, "Sam" in binary code is 01010011 01100001 01101101.
00100001 is the binary code for 33