This document defines binary code, explains how to convert text to binary code using ASCII codes, and provides an example of converting the word "CAT" to its binary code and then translating a binary code back to the word "STEM". Specifically:
- Binary code represents numeric values using the digits 0 and 1, and is the simplest form of computer code.
- ASCII codes assign a numeric value to each letter, which can then be written in binary.
- An example shows converting the letters in "CAT" to their binary codes - 01000011 for C, 01000001 for A, and 01010100 for T - and combining them to get the binary code for "CAT".
- Another
Objectives
•Define what isa Binary Code
•Learn how to calculate a binary code
•Learn how to write in binary numbers and
transform a binary code to an English
Language Letters
3.
BINARY CODE
is a base2 number system invented by Gottfried
Leibniz where numeric values are represented by different
combinations of 0 and 1, also known as OFF or ON.
Is the simplest form of computer code or programming
data.
4.
HOW TO READA BINARY CODE
The following chart illustrates the binary number 01101000. In
this example, we get the total value by reading the chart
from right to left and adding each column's value to that of the
previous column: (8+32+64) = 104. As you can see, we do not
count the bits with a 0 because they're "turned off."
VALUE 128 64 32 16 8 4 2 1
ON/OFF 0 1 1 0 1 0 0 0
5.
CONVERTING A TEXT
INTOA BINARY CODE
In converting a text to binary code we will
use the ASCII or American Standard Code for
Information Interchange. ASCII codes represent
text in computers, telecommunications
equipment, and other devices. Most modern
character-encoding schemes are based on ASCII,
although they support many additional characters
6.
Letter Code
Decima
l
Letter Code
Decim
al
A01000001 65 N 01001110 78
B 01000010 66 O 01001111 79
C 01000011 67 P 01010000 80
D 01000100 68 Q 01010001 81
E 01000101 69 R 01010010 82
F 01000110 70 S 01010011 83
G 01000111 71 T 01010100 84
H 01001000 72 U 01010101 85
I 01001001 73 V 01010110 86
J 01001010 74 W 01010111 87
K 01001011 75 X 01011000 88
L 01001100 76 Y 01011001 89
M 01001101 77 Z 01011010 90
ASCII
7.
EXAMPLE:
1. Convert theword CAT into a binary code.
First, we need to identify first the binary number of
each letter in the word CAT.
In the letter C base on the ASCII it is equal to 67
VALUE 128 64 32 16 8 4 2 1
ON/OFF 0 1 0 0 0 0 1 1
In the letter A base on the ASCII it is equal to 65
VALUE 128 64 32 16 8 4 2 1
ON/OFF 0 1 0 0 0 0 0 1
In the letter T base on the ASCII it is equal to 84
VALUE 128 64 32 16 8 4 2 1
ON/OFF 0 1 0 1 0 1 0 0
8.
Lastly, we willjust combine their binary
numbers.
C A T
01000011 01000001 01010100
Hence, the binary code of CAT is 010000110100000101010100.
2. Translate this binary code
01010011010101000100010101001101 into a word.
01010011 01010100 01000101 01001101
9.
VALUE 128 6432 16 8 4 2 1
ON/OFF 0 1 0 1 0 0 1 1
VALUE 128 64 32 16 8 4 2 1
ON/OFF 0 1 0 1 0 1 0 0
VALUE 128 64 32 16 8 4 2 1
ON/OFF 0 1 0 0 0 1 0 1
VALUE 128 64 32 16 8 4 2 1
ON/OFF 0 1 0 0 1 1 0 1
64+16+2+1=83
S
64+8+4+1=77
M
64+4+1=69
E
64+16+4=84
T
Hence, the word STEM is the text of the binary code
01010011010101000100010101001101