Binary Code

Shyfroggy

Member
My little brother is completly fascinated by binary code...so much so he wants to learn about it more...he is 14 and in the 8th grade...anybody know of any good books or resources out there for learning about binary code...he is a gifted student and has no problem reading and comprehending stuff that the average 8th grader might struggle with.

any help would be greatly appreciated.
 
have him grab a linux distro of any kind and start there..if you mean 1's and 0's that's not used in programming. The lowest level usually used(and that's rare) is assembler or machine code. Lookup those and you will find all kinds of stuff.
 
I would look more toward python and the other "easier" languages. Google's app engine allows you to write up a web site in python fairly quickly, and the datastore API is pretty sexy. I could imagine that becoming boring rather quickly without a knowledgeable person to harass/learn from. Usually high schools have dual enrollment programs where they pay for the class, if you can get him in a programming class at the local college.

I know the middle school near us had a class with mindstorms where they used a higher level language to program them (forgot what language/setup tho). The included software is ok and helps teach concepts (it supported if/else, wait, and some other functions based on events from the sensors iirc). The advantage there is you can't really fail, you just click things till it works without really needing much background knowledge.
 
Last edited:
if you mean 1's and 0's that's not used in programming. The lowest level usually used(and that's rare) is assembler or machine code.

We use bit masking (i.e. 1s and 0s) in high level languages every day, particularly for security purposes.
 
you need to clarify a bit on what you mean by binary code...if you're simply referring to the binary number system...any elementary computer science text would be sufficient, although you could just as easily google it...there's not much to learn about how to use it at a high level.

aside from that, there are *coding* schemes you can apply, e.g. huffman, grey, etc... which are a bit more interesting...but still not sure what you're actual desire is
 
I don't think he is clear exactly what direction he wants to go either.

I think he wants to know the 1's and 0's that match up to the letter of the alphabet.

But I could see him taking it farther or learning about other stuff after that.

I think the Elementary Computer Science Text would be a good place to start - I just have to find an actual book for him since he doesn't get on the computer much right now.
 
I don't think he is clear exactly what direction he wants to go either.

I think he wants to know the 1's and 0's that match up to the letter of the alphabet.

But I could see him taking it farther or learning about other stuff after that.

I think the Elementary Computer Science Text would be a good place to start - I just have to find an actual book for him since he doesn't get on the computer much right now.


I think you want ASCII then? http://en.wikipedia.org/wiki/ASCII That's not binary though it's a number code used to represent letters. Binary is nothing more than a different number system using only 0 - 1 where normally you use 0 - 9. ASCII is often represented in binary though. I think that's right, I don't know, it's so sleep inducing XD .
 
Last edited:
I think you want ASCII then? http://en.wikipedia.org/wiki/ASCII That's not binary though it's a number code used to represent letters. Binary is nothing more than a different number system using only 0 - 1 where normally you use 0 - 9. ASCII is often represented in binary though. I think that's right, I don't know, it's so sleep inducing XD .

The most common right no is ASCII, utf8 and unicode (java uses this). ascii and utf8 use 8 bits to represent the characters (in c a char and int are practically the same thing, besides size). unicode has 16 characters to better support more languages.

Code:
#include <stdio.h>

int main(void)
{
	int i;
	for(i = 0; i < 128; ++i)
		printf("%i is: %c \n", i, i);

	return 0;
}

Code:
0 is:  
1 is:  
2 is:  
3 is:  
4 is:  
5 is:  
6 is:  
7 is:  
8 is: 
9 is: 	 
10 is: 
 
11 is: 
        
12 is: 
        
 3 is: 
