Introduction to Communications
Welcome to the study notes for Communications! In this section, we explore how computers keep data safe, how they check for mistakes when sending information, and how different parts of a computer talk to each other. Whether you are sending a text message or your CPU is talking to your RAM, "communication" is the heartbeat of computer science. Don't worry if it seems like a lot to take in at first—we will break it down into easy, bite-sized pieces!
1. Basic Encryption Methods
When we send data, we don't want hackers or "eavesdroppers" to read it. Encryption is the process of using an algorithm to turn readable data (Plaintext) into a scrambled mess (Ciphertext) that only someone with the right Key can understand.
Key Terms to Know:
• Plaintext: The original, readable message (e.g., "Hello World").
• Ciphertext: The encrypted, unreadable message (e.g., "Sffbu Xpsme").
• Cipher: The secret method or algorithm used to encrypt the data.
• Key: A secret piece of information (like a password or a number) used by the cipher to lock or unlock the data.
The Caesar Cipher
This is one of the oldest and simplest ciphers. It works by shifting every letter in the alphabet by a certain number of places.
Example: With a shift of 3, 'A' becomes 'D', 'B' becomes 'E', and so on.
Why is it weak?
1. There are only 25 possible keys (shifts). A computer can try all of them in a split second!
2. It is vulnerable to Frequency Analysis. In English, the letter 'E' is very common. If a specific symbol appears often in the ciphertext, it's probably 'E'.
3. Once you figure out one letter, you know the shift for the whole message.
The Vernam Cipher (The "Perfect" Security)
The Vernam Cipher is special because it is mathematically unbreakable if used correctly. To be "perfectly secure," it must meet these conditions:
• The key must be completely random.
• The key must be at least as long as the plaintext.
• The key must be used only once (often called a "One-Time Pad").
• The key must be kept secret between the sender and receiver.
Quick Review: The Caesar cipher is "weak" because it's easy to guess. The Vernam cipher is "perfect" because there are no patterns to find!
Symmetric vs. Asymmetric Encryption
• Symmetric Encryption: Uses the same key to encrypt and decrypt. (Example: Caesar and Vernam). The big problem here is the Key Exchange Problem—how do you send the secret key to your friend without a hacker stealing it?
• Asymmetric Encryption: Uses two different but mathematically related keys (a Public Key and a Private Key). This solves the key exchange problem because you never have to share your private key!
Key Takeaway: Encryption turns plaintext into ciphertext. The Vernam cipher is the only one that offers perfect security, provided the key is random, one-time, and long enough.
2. Error Detection and Correction
When data travels from one place to another, sometimes bits (0s and 1s) get flipped because of electrical interference or "noise." We use three main methods to spot these mistakes:
1. Parity Bits
We add an extra bit (the parity bit) to a string of binary code to make the total number of 1s either Even or Odd.
• Even Parity: The total number of 1s must be an even number.
• Odd Parity: The total number of 1s must be an odd number.
Example (Even Parity): If we want to send 1011, there are three 1s. To make it even, we add a parity bit of 1, resulting in 10111.
2. Majority Voting
Instead of sending the data once, we send every bit three times. The computer looks at the three bits and takes a "vote."
• If it receives 1, 0, 1, the computer assumes the bit was meant to be 1 (because there are more 1s).
• This is great because it can actually correct the error, not just find it!
3. Checksums
The sender runs a calculation on the data to get a total value (the checksum) and sends this value along with the data. The receiver does the same calculation. If the receiver's total doesn't match the sender's total, an error has occurred.
Comparison Table:
Parity: Simple but can't detect if two bits flip.
Majority Voting: Very reliable and corrects errors, but sends 3x more data (very slow!).
Checksums: Excellent for large files, but takes more processing power to calculate.
Key Takeaway: Parity and Checksums usually just detect errors, while Majority Voting can correct them.
3. Internal Communication (Buses)
Inside the computer, the Processor (CPU), Memory (RAM), and I/O Controllers (like your keyboard or screen) need to talk. They do this using a "Bus" system.
The Three Main Buses:
Think of a bus like a highway. Different highways carry different things:
1. Address Bus: Carries the location of where the data is going. It is one-way (Unidirectional) from the CPU to memory. If the address bus has \( n \) wires, the CPU can access \( 2^n \) memory locations.
2. Data Bus: Carries the actual data or instructions. It is two-way (Bidirectional) so data can go to and from the CPU.
3. Control Bus: Carries command signals (like "Read" or "Write") to coordinate everything. It is also two-way.
Memory Tip: The "Pizza Delivery" Analogy
• Address Bus: The house address where the pizza is going.
• Data Bus: The actual pizza being delivered.
• Control Bus: The phone call telling the shop to "Make the pizza" or "Deliver it now."
What affects performance?
• Bus Width: The more wires a bus has, the more data it can carry at once. A 64-bit data bus is like a 64-lane highway—much faster than an 8-lane one!
• Address Bus Width: This determines the maximum amount of RAM the computer can use.
Quick Review: Address bus = Where. Data bus = What. Control bus = How/When.
Key Takeaway: Internal communication relies on the system bus. The width of these buses directly impacts how much memory a computer can address and how fast it can move data.
Summary Checklist
✔ Do you know the difference between plaintext and ciphertext?
✔ Can you explain why a Caesar cipher is easy to crack?
✔ Can you list the 4 conditions for a perfectly secure Vernam cipher?
✔ Can you calculate an even/odd parity bit?
✔ Do you understand how majority voting corrects errors?
✔ Can you name the three internal buses and their directions?
Don't worry if this seems tricky at first! Try drawing out the buses or practicing a few shifts with the Caesar cipher to see it in action. You've got this!