Sunday, February 8, 2009

Under it all: All the bits and bytes

While thinking about making games and making big programs on the high level programming languages I was thinking about how it all started and what is underneath all of the complex code. In order to understand what goes on with the high level computer languages you need to understand what goes on underneath it all. Computers are full of 1's and 0's which are called binary numbers. These numbers all group together to make different letters, numbers, and characters. In order for you to convert a number into binary you have to follow a series of steps.

1. Divide the number you are trying to convert by 2
2. The remainder gets written down as a 0 or a 1.
3. Repeat steps 1 and 2. The remainder will be written to the left of the number written before it until you can not divide the number any longer.

So why is all of this important? A computer bit can hold 1 binary number. A byte consists of a group of 8 bits grouped together and can hold any kind of character or number depending on what order the binary numbers are in. For example, the letter 'A' is 01000001 and 'a' is 01100001. It can get frustrating for computer programmers because if a 0 or a 1 is in the wrong spot, a program can do something completely different then what you want it to do.

No comments:

Post a Comment