Computer Science Binary
Binary Code Remember the power supply that is inside your computer and how it sends electricity to all of the components? That electricity is what creates an on signal. The memory chips inside your computer are divided into thousands of tiny compartments called bits. Each bit has an electronic switch or gate. On means the gate is open and letting electricity go through. The computer reads on or open switches as a number 1. Closed gates are off because the electricity is blocked and cannot get through. The computer reads off bits as 0. It is by grouping these bits together to form a series of 1/0 commands, that data is formed. Eight bits are grouped together to form a byte. In this group of eight, there are 256 possible combinations of 1/0. The grouping of 1/0 within a byte is called Binary Code.
Here's an example of the Binary Code in action: When you type the letter A on your keyboard, electrical signals are sent from the keyboard to the CPU. The CPU turns the signals into binary code. Then, the computer reads the code and sends it on to the monitor to display the letter A.
KB MB GB You may have seen these abbreviations many times before. Do you know what they mean? KB = kilobyte = about 1,000 (one thousand) bytes, (1024 or 2^10) MB = megabyte = about 1,000,000 (one million) bytes, (1,048,576 or 2^20) GB= gigabyte = about 1,000,000,000 (one billion) bytes (1,073,741,824 or 2^30)
Storage As you can see, these abbreviations stand for a specific number of bytes. And each byte holds 8 bits capable of forming 256 combinations of 1/0. Wow! The number that comes before one of these abbreviations represents the computer's memory capacity. For example, if a computer has 64MB of RAM that means that the computer can handle 64,000,000 (64 million) bytes of RAM (that's 64,000,000 microscopic 8- bit panels). Hard disk space is also measured in bytes. So, a 15GB hard drive has 15,000,000,000 (15 billion) bytes for storing memory.
INPUT Look at your keyboard. Each character key is represented by a number that is held in a single byte. Remember how the letter A is sent to the CPU to be translated into binary code? The numerical value of the uppercase letter A is 65. That number 65 is represented in one byte - a combination of 1 and 0 or on and off switches.
Translating –The computer cannot understand letters, so it translates them into numbers that are represented by patterns of on and off. –To get an idea of how much on/off data a computer can store, just imagine pressing one key one billion times! How long would it take?
Timing is Key –If you pressed the key 5 times per second, it would take you over 6 years of continuously typing to reach 1 billion keystrokes equal to 1GB of memory! –And many computers today can store over 20GB of memory on their hard disks! Incredible! So, the next time your computer is taking a long time to load a web page, think of how fast it really is going !
Translation Con't How to translate binary numbers to decimal numbers In order to translate binary numbers into decimal numbers we must understand the concept of place value. We will use the decimal number system to make sure that we are very clear on this concept. Take a look at the example below.
Decimal to Binary We will now take a look at the number 9876 in order to understand place value we will have to break this number into its digits: 9, 8, 7 and 6. In order to get the true value of the 9 digit we have to multiply it by 1000 because the 4 th digit represents the number of thousands. How do we know that the 4 th digit represents the thousands? Recall that we mentioned that the decimal number system has ten symbols and the number of thousands is found in the 4 th digit.
Binary to Decimal Lets begin by looking at the fourth digit again; in this case it is 1. Recall that to determine the value of a digit we take that digit and multiply it by the number of symbols in the number system raised to the power of the location of the digit. So to determine the value of the 4 th digit we would perform the following calculation: 1 x 2 3 = 1 x 8 = 8. We would now repeat this process for the other three digits, then add all of these results to find the translation of the binary number.
Binary Code The binary system that computers use to store and process information is a base 2 system. It needs only two symbols, 0 and 1. In fact, "binary" comes from the Latin word for two. Compare this to the decimal system you use. The decimal system is a base 10 system. ("Decimal" comes from the Latin word for ten.) It has 10 symbols (0, 1, 2, 3, 4, 5, 6, 7, 8, 9). So how do you count in a binary system? How do you represent numbers like 103? In decimal (base 10) numbers, you have a 1s place, a 10s place, a 100s place, and so on, to represent value.
The binary system has places or columns too. Only because you're in base 2, instead of each place being 10 times greater than the place before it, each place is only double (2 times) the one before it.
Binary Addition Adding Binary Numbers You know what is, right? Well in Binary it is not 2, its 10 (one and zero) Adding binary numbers is pretty easy. The key is carrying the 1, just like you do in decimal (base 10) system addition. Know how you carry a 1 over to the next place column every time two decimal numbers in a place column add up to 10 or more? Adding two binary numbers is just like that too. You carry a 1 over to the next place column every time you add in a place column— leaving a 0 in that place column
ASCII ASCII—An Alphabet For Computers Bits, the 0s and 1s of binary code, can be used in many different ways to represent information. To make it easier for computers to communicate with each other, a standard language has been created: ASCII (American Standard Code for Information Interchange). ASCII is an 8-bit code. It uses eight bits to represent a letter, number, or punctuation mark. For instance, a lower case "a" is represented by The word "cat" would be:
Binary ASCII table A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Binary and ASCII websites rintable_charactershttp://en.wikipedia.org/wiki/ASCII#ASCII_p rintable_characters /docs/ascii.htmlhttp:// /docs/ascii.html rces/TJI/flash/counter.swfhttp://www97.intel.com/DISCOVER/Resou rces/TJI/flash/counter.swf