14 is:  
15 ␋⎽:  
16 is:  
17 is:  
18 is:  
19 is:  
20 is:  
21 is:  
22 is:  
23 is:  
24 is:  
25 is:  
26 is:  
27 is: 
28 is:  
29 is:  
30 is:  
31 is:  
32 is:   
33 is: ! 
34 is: " 
35 is: # 
36 is: $ 
37 is: % 
38 is: & 
39 is: ' 
40 is: ( 
41 is: ) 
42 is: * 
43 is: + 
44 is: , 
45 is: - 
46 is: . 
47 is: / 
48 is: 0 
49 is: 1 
50 is: 2 
51 is: 3 
52 is: 4 
53 is: 5 
54 is: 6 
55 is: 7 
56 is: 8 
57 is: 9 
58 is: : 
59 is: ; 
60 is: < 
61 is: = 
62 is: > 
63 is: ? 
64 is: @ 
65 is: A 
66 is: B 
67 is: C 
68 is: D 
69 is: E 
70 is: F 
71 is: G 
72 is: H 
73 is: I 
74 is: J 
75 is: K 
76 is: L 
77 is: M 
78 is: N 
79 is: O 
80 is: P 
81 is: Q 
82 is: R 
83 is: S 
84 is: T 
85 is: U 
86 is: V 
87 is: W 
88 is: X 
89 is: Y 
90 is: Z 
91 is: [ 
92 is: \ 
93 is: ] 
94 is: ^ 
95 is: _ 
96 is: ` 
97 is: a 
98 is: b 
99 is: c 
100 is: d 
101 is: e 
102 is: f 
103 is: g 
104 is: h 
105 is: i 
106 is: j 
107 is: k 
108 is: l 
109 is: m 
110 is: n 
111 is: o 
112 is: p 
113 is: q 
114 is: r 
115 is: s 
116 is: t 
117 is: u 
118 is: v 
119 is: w 
120 is: x 
121 is: y 
122 is: z 
123 is: { 
124 is: | 
125 is: } 
126 is: ~ 
127 is:

Not all of the values are visible.
 
Code:
00100001 (33) is: ! 
00100010 (34) is: " 
00100011 (35) is: # 
00100100 (36) is: $ 
00100101 (37) is: % 
00100110 (38) is: & 
00100111 (39) is: ' 
00101000 (40) is: ( 
00101001 (41) is: ) 
00101010 (42) is: * 
00101011 (43) is: + 
00101100 (44) is: , 
00101101 (45) is: - 
00101110 (46) is: . 
00101111 (47) is: / 
00110000 (48) is: 0 
00110001 (49) is: 1 
00110010 (50) is: 2 
00110011 (51) is: 3 
00110100 (52) is: 4 
00110101 (53) is: 5 
00110110 (54) is: 6 
00110111 (55) is: 7 
00111000 (56) is: 8 
00111001 (57) is: 9 
00111010 (58) is: : 
00111011 (59) is: ; 
00111100 (60) is: < 
00111101 (61) is: = 
00111110 (62) is: > 
00111111 (63) is: ? 
01000000 (64) is: @ 
01000001 (65) is: A 
01000010 (66) is: B 
01000011 (67) is: C 
01000100 (68) is: D 
01000101 (69) is: E 
01000110 (70) is: F 
01000111 (71) is: G 
01001000 (72) is: H 
01001001 (73) is: I 
01001010 (74) is: J 
01001011 (75) is: K 
01001100 (76) is: L 
01001101 (77) is: M 
01001110 (78) is: N 
01001111 (79) is: O 
01010000 (80) is: P 
01010001 (81) is: Q 
01010010 (82) is: R 
01010011 (83) is: S 
01010100 (84) is: T 
01010101 (85) is: U 
01010110 (86) is: V 
01010111 (87) is: W 
01011000 (88) is: X 
01011001 (89) is: Y 
01011010 (90) is: Z 
01011011 (91) is: [ 
01011100 (92) is: \ 
01011101 (93) is: ] 
01011110 (94) is: ^ 
01011111 (95) is: _ 
01100000 (96) is: ` 
01100001 (97) is: a 
01100010 (98) is: b 
01100011 (99) is: c 
01100100 (100) is: d 
01100101 (101) is: e 
01100110 (102) is: f 
01100111 (103) is: g 
01101000 (104) is: h 
01101001 (105) is: i 
01101010 (106) is: j 
01101011 (107) is: k 
01101100 (108) is: l 
01101101 (109) is: m 
01101110 (110) is: n 
01101111 (111) is: o 
01110000 (112) is: p 
01110001 (113) is: q 
01110010 (114) is: r 
01110011 (115) is: s 
01110100 (116) is: t 
01110101 (117) is: u 
01110110 (118) is: v 
01110111 (119) is: w 
01111000 (120) is: x 
01111001 (121) is: y 
01111010 (122) is: z 
01111011 (123) is: { 
01111100 (124) is: | 
01111101 (125) is: } 
01111110 (126) is: ~ 
01111111 (127) is:

Code:
#include <stdio.h>

#define BIN_LENGTH 8
//function adapted from http://www.edn.com/contents/images/di2443.txt
int c[BIN_LENGTH];
void fast_d2b(unsigned long x, int * c) {
   int i;

   for(i=0;i<BIN_LENGTH;i++)
      *(c++) = (x >> i) & 0x1;
}


int main(void)
{
	int i; int b;
	for(i = 0; i < 128; ++i)
	{
		fast_d2b(i, c);

  	 	for (b= BIN_LENGTH - 1; b>=0; b--)
      			printf("%d",c[b]);

		printf(" (%i) is: %c \n", i, i);
	}	
	return 0;
}
 
thanks that is what he was looking for!!!!

i feel like a happy big sister now since I had help finding him what he was looking for!!! thanks for your help.
 
Back
Top