78 53 49 32 50 50
Binary in R is the same as binary in any other programming language. The language doesn't actually change the meaning of binary any more than it can change the meaning of decimal, octal or hexadecimal. These are all symbolic representations (notations) for digital information. When we see the symbol 42 we instantly recognise it as the value forty-two because we automatically assume numeric symbols are always written in decimal notation. However, the computer represents the value forty-two as 00101010, which is the binary equivalent. In order to present the decimal value to the user, the computer must convert the value 00101010 to the string "42". This is achieved through binary division by ten (00001010 in binary) and taking the remainder: 00101010 / 00001010 = 00000100 r 00000010 00000100 / 00001010 = 00000000 r 00000100 The remainders are decimal 2 and 4 respectively. Now we convert each of these digits to their equivalent ASCII character code by adding 48 (binary 110000), which is the ASCII code for character '0': 00000010 + 00110000 = 00110010 00000100 + 00110000 = 00110100 We output these two ASCII character codes in reverse order, so we now have {00110100, 00110010} which is {52, 50} in decimal. ASCII character code 52 yields '4' while ASCII character code 50 yields '2', which gives us the complete string, "42", which can now be presented to the user. Converting the other way takes the user-input string "42" and stores the value 00101010: First, subtract character code '0' (48 decimal) from each character: 00110010 - 00110000 = 00000010 (50 - 48 = 2) 00110100 - 00110000 = 00000100 (52 - 48 = 4) Multiply each digit by increasing powers of 10: 00000010 * 00000001 = 00000010 (2 * 10^0 = 2) 00000100 * 00001010 = 00101000 (4 * 10^1 = 40) Finally, sum the products: 00000010 + 00101000 = 00101010 (2 + 40 = 42) If we wish to see the binary representation of an integer, R provides the Int2Bin function: >intToBin(42, 8) [1] "00101010" Here we've requested the binary equivalent of the decimal value 42 in 8-bit binary which, as we've already established, outputs the binary value 00101010.
01100001 00110100 01000000 11110001
Ill teach you right now, only binary math tho, not the programming langue or anything, just that math.... first use this table 1 2 4 8 now the number 1 is like saying "yes" and 0 is like saying "No" to make the number 5 you do 1 plus 4 = 5 so we do do we use 4 yes do we use 2 no do we use 1 yes so its 101 first one is 4 then 0 is 2 meaning we don't count that and then 1 again witch is 1 so we add em, 5 so 101 = 5 how to make letters? here is a graph you can use I forgot to say, that the 1 2 4 8 keeps going just get the last number and add it with itself like 1 2 4 8 16 32 64 128 and so on chr(32) 00100000 ! chr(33) 00100001 " chr(34) 00100010 # chr(35) 00100011 $ chr(36) 00100100 % chr(37) 00100101 & chr(38) 00100110 ' chr(39) 00100111 ( chr(40) 00101000 ) chr(41) 00101001 * chr(42) 00101010 + chr(43) 00101011 , chr(44) 00101100 - chr(45) 00101101 . chr(46) 00101110 / chr(47) 00101111 0 chr(48) 00110000 1 chr(49) 00110001 2 chr(50) 00110010 3 chr(51) 00110011 4 chr(52) 00110100 5 chr(53) 00110101 6 chr(54) 00110110 7 chr(55) 00110111 8 chr(56) 00111000 9 chr(57) 00111001 : chr(58) 00111010 ; chr(59) 00111011 < chr(60) 00111100 = chr(61) 00111101 > chr(62) 00111110 ? chr(63) 00111111 @ chr(64) 01000000 A chr(65) 01000001 B chr(66) 01000010 C chr(67) 01000011 D chr(68) 01000100 E chr(69) 01000101 F chr(70) 01000110 G chr(71) 01000111 H chr(72) 01001000 I chr(73) 01001001 J chr(74) 01001010 K chr(75) 01001011 L chr(76) 01001100 M chr(77) 01001101 N chr(78) 01001110 O chr(79) 01001111 P chr(80) 01010000 Q chr(81) 01010001 R chr(82) 01010010 S chr(83) 01010011 T chr(84) 01010100 U chr(85) 01010101 V chr(86) 01010110 W chr(87) 01010111 X chr(88) 01011000 Y chr(89) 01011001 Z chr(90) 01011010 [ chr(91) 01011011 \ chr(92) 01011100 ] chr(93) 01011101 ^ chr(94) 01011110 _ chr(95) 01011111 ` chr(96) 01100000 a chr(97) 01100001 b chr(98) 01100010 c chr(99) 01100011 d chr(100) 01100100 e chr(101) 01100101 f chr(102) 01100110 g chr(103) 01100111 h chr(104) 01101000 i chr(105) 01101001 j chr(106) 01101010 k chr(107) 01101011 l chr(108) 01101100 m chr(109) 01101101 n chr(110) 01101110 o chr(111) 01101111 p chr(112) 01110000 q chr(113) 01110001 r chr(114) 01110010 s chr(115) 01110011 t chr(116) 01110100 u chr(117) 01110101 v chr(118) 01110110 w chr(119) 01110111 x chr(120) 01111000 y chr(121) 01111001 z chr(122) 01111010 { chr(123) 01111011 | chr(124) 01111100 } chr(125) 01111101 ~ chr(126) 01111110 n/a chr(127) 01111111