Sie sind auf Seite 1von 17

Binary Code

The Language of Your Computer


Input/Output
Input is whatever is put into a computer.
Input can be data, letters, numbers, symbols, shapes,
sounds, pressure, light beams or whatever material
needs processing.
Output hardware consists of devices that translate
information processed by the computer into a form
humans can understand - print, sound, graphics, or
video, for example.
The Binary System

The base of all programs is the binary system, a


number system of two - 1 and 0.
These represent On and Off - the position for an
electrical signal to pass through (or not) a transistor.
All data and program instructions that go into the
computer to be processed and stored, are
represented by these binary numbers.
Decimal System
To understand the binary system, we need to review
our Base 10, decimal system.
The prefix “dec-” means 10
Our decimal system is based on 10 numbers
(0,1,2,3,4,5,6,7,8,9)
When counting, using place value, we fill the ones
place and then move to the tens place.
For example:
10’s 1’s
When you count in the
9
decimal system (base 10)
you fill the one’s place, then 1 0
move to the ten’s place. 1 1
1 2
Only the numbers 0 - 9 are
used. 1 3

As each place value is filled 100’s 10’s 1’s


with the numbers, we 9 9
continue to the next place 1 0 0
value. Each place value is
10x the previous place. 1 0 1
Counting in Binary (Base 2)
The prefix “bi-” means two.
The binary system uses only two numbers - 0 and 1.
We count in the binary system the same as in the
decimal system by filling in the place values and
moving up the place value chart.
If the decimal system, base 10 has place values 10x
the previous place - How do you think the place
values for the binary system are determined?
Counting in Binary
0
1
Do you see a 1 0
pattern? 1 1
1 0 0
1 0 1
1 1 0
1 1 1
1 0 0 0
Counting in Binary
64’s 32’s 16’s 8’s 4’s 2’s 1’s Decima
l
0
0
1
1
Each place 1 0
value is 2x the 2
previous place. 1 1
3
1 0 0
4
1 0 1
5
1 1 0
6
1 1 1
7
1 0 0 0
8
Counting in Binary
64’s 32’s 16’s 8’s 4’s 2’s 1’s Decima
l
0
0
110 = 6 1
1
one 4, one 2 = 6 1 0
1000 = 8 2
one 8 1 1
3
1 0 0
4
1 0 1
5
1 1 0
6
1 1 1
7
1 0 0 0
8
Counting in Binary
64’s 32’s 16’s 8’s 4’s 2’s 1’s

1 0 1 0 0 1

What is this
binary
number?
Counting in Binary
64’s 32’s 16’s 8’s 4’s 2’s 1’s

1 0 1 0 0 1
(32) + (0) + (8) + (0) + (0) + 1= 41

Determine the
place values
and add them
together.
Counting to 20 in binary
Binary Decimal Binary Decimal
1 1 1011 11
10 2 1100 12
11 3 1101 13
Try
100 4 1110 14
counting
101 5 1111 to1520.
110 6 10000 16
111 7 10001 17
1000 8 10010 18
1001 9 10011 19
1010 10 10100 20
Bits and Bytes

Bit - In the binary system, each 0 or 1 is called a bit -


short for binary digit.
Byte - A group of eight bits. The letter “G” is a
representation of 1 byte (eight bits).
There are 256 combinations of bits available 28=256
The alphabet in binary
Binary Alphabet
O11OOOO1 a
O11OOO1O b
O11OOO11 c
O11OO1OO d
O11OO1O1 e
O11OO11O f
O11OO111 g
O11O1OOO h
O11O1OO1 i
Can you read this?

O11O1OOO_O11O1OO1

Binary code is the base code of computer


language.
Once you understand the patterns and the
rules, you can learn other programming
languages.
Have fun coding!
Sources

Adapted from, Using Information Technology,


Williams/Sawyer
Additional Teaching Links
Text to Binary and Back Again
http://www.roubaixinteractive.com/PlayGround/Binary_Conversion/Binary_To_Text.a
sp

The Alphabet in Binary


http://www.tekmom.com/buzzwords/binaryalphabet.html

Cisco Binary Game


http://forums.cisco.com/CertCom/game/binary_game_page.htm

http://www.networkclue.com/hardware/computer/binary.aspx

http://en.wikipedia.org/wiki/Binary_numeral_system

Das könnte Ihnen auch gefallen