How Computers Really Work

Book description

How Computers Really Work is a hands-on guide to the computing ecosystem: everything from circuits to memory and clock signals, machine code, programming languages, operating systems, and the internet.

But you won’t just read about these concepts, you’ll test your knowledge with exercises, and practice what you learn with 41 optional hands-on projects. Build digital circuits, craft a guessing game, convert decimal numbers to binary, examine virtual memory usage, run your own web server, and more.

Explore concepts like how to:

•Think like a software engineer as you use data to describe a real world concept
•Use Ohm’s and Kirchhoff’s laws to analyze an electrical circuit
•Think like a computer as you practice binary addition and execute a program in your mind, step-by-step

The book’s projects will have you translate your learning into action, as you:

•Learn how to use a multimeter to measure resistance, current, and voltage
•Build a half adder to see how logical operations in hardware can be combined to perform useful functions
•Write a program in assembly language, then examine the resulting machine code
•Learn to use a debugger, disassemble code, and hack a program to change its behavior without changing the source code
•Use a port scanner to see which internet ports your computer has open
•Run your own server and get a solid crash course on how the web works

And since a picture is worth a thousand bytes, chapters are filled with detailed diagrams and illustrations to help clarify technical complexities.

Requirements: The projects require a variety of hardware – electronics projects need a breadboard, power supply, and various circuit components; software projects are performed on a Raspberry Pi. See Appendix B for a complete list. Even if you skip the projects, the book’s major concepts are clearly presented in the main text.

