Skip to main content

Featured

Space Explorers Book 7: Answers and Explanations

Memunic Space Explorers › Book 7: Memoon and the Search for Another Home › Answers and Explanations Answers and Explanations Habitable means life could live there; inhabited means life does live there. A world can be habitable and empty, as an unoccupied flat has a roof and water but nobody in it. The Moon has almost no air, so water would boil or freeze, and its gravity is only about one-sixth of Earth’s, too weak to keep air. Accept also: no greenhouse blanket, so it swings between very hot and very cold. Venus. It matches Earth in size and roughly in mass, but its thick carbon dioxide air traps heat, making it hot and crushing. “Twin” is only true for size and weight. A dip of 1 per cent means (planet width divided by star width) squared is 0.01, so the ratio is 0.1: the planet is about a tenth as wide as the star. Repeats at the same gap show the planet is going round the star in 12 days, and rule out a one-time event such as a passing object. A planet shines only by reflected l...

Byte by Byte Book 6: Chapter 1 – How a Computer Really Works

Byte by Byte › Book 6: Python, Data and How Computers Work › Chapter 1: How a Computer Really Works

Chapter 1: How a Computer Really Works

You will learn: the main parts inside a computer, what the CPU does in the fetch-decode-execute cycle, the difference between RAM, ROM, cache and storage, how storage is measured, and how to check your own computer's processor and memory.

🌟 The Adventure

The first lighthouse went dark on a Tuesday.

By Thursday, every lighthouse along the coast of Memunic World had stopped shining. Fishing boats bumped into rocks. The tide gates at Riverbend jammed half open. Even the golden Light Bridges flickered, because their cables ran under the sea.

On Friday evening Nimo appeared at Memoon's window in his water bubble, so upset that the bubble was wobbling. "It's the Deep Engine," he said. "It's failing. Octavia says it might stop completely. Memoon, I need you to come home with me."

Memoon had never heard of the Deep Engine. Nimo explained as they hurried to the shore. Long ago, the Old Makers had built a giant machine on the floor of the Data Sea. It ran the lighthouses, the tide gates and the undersea cables. Only one creature still knew how to look after it: Octavia, an ancient octopus who had been its Keeper for two hundred years.

At the water's edge, Nimo blew a glowing bubble that settled over Memoon's head like a clear helmet. She could breathe perfectly. Noodles, who had followed them, received one too, and looked betrayed. Then they dived.

The Data Sea glowed blue, criss-crossed with faint golden lines. Down and down they swam until a vast shape rose from the sea floor: a machine as big as a palace, made of stone and brass, its windows flickering weakly. A violet octopus with a brass headlamp floated at its door.

"So you are Memoon," said Octavia. Her voice was slow and kind. "Nimo says you understand machines. But do you know what a machine like this is actually made of?"

Memoon opened her mouth, and closed it again. She could use a computer. She could program one. But what was inside it? She had no idea.

"Then come in," said Octavia. "Let me show you."

💡 Learn With Memoon

Hardware and software. A computer system has two halves. Hardware is every part you can touch: the screen, the keyboard, the chips inside. Software is the instructions that tell the hardware what to do: programs, apps and the operating system. Hardware without software is a box that does nothing. Software without hardware has nowhere to run. You need both.

The big picture. In Book 1 you learned that a computer takes input, does processing, gives output, and can store things for later. Here is what really does each job:

JobMain parts that do itExamples
InputInput devicesKeyboard, mouse, touchscreen, microphone, camera, scanner, sensors
ProcessingCPU (with help from RAM)The processor chip
OutputOutput devicesMonitor, speakers, printer, headphones, projector
StorageStorage devicesSSD, hard disk drive, USB flash drive, memory card, cloud storage

All these parts are connected to the motherboard, the large main circuit board inside the computer. It carries electrical signals between the parts along tiny copper tracks. The power supply turns electricity from the wall socket into the low voltages the parts need. In a laptop or phone, a battery does the same job when you are unplugged.

The CPU: the computer's processor. The CPU (central processing unit), or processor, is the chip that carries out the instructions in programs. It is often called the brain of the computer, but that is only partly true. A brain thinks for itself; a CPU only follows instructions, extremely fast. It has three important parts:

  • The control unit (CU) reads each instruction, works out what it means, and directs the other parts.
  • The arithmetic logic unit (ALU) does the actual calculations (adding, subtracting, comparing) and logic (true or false decisions).
  • Registers are a few tiny, super-fast storage spaces right inside the CPU. They hold the instruction and the numbers being worked on right now.

