Computers

Computers are at the heart of modern electronics, and can be found in virtually every environment in modern society, from our homes to our cars, offices, and industrial environments. Our phones are highly capable computers, and our televisions, toys, and household appliances increasingly use computers to add features and improve performance and efficiency.

But what are computers and how do they work?

This question can seem daunting to approach, and you could spend lifetimes trying to learn everything needed to *fully* understand computers. For example, the fields of electrical and computer engineering, programming, information technology, materials science, and even physics each offer unique perspectives on how computers actually work. Related fields like robotics, data science, artificial intelligence, and quantum computing also add every day to humankind’s exploration and development of different types and uses of computers.

Of course, these fields collectively represent an overwhelming amount of information. Luckily, having a high-enough level of understanding to use and work in any of these fields doesn’t require being an ‘expert’ in any of them. For example, you can be a programmer without knowing anything about circuits or components. Additionally, you only need to know a relatively small amount of programming to work in IT, cybersecurity, robotics, data science, etc. Each field has specific tools and techniques that need to be learned, but the core knowledge of computers needed to be competent across these fields is relatively low.

There are exceptions to this; for example, low-level programming requires a strong knowledge of how processors and computers work at a relatively low level. But even low-level programmers don’t need to know how transistors work. However, a processor architect probably does.

This website (electronicsreference.com) is largely dedicated to helping people like you understand computers in whatever way is most natural and interesting to you.

For example, let’s look at some basic elements of computers and see how this site may help you in your quest.

  • A computer consists of electric circuits.
  • The most important circuit in a computer is an integrated circuit (IC) called a processor – also called CPU (central processing unit) or microprocessor. Graphics cards used for gaming contain a processor called a GPU (graphics processing unit).
  • Processors consist mainly of semiconductor components called transistors, specifically MOSFETs.
    • Computers today contain millions or billions of transistors, which provide computational power for CPUs and GPUs. Memory (RAM) chips also contain large quantities of transistors, which are used to hold a binary (0 or 1) state.
    • Think about the human brain: our brain cells are capable of both performing many different types of operations, and also storing our memory. Transistors function similarly in computers, providing arithmetic, logic, and control operations, and also storing computer memory.
  • Processors read and execute machine code, which is in binary (0’s and 1’s). However to make it possibly for humans to understand machine code, we can use assembly languages. Assembly is essentially a human-readable version of machine code, allowing us to write programs at the lowest levels.
    • Learning assembly may be the best way to understand how computers work at a low level.
  • Computers wouldn’t be useful without programs, which tell a computer what to do.
    • The majority of programming isn’t done in assembly, but in ‘higher level’ languages like Java, Python, or Rust. These languages are much easier to program in than assembly, and often the ‘higher’ level the language is, the easier it is to program. For example, Python is subjectively easier to program in than Rust, which is much easier to program in than assembly.
    • This ease of use is produced by abstracting away the technical details of programming at lower levels, but it comes with tradeoffs. A lower level language can produce faster, more efficient code, but it takes longer, is harder to debug and secure.
  • Computers are more than just processors, of course. They use input (mouse, keyboard, touchscreen, hard disk, external storage) and output (screen/display, speakers). And they need power, which requires rectifier and filter circuits to perform AC to DC conversion. Screens today contain large numbers of LEDs (light emitting diodes) and capacitors.

Of course, this is just the tip of the iceberg.

Introduction to Modern Computers

  • What is a computer?
  • Analog vs. digital computers
  • Why we use digital computers
  • From Components and Circuits to Modern Computers
  • Basic Computer Architecture
  • An Overview of Computer Components and Hardware
  • The Motherboard
  • CPUs: How the Central Processing Unit Works
  • Random Access Memory (RAM)
  • Graphics Cards
  • Network Interface Cards
  • Computer Power Systems

Number Systems

  • Binary numbers: The heart of digital computers
  • Introduction to binary numbers
  • Binary, decimal, and hexadecimal

Logic Gates

  • Digital logic gates
  • AND Gate
  • OR Gate
  • NOT Gate
  • NAND Gate
  • NOR Gate
  • XOR Gate
  • XNOR Gate

Assembly Programming

  • Assembly Language: The Best Way to Learn How Computers Really Work
  • Getting Started with x64 Assembly Programming

Host and Network Hacking

What is a Computer?

A computer is a machine that performs an operation or calculation.

An early predecessor to the computer is the abacus. Abacus are mostly popular as a children’s toy in the West. However, abacus competitions have become popular in some areas in modern times (particularly India and China), sparking a renewed interest in this ancient tool.

The first computer we have record is probably the Antikythera mechanism, dated between about 205 and 60 BC:

The Antikythera mechanism is the earliest known computer.
Image credit: Nature 2021

Historical Computers

Throughout history, computers have been made with gears, pistons, relays, tubes, punch cards, and lots of precision-made machinery.

In contrast, modern computers are made with circuit boards and high-tech components. In large part, this is thanks to the invention of the semiconductor transistor, which we have been able to make smaller and smaller.

The transistor is the basic element of logic in a computer. It operates like a switch; when the transistor is conducting, we say that the switch is on and assign the value of ‘1’. When we flip the transistor off, we we assign the value of ‘0’. These are the ‘1’s and ‘0’s of binary logic that allow computers to function.

What can we do with a bunch of ‘1’s and ‘0’s? Quite a lot, it turns out. And what we can do depends on how many transistors we have.

Modern computers have hundreds of billions of transistors, so they can do quite a lot.

The Two Types of Computers

There are two types of computers: analog computers and digital computers.

Analog computers use physical characteristics like electrical or mechanical quantities in order to model a problem. In other words, they create a physical representation of the specific problem that they are trying to solve.

Analog computers can be incredibly good at solving one specific problem extremely fast and with excellent precision.

Their only downside is that they aren’t programmable; they can only do the one task that they are designed for.

This is where digital computers come into play, and why they are so popular today.

Digital Computers

Digital computers are more complex than analog computers. Instead of modeling one problem and trying to solve it, a digital computer uses a bunch of transistors that can hold the value of a ‘1’ or a ‘0’. This is called binary.

The magic of this system is that if we’re clever, we can do a lot of things with a bunch of ‘1’s and ‘0’s. We can do complex mathematics and we can create logic gates that allow us to build even more functionality. It turns out that we can do all of things that we want daily use computers to do; text editing, web browsing, video watching, emailing, printing, etc.

Modern Computers

When we say the word ‘computer’ today, what you think of is probably a modern computer, not a historic one.

Modern computers are made of lots of different components that do specific things. You’ve probably heard of a lot of them, like processor/CPU, memory/RAM, storage or disk space, power supply, etc.

Each of these components work together to build a functioning computer that is capable of being programmed to do an infinite number of tasks.

Central Processing Unit (CPU)

The central processing unit (CPU), commonly called processor, is an integrated circuit that executes programs. The CPU is the most important part of the computer; it performs input/out, math, and logical operations in order for programs to run.

Memory

Computers need to be able to store information that can be quickly accessed for use in programs. This is where memory, particularly the different kinds of RAM (random access memory) come into play.

Storage

Not all data needs to be accessed immediately or is needed for a program to run. Storage provides a way to store data for longer periods of time. It also allows us to create more complex sets of programs like operating systems, which are way too big to economically keep in memory. Storage devices include hard disk drives (HDD) as well as newer, faster solid state drives (SSD).

Power Supply

A computer needs power. More than that, it needs a steady source of high quality power that will stay constant and won’t wreak havoc on all of the sensitive components. That’s where the power supply comes in.

Motherboard

The motherboard is a printed circuit board (PCB) that functions as the central hub of data flow in a computer. You can think of the mother board as a circuit board that everything else gets plugged into. The CPU, memory, storage, graphics card, power supply are all connected to the motherboard either directly or with a plug.

Peripheral Devices

A computer doesn’t do any good if you can’t interact with it. That’s where peripheral devices come in. Peripheral devices include input devices like a mouse and keyboard, as well as output devices like a screen, projector, or printer.

Computer Software

So far we’ve covered the physical components of computers; the physical components make up the hardware of the computer system.

Everything that is not physical hardware is classified as software. This includes the programs, data, protocols, and applications that we, as users, interact with on the computer.

Assembly and Machine Code

How does the software actually interact with the hardware?

Computers rely on the concept of abstraction in order to build projects of increasingly greater complexity.

At the lowest level, the processor only has a small number of things that it actually does with data, like move data from one position to another or add two numbers together.

The actual ‘0’s and ‘1’s, called bits, represent the actual machine code that gets processed by the computer.

Instead of having to work with ‘1’s and ‘0’s, processors have an assembly language that gives programmers one layer of abstraction from the machine code. Assembly is relatively readable but still very limited in what it can do by itself because allows programmers to interface directly with the processor.

Other programming languages (such as C) are then built directly on top of the assembly language. Using the relatively small number of operations that we can do in Assembly, we can now do a much larger number of operations with a more complex programming language. The only downside is that we are no longer interfacing directly with hardware.

These days, most programming is done on high level programming languages like Python and JavaScript. These languages have a lot of abstraction between them and the underlying machine code but come packed with features that make them easy to use and useful out of the box for a wide range of tasks.