Table of contents

  1. Cover Page
  2. Title Page
  3. Copyright Page
  4. Dedication
  5. About the Author
  6. About the Tech Reviewers
  7. BRIEF CONTENTS
  8. CONTENTS IN DETAIL
  9. ACKNOWLEDGMENTS
  10. INTRODUCTION
    1. Who Is This Book For?
    2. About This Book
    3. About Exercises and Projects
    4. My Computing Journey
  11. 1 COMPUTING CONCEPTS
    1. Defining a Computer
    2. Analog and Digital
    3. Number Systems
    4. Bits and Bytes
    5. Prefixes
    6. Hexadecimal
    7. Summary
  12. 2 BINARY IN ACTION
    1. Representing Data Digitally
    2. Binary Logic
    3. Summary
  13. 3 ELECTRICAL CIRCUITS
    1. Electrical Terms Defined
    2. Ohm’s Law
    3. Circuit Diagrams
    4. Kirchhoff’s Voltage Law
    5. Circuits in the Real World
    6. Light-Emitting Diodes
    7. Summary
    8. Project #1: Build and Measure a Circuit
    9. Project #2: Build a Simple LED Circuit
  14. 4 DIGITAL CIRCUITS
    1. What Is a Digital Circuit?
    2. Logic with Mechanical Switches
    3. The Amazing Transistor
    4. Logic Gates
    5. Designing with Logic Gates
    6. Integrated Circuits
    7. Summary
    8. Project #3: Build Logical Operators (AND, OR) with Transistors
    9. Project #4: Construct a Circuit with Logic Gates
  15. 5 MATH WITH DIGITAL CIRCUITS
    1. Binary Addition
    2. Half Adders
    3. Full Adders
    4. A 4-bit Adder
    5. Signed Numbers
    6. Unsigned Numbers
    7. Summary
    8. Project #5: Build a Half Adder
  16. 6 MEMORY AND CLOCK SIGNALS
    1. Sequential Logic Circuits and Memory
    2. The SR Latch
    3. Using the SR Latch in a Circuit
    4. Clock Signals
    5. JK Flip-Flops
    6. T Flip-Flops
    7. Using a Clock in a 3-Bit Counter
    8. Summary
    9. Project #6: Construct an SR Latch Using NOR Gates
    10. Project #7: Construct a Basic Vending Machine Circuit
    11. Project #8: Add a Delayed Reset to the Vending Machine Circuit
    12. Project #9: Using a Latch as a Manual Clock
    13. Project #10: Test a JK Flip-Flop
    14. Project #11: Construct a 3-bit Counter
  17. 7 COMPUTER HARDWARE
    1. Computer Hardware Overview
    2. Main Memory
    3. Central Processing Unit (CPU)
    4. Beyond Memory and Processor
    5. Bus Communication
    6. Summary
  18. 8 MACHINE CODE AND ASSEMBLY LANGUAGE
    1. Software Terms Defined
    2. An Example Machine Instruction
    3. Calculating a Factorial in Machine Code
    4. Summary
    5. Project #12: Factorial in Assembly
    6. Project #13: Examining Machine Code
  19. 9 HIGH-LEVEL PROGRAMMING
    1. High-Level Programming Overview
    2. Introduction to C and Python
    3. Comments
    4. Variables
    5. Stack and Heap Memory
    6. Math
    7. Logic
    8. Program Flow
    9. Functions
    10. Object-Oriented Programming
    11. Compiled or Interpreted
    12. Calculating a Factorial in C
    13. Summary
    14. Project #14: Examine Variables
    15. Project #15: Change the Type of Value Referenced by a Variable in Python
    16. Project #16: Stack or Heap
    17. Project #17: Write a Guessing Game
    18. Project #18: Use a Bank Account Class in Python
    19. Project #19: Factorial in C
  20. 10 OPERATING SYSTEMS
    1. Programming Without an Operating System
    2. Operating Systems Overview
    3. Operating System Families
    4. Kernel Mode and User Mode
    5. Processes
    6. Threads
    7. Virtual Memory
    8. Application Programming Interface (API)
    9. The User Mode Bubble and System Calls
    10. APIs and System Calls
    11. Operating System Software Libraries
    12. Application Binary Interface
    13. Device Drivers
    14. Filesystems
    15. Services and Daemons
    16. Security
    17. Summary
    18. Project #20: Examine Running Processes
    19. Project #21: Create a Thread and Observe It
    20. Project #22: Examine Virtual Memory
    21. Project #23: Try the Operating System API
    22. Project #24: Observe System Calls
    23. Project #25: Use glibc
    24. Project #26: View Loaded Kernel Modules
    25. Project #27: Examine Storage Devices and Filesystems
    26. Project #28: View Services
  21. 11 THE INTERNET
    1. Networking Terms Defined
    2. The Internet Protocol Suite
    3. A Trip Through the Internet
    4. Foundational Internet Capabilities
    5. Networking Is Computing
    6. Summary
    7. Project #29: Examine the Link Layer
    8. Project #30: Examine the Internet Layer
    9. Project #31: Examine Port Usage
    10. Project #32: Trace the Route to a Host on the Internet
    11. Project #33: See Your Leased IP Address
    12. Project #34: Is Your Device’s IP Public or Private?
    13. Project #35: Find Information in DNS
  22. 12 THE WORLD WIDE WEB
    1. Overview of the World Wide Web
    2. The Languages of the Web
    3. Web Browsers
    4. Web Servers
    5. Summary
    6. Project #36: Examine HTTP Traffic
    7. Project #37: Run Your Own Web Server
    8. Project #38: Return HTML from Your Web Server
    9. Project #39: Add CSS to Your Website
    10. Project #40: Add JavaScript to Your Website
  23. 13 MODERN COMPUTING
    1. Apps
    2. Virtualization and Emulation
    3. Cloud Computing
    4. The Deep Web and Dark Web
    5. Bitcoin
    6. Virtual Reality and Augmented Reality
    7. The Internet of Things
    8. Summary
    9. Project #41: Use Python to Control a Vending Machine Circuit
  24. A ANSWERS TO EXERCISES
  25. B RESOURCES
    1. Buying Electronic Components for the Projects
    2. Powering Digital Circuits
    3. Troubleshooting Circuits
    4. Raspberry Pi
  26. INDEX

Product information

  • Title: How Computers Really Work
  • Author(s): Matthew Justice
  • Release date: December 2020
  • Publisher(s): No Starch Press
  • ISBN: 9781718500662