The fetch-decode-execute cycle. Every program, from a calculator to a video game, is turned into a long list of very simple instructions such as load this number, add these two numbers, store the answer here. The CPU works through them one at a time, using the same three steps over and over:

  1. Fetch: the control unit gets the next instruction from memory.
  2. Decode: the control unit works out what the instruction means and what it needs.
  3. Execute: the instruction is carried out, often by the ALU, and the result is stored in a register or in memory.

Then it fetches the next instruction. This is the fetch-decode-execute cycle, also called the instruction cycle. A modern CPU repeats it billions of times every second.

Clock speed and cores. A CPU has a clock that ticks to keep every step in time. Clock speed is measured in hertz (Hz), meaning ticks per second. One gigahertz (GHz) is one billion ticks per second, so a 3 GHz processor ticks three billion times a second. Most modern CPUs also have several cores. Each core is a complete processor that can run its own cycle, so a quad-core CPU can work on four tasks at the same time. More GHz and more cores usually mean a faster computer, but only if the software is written to use them.

Memory and storage: not the same thing. People mix these words up all the time. They are different, and it matters.

RAMROMStorage (SSD or hard disk)
Full nameRandom access memoryRead-only memorySecondary storage
What it holdsPrograms and data being used right nowThe start-up instructions (firmware)All your files, apps and the operating system
When power goes offEverything is lost (volatile)Kept (non-volatile)Kept (non-volatile)
Can you change it?Yes, constantlyNormally no (only special updates)Yes
SpeedVery fastFastSlower than RAM
Typical size today8 to 32 GBA few MB256 GB to 2 TB

A good way to picture it is a desk in a library. Storage is the library shelves: huge, and everything stays there. RAM is your desk: much smaller, but you can reach anything on it instantly. When you open a program, it is copied from storage onto the desk (RAM) so the

CPU can work with it quickly. When you switch off without saving, the desk is cleared, which is why unsaved work disappears. Your saved file is still safe on the shelf.

ROM and firmware. When you press the power button, RAM is empty, so how does the computer know what to do? The answer is in ROM, a chip on the motherboard holding firmware: built-in software that tests the hardware and starts loading the operating system. On modern PCs this firmware is called UEFI (older computers used a BIOS). This start-up process is called booting.

Cache: the CPU's pocket. Even RAM is slow compared with the CPU. So CPUs have cache memory: a small amount of very fast memory built into or beside the processor, holding the instructions and data used most often. When the CPU needs something, it checks registers first, then cache, then RAM, then storage. Each step is bigger but slower. This ladder is called the memory hierarchy.

Kinds of storage.

TypeHow it stores dataGood pointsWeak points
Hard disk drive (HDD)Magnetic spots on spinning metal platters, read by a moving armCheap for large sizesSlower; moving parts can break if dropped
Solid-state drive (SSD)Flash memory chips, no moving partsVery fast, silent, toughCosts more per GB
USB flash drive, Flash memory memory cardSmall, portableEasy to lose; can wear out
Optical disc (CD, DVD, Blu-ray)Tiny pits read by a laserCheap to copyMostly old-fashioned now
Cloud storage (OneDrive, Google Drive)On servers in data centres, reached over the internetAccess anywhere, safe from your device breakingNeeds internet; someone else holds your data

Measuring storage. You met bytes, kilobytes, megabytes and gigabytes in Book 3. Here is the full ladder:

UnitSizeRoughly holds
BitA single 0 or 1One yes/no
Byte8 bitsOne letter of English text
Kilobyte (KB)About 1,000 bytesA short paragraph
Megabyte (MB)About 1,000 KBA photo, or a minute of music
Gigabyte (GB)About 1,000 MBA film
Terabyte (TB)About 1,000 GBHundreds of films

Why "about"? Computers work in powers of 2, so they often count 1 KB as 1,024 bytes (2 to the power 10). Storage makers usually count 1 KB as exactly 1,000 bytes. That is why a new "512 GB" drive shows a little less in Windows. Both are measuring the same bytes; they just count them differently. You will see why 1,024 is special in Chapter 3.

Putting it together: what happens when you open a photo. You double-click the file (input). The operating system finds it on the SSD (storage) and copies it into RAM. The CPU fetches and executes millions of instructions to turn the file's data into coloured dots, using cache for speed. The result is sent to the graphics chip and appears on the monitor (output). All of this happens in under a second.

