In today's digital world, everything from the text you read to the images you see and the sounds you hear is processed by computers using binary code – that's just 0s and 1s. This lesson will help you understand how that works, and you'll get hands-on with some practical tasks to see it in action. By the end, you'll have a clear idea of how computers turn real-world data into digital form and why binary is so important.
Here's what we'll cover:
Text in computers is represented using binary codes, which are made up of only 0s and 1s. A common system for this is ASCII, short for American Standard Code for Information Interchange. Each character, like a letter or symbol, is given a unique number in decimal (base 10), and that number is then converted to binary (base 2). For example, the letter 'A' has an ASCII value of 65, which in binary is 01000001. This binary code allows computers to store and process text efficiently.
Below is a table showing the uppercase English letters, their ASCII decimal values, and their binary representations. Take a moment to look at the patterns – notice how each letter's binary code changes slightly as the decimal value increases.
Character | ASCII Decimal | Binary |
---|---|---|
A | 65 | 01000001 |
B | 66 | 01000010 |
C | 67 | 01000011 |
D | 68 | 01000100 |
E | 69 | 01000101 |
F | 70 | 01000110 |
G | 71 | 01000111 |
H | 72 | 01001000 |
I | 73 | 01001001 |
J | 74 | 01001010 |
K | 75 | 01001011 |
L | 76 | 01001100 |
M | 77 | 01001101 |
N | 78 | 01001110 |
O | 79 | 01001111 |
P | 80 | 01010000 |
Q | 81 | 01010001 |
R | 82 | 01010010 |
S | 83 | 01010011 |
T | 84 | 01010100 |
U | 85 | 01010101 |
V | 86 | 01010110 |
W | 87 | 01010111 |
X | 88 | 01011000 |
Y | 89 | 01011001 |
Z | 90 | 01011010 |
To help you understand how text is stored and processed in computers, we are going to convert your name from letters to ASCII codes and then to binary.
Follow these steps to complete the task:
For example, to convert 65 (the letter A) to binary:
1000001
, so add a leading zero to make it 01000001
(8 bits). For 'ALICE', this would give you 01000001
, 01001100
, 01001001
, 01000011
, 01000101
.Now let's create some ASCII art using an online tool. ASCII art uses text characters to form images, and each character has a binary code.
Follow these steps to complete the activity:
Edit > Select All
and then Edit > Copy
). This is a string of characters that make up the image.Images on computers are not stored as continuous pictures but as digital data composed of small squares called pixels. Each pixel acts like a tiny dot that contributes to the overall image, and its colour or brightness is represented using binary code – sequences of 0s and 1s. This is because computers can only process binary data, making it essential for efficient storage and manipulation.
For simple black-and-white images, each pixel can be represented with just one bit: for example, 1 might mean the pixel is 'on' or black, and 0 means 'off' or white. This keeps things straightforward and uses less space. However, for more detailed images with shades of grey or full colour, more bits are needed per pixel. For instance, using 8 bits per pixel allows for 256 different levels of grey or colours, enabling richer and more realistic images.