💡 Memoon’s tip: If your computer is slow when lots of programs are open, the desk (RAM) is probably full. Close what you are not using, and the computer will stop having to swap things back and forth with the shelves.

Illustration from Byte by Byte Book 6: Chapter 1 – How a Computer Really Works

✍️ Try It Yourself

Activity 1: Meet your own computer's hardware.

  1. Click Start, then Settings (the gear icon).
  2. Click System, then scroll down and click About.
  3. Under Device specifications, find Processor and Installed RAM. Write them in your notebook. Is your processor's speed in GHz? How many GB of RAM do you have?
  4. Go back to System and click Storage. How big is your drive, and how much is used?

Activity 2: Watch the CPU and memory at work.

  1. Press Ctrl + Shift + Esc to open Task Manager. (If you see a small window, click More details.)
  2. Click Performance on the left (the icon looks like a small graph).
  1. Click CPU. Find the speed, the number of cores and the live graph. Note the percentage used.
  2. Open three or four apps (Paint, Edge, Calculator, Notepad). Watch the Memory graph. Does the amount used go up?
  3. Close the apps one by one. What happens to memory? Write what you saw.
  4. Click Disk 0. Does it say SSD or HDD?

Activity 3: Sort the parts. Copy this table into your notebook and tick the right column for each part: keyboard, CPU, monitor, SSD, microphone, printer, RAM, webcam, speakers, USB flash drive.

PartInputProcessingOutputStorage

Keyboard

Unplugged: Be the CPU. You need three people and some paper. One person is Memory, holding a numbered list of instructions on cards: 1. Write 5 in box A. 2. Write 3 in box B. 3. Add A and B, write the answer in box C. 4. Say box C aloud. 5. Stop. The second person is the Control Unit, who fetches one card at a time and reads it out. The third is the ALU, who does any calculation and writes in the boxes (the registers). Run the program. Then make up your own five-instruction program for another group to run. How many fetch-decode-execute cycles did it take?

🎉 Memoon Solves It

Octavia led them through the Engine. In the central chamber, the brass core pulsed slowly, far too slowly. Beside it stood a long stone table covered in glowing slates, so crowded that new slates were piled on the floor.

"Every time the Engine needs a tablet from the vaults, I copy it onto a slate on the worktable," said Octavia. "That is how it has always worked. But the table is full, and the Engine keeps sending me back to the vaults again and again."

Memoon looked at the table. Then at the vaults. Then at the slates on the floor. "The worktable is the Engine's RAM," she said slowly. "Fast memory for what it's using right now. But you never clear it. Half these slates are for lighthouses that switched off years ago."

Octavia's golden eyes widened. Together they cleared every slate that was no longer needed, carefully checking that each one was safely stored as a tablet in the vaults first.

With a free table, the core sped up. Its pulse quickened, brighter and brighter, and far above them, one by one, the lighthouses flickered back on.

But not all of them. And the tide gates were still stuck. Octavia frowned. "The Engine is faster. But it is still confused. The lighthouses, the gates and the cables are all shouting at the core at once, and nobody is telling them whose turn it is."

"Then the Engine needs someone in charge," said Memoon.

❓ Check Your Knowledge

  1. What is the difference between hardware and software? Give two examples of each.
  2. Name the three parts of a CPU and say what each one does.
  3. Put the steps of the instruction cycle in order: execute, fetch, decode.
  4. A CPU has a clock speed of 2.5 GHz. How many ticks is that per second?
  5. True or false: RAM keeps your data when the computer is switched off. Explain.
  6. What is stored in ROM, and why does a computer need it?
  7. Why do CPUs have cache memory?
  8. Give one advantage of an SSD over a hard disk drive, and one advantage of a hard disk drive over an SSD.
  9. Arrange from smallest to largest: GB, bit, TB, KB, byte, MB.
  10. Fill in the blank: when you open a program, it is copied from ________ into ________ so the CPU can use it quickly.
  11. Challenge: Your friend says, "My laptop has 512 GB of memory." What do they probably mean, and how would you correct them politely?

📚 Word Bank

  • Hardware: the physical parts of a computer you can touch.
  • Software: the programs and instructions that tell hardware what to do.
  • Motherboard: the main circuit board that connects all the parts of a computer.
  • CPU (processor): the chip that carries out program instructions.
  • Control unit: the part of the CPU that fetches and decodes instructions and directs the other parts.
  • ALU (arithmetic logic unit): the part of the CPU that does calculations and comparisons.
  • Register: a tiny, very fast storage space inside the CPU.
  • Fetch-decode-execute cycle: the three steps a CPU repeats to carry out each instruction.
  • Clock speed: how many cycles a CPU's clock ticks per second, measured in GHz.
  • Core: a complete processing unit inside a CPU; multi-core CPUs can run several tasks at once.
  • RAM: fast, volatile memory holding the programs and data in use right now.
  • ROM: non-volatile memory holding firmware that starts the computer.
  • Volatile: loses its contents when the power is switched off.
  • Firmware: software built into hardware, such as UEFI or BIOS.
  • Booting: the process of starting a computer and loading the operating system.
  • Cache: small, very fast memory near the CPU holding frequently used data.
  • Memory hierarchy: the ladder of registers, cache, RAM and storage, from fastest and smallest to slowest and largest.
  • SSD: a fast storage device that uses flash memory and has no moving parts.
  • Terabyte (TB): about 1,000 gigabytes.

Keep learning with Byte by Byte

Explore Book 6: Python, Data and How Computers Work. Find the ebook, purchase details and teaching slides on MemuniCity.

Watch this chapter on YouTube

Comments

Popular posts from this blog

CA-7 Job Status and Failure Reason Codes

Here are the various status codes that You may see for jobs in the Queue or Logs in CA-7. R-C0002 R-C0003 R-C0099 R-C0255 R-JCLER A-U0002 A-U0004 A-U0015 A-U0043 A-U4095 A-SOC7 A-U4000 Reason Code/Job Status Code explanation: The indication of the job's current disposition. Values and their meanings are: A-Snnnn-- The job has failed with a system abend. A-Unnnn --The job has failed with a user abend. C-Cnnnn --The job has completed successfully and is going through completion processing. E-ARFATT-- An error occurred during the attempt to attach ARF definitions. This can result if the ARFSET specified is not defined. A diagnostic message may have been written to the CA-7 log, the OS console, or to the trailer queue for the job (in which case it can be displayed using LQ,JOB=x,LIST=ALL). E-ARFERR ---The job encountered an error in the ARF processing. Do a LARFQ command for the job to get more specific information. E-SEGERR --The job has been requeued...

Whistling Winds and Waterfalls: 4 Days of Magic in Shillong

Nestled in the clouds, where the scent of pine trees mingles with the rhythm of waterfalls and the tunes of local guitar-strumming youth—Shillong is more than a place. It’s a vibe. If you’ve got 3 nights and 4 days, you’ve got just enough time to fall in love. Here’s how to make the most of it—food, fun, fog and fantastic views included. Day 1: Shillong, We’re Coming for You! You land in Guwahati, barely out of the airport when the hills start calling. You hop into your cab, Spotify on, windows down, and the three-hour ride to Shillong begins. Just when you think it can’t get better, you stop at Umiam Lake —a lake so calm, it looks like someone ironed the water. By evening, you’re sipping hot chai in Laitumkhrah, maybe nibbling on spicy momos or pork jadoh from a roadside stall. You’re checked into your charming hotel ( Tripura Castle if you fancy old-world royalty, Ri Kynjai if you’re into lakeside poetry). The breeze whispers secrets of waterfalls and pine forests. Sleep well, drea...

Installing and Configuring Hadoop on Ubuntu as a Pseudo Distributed Single Node Cluster

Briefly what is psuedo-distributed single node Hadoop cluster: It is a Hadoop distributed cluster having Single Node. All the five daemons (NN,DN,JT,TT,SNN) are running as individual JVM (java process) instances. We will get all distributed features of Hadoop. This mode is used to develop, test, and staging (before production) Map Reduce programs quickly. It writes all the system, daemon and user logs to different files on the cluster To install Hadoop in this mode, we have to modify the hadoop-env.sh, core-site.xml, hdfs-site.xml, mapred-site.xml. hadoop-env.sh contains all the Environment variables which are required for running Hadoop. All the default values are fine, Only we have to modify the JAVA_HOME=“The location of Java Home Directory” Core-site.xml contains all the cluster specific information like io, temp directory, sorting, file system uri etc. Hdfs-site.xml contains all the parameters which are specific to HDFS like name node directory, data node directory...