Computer Basics

Mon Jan 27 2025
Updated: Sat Feb 15 2025
Facebook share linkTwitter/X share linkLinkedIn share linkReddit share linkReddit share link

Computer Basics

Von Neumann Architecture

Most modern computers are based on the Von Neumann architecture first developed by John von Neumann in 1945. The architecture consists of:

  1. Input Devices - Hardware components that allow users to interact with a computer by providing data or control signals for processing. These devices are used to input information into a computer system. Some examples are:
    • Keyboard: For typing text and commands.
    • Mouse: For pointing, clicking, and selecting items on the screen.
    • Touchscreen: For direct interaction with graphical elements by touch.
    • Microphone: For audio input such as voice commands or recording.
    • Scanner: For converting physical documents into digital format.
    • Camera: For capturing images or video.
    • Game Controller: For gaming interactions.
  2. Output Devices - Hardware components that receive data from a computer system and translate it into a form understandable to users. These devices are used to display, project, or produce the results of processing. Some examples are:
    • Monitor: For visual display of text, images, and videos.
    • Printer: For producing physical copies of documents or images.
    • Speakers: For audio output like music or voice.
    • Projector: For displaying visuals on a larger screen.
    • Headphones: For private audio output.
    • Haptic Devices: For physical feedback, like vibrations in a game controller.
  3. Central Processing Unit (CPU) - The primary component of a computer that performs most of the processing operations. It is often referred to as the "brain" of the computer because it executes instructions and processes data necessary to run programs and perform tasks. Some of the CPU key components:
    • Arithmetic Logic Unit (ALU): Arithmetic and logical operations.
    • Registers: Small, high-speed storage locations within the CPU used to hold data temporarily during processing.
  4. Main (Primary) Memory – Random Access Memory (RAM) - Memory that stores data and instructions that the CPU uses during execution. This memory is volatile – memory that loses its content when the power is turned off. The primary focus of RAM is to hold the operating system, application programs, and data currently in use. It does so using:
    • Bits: The binary digits 0 and 1.
    • Memory Cell: The smallest unit of storage in RAM, capable of storing a single bit of data.
    • Address: A unique identifier assigned to each memory cell or a group of cells.
  5. Secondary Memory (Storage) - Storage devices that store data and programs permanently. This memory is non-volatile – memory that retains data without requiring a constant power supply. Some types of storage devices include:
    • Hard Disk Drives (HDD)
    • Solid-State Drives (SSD)
    • Optical Discs (CD/DVD/Blu-ray/etc.)
    • USB Flash Drives
    • Memory Cards

A diagram of the how the components of the Von Neumann Architecture interact with one another follows:

A diagram of the Von Neumann architecture used in computers. Input devices feed into the CPU. The CPU feeds to output devices. The CPU directly interfaces with Main Memory. Main Memory directly interfaces with the CPU and Secondary Memory. Secondary Memory directly interfaces with Main Memory.

This diagram illustrates the Von Neumann Architecture and the interaction between its core components. Input devices and main memory transmit data and instructions to the CPU, which processes the information and sends the results to output devices. The CPU maintains a direct connection with main memory, allowing for efficient data retrieval and execution of instructions. Main memory serves as an intermediary, directly interfacing with both the CPU and secondary memory, facilitating the transfer of data between volatile and non-volatile storage. Additionally, secondary memory communicates directly with main memory, enabling long-term data storage and retrieval as needed.

Central Processing Unit (CPU)

The Central Processing Unit (CPU) is where all instructions are executed. Some examples of the instructions executed in the CPU are arithmetic, logic, and input/output operations. The CPU has a 3 principle components:

  1. The arithmetic logic unit (ALU) which performs arithmetic and logic.

  2. Registers which supply operands (data) to the ALU and store the results of computations from the ALU.

  3. A control unit which controls getting instructions/data from memory, decodes instructions and instructs the ALU on which operations/registers/components to use.

Most modern CPUs come integrated with multiple CPUs on a single chip (each CPU being called a physical core), this is called a multi-core processor. These cores can also be virtually split using software to create multiple virtual cores out of a single physical core, this is called multithreading. Multithreading is mostly common in higher end CPUs, but some lower end CPUs also have multithreading. The two most common brands of CPUs, Intel and AMD, have their own versions of multithreading. Intel has a proprietary version is called hyper-threading. and AMD uses a version called simultaneous multithreading. Lastly, CPUs also have a small memory called cache which can be thought of as intermediate memory between RAM and the CPU for now. A diagram of a single physical core of a CPU follows:

Diagram of a Central Processing Unit (CPU) architecture, illustrating the interaction between the Control Unit, Registers, and Arithmetic Logic Unit (ALU) within the Physical Core. The Control Unit directs data flow, the Registers store temporary values, and the ALU performs arithmetic and logical operations. This CPU structure visualization is essential for understanding computer architecture, processor functionality, and Von Neumann principles.

This diagram illustrates the internal communication within a CPU, highlighting the interactions between its key components. Each physical core contains a Control Unit, which orchestrates the execution of instructions by directing data flow between the Registers and Arithmetic Logic Unit (ALU) (indicated by the red arrows).

The ALU retrieves instructions and data while also transferring computed results into Registers for temporary storage and further processing (denoted by the black arrows). This structured interaction ensures efficient instruction execution and data handling within the processor.

Main Memory (RAM)

Main memory directly holds the instructions and data that programs to be run are comprised of. Main memory is volatile memory that is lost when the computer is shut off. Examples of the types of instructions that are held in main memory are (but not limited to):

  1. Input/output

  2. Arithmetic

  3. Logic

  4. Controlling

These instructions allow programmers to take input in from users, write output to users/for storage/etc., perform arithmetic using data, perform logic using data, and controlling hardware/software. The other thing stored in memory is data. Some examples of data are (but not limited to):

  1. Integers: Whole numbers

  2. Floating-point numbers: Continuous numbers (numbers with a decimal place)

  3. Characters: The values on the keyboard

  4. Strings: 0 or more characters

Modern computers commonly have 2GB, 4GB, 8GB, 16GB, or 32GB of RAM but there are systems that have much much more RAM. Theoretically there is no limit to the amount of RAM a computer can have. To store values RAM stores instructions in bits. Bits are the smallest unit of measurement used to represent computer data and can be the value 0 or 1. In hardware bits are made up of generally 6 transistors which is silicone that can hold either a positive or negative charge. These groupings of transistors will uniformly hold either a negative charge representing a 0 bit or a positive charge representing a 1 bit. More commonly these groupings of transistors/bits will be referred to as memory cells. Memory cells are single electronic circuits that hold one bit of information. Each memory cell has an address to allow it to be called by a program. A memory address is the specific location of a single memory cell. Just like a house has an address that mail can be sent to or can be visited to be checked up on, each memory cell has an address that can be told to turn on or off (written to) or be checked to see if it on or off (read from).

Single cells of memory are sometimes used such as in the case of boolean data, but more commonly cells are grouped together in groups of size = 2^n, n > 2 (i.e. 8, 16, 32, 64, 128). When this is done the address of the first cell in the group of cells is used as the address for the group. These groups of cells can then be used to store the instructions and data the programs are comprised of. A diagram of memory cells and addresses follows:

Single addressed cells of main memory.

Single addressed bytes of main memory.

When the cells are grouped together in this example there are 2 pieces of data that are stored. Memory cell 0x00001 contains the piece of data 10110110 and memory cell 0x0001A contains the piece of data 01101101. If these were say whole numbers that were stored by a program they would translate to memory cell 0x00001 having the number 182 in its cells and memory cell 0x0001A have the number 109 in its cells.

Secondary Memory (HDD/SSD/CD/Etc.)

Secondary memory holds the instructions and data that needs to be retained regardless of power state. Secondary memory is non-volatile memory which is retained when the computer is shut off. When running programs the problem with secondary memory is that it is slow to lookup data compared to main memory. When a program is being run and something is needed from secondary memory it is pulled from secondary memory and stored in main memory so that the CPU can access it much quicker.

Much like main memory secondary holds its data in memory cells called by addresses which can be grouped together to store different sized pieces of data and instructions. Secondary memory comes in many forms. Some examples of secondary memory are hard disk drives (HDD), solid state drives (SSD), compact discs (CD), floppy disks, flash drives, etc.

Input Devices

To receive input the CPU relies on input devices. There are many types of input devices. The first two input devices that will probably come to mind are the keyboard and mouse. The keyboard allows for characters to be entered into the computer, and the mouse allows for point-and-click input. A lesser thought of input devices is memory. Memory is considered an input device because memory inputs data and instructions into the CPU.

Output Devices

To show that the CPU is actually doing anything it needs to be able to write output to output devices. The most common output device is the display or monitor of a computer. Other common output devices include the speakers, printers, and even memory. Memory can also be thought of as an output device because the CPU is able to run instructions that outputs instructions and data to memory.

System BUS

For all of these systems to communicate there has to be something to connect them together, this is what the System BUS is for. The system BUS connects the major components of a computer system. In the Von Neumann Architecture there is a single BUS shared between all the components which is a severe bottleneck as only one component may talk to another at a time. This bottleneck is solved in modern computers with different BUS's being used by the different components.

Language of Computers

Computers operate in a digital format, meaning that the signals they process are represented as either "on" or "off," which are called bits. At their most fundamental level, bits are the only form of data that a computer can understand and process. Within the Von Neumann architecture, the various components communicate with one another by sending and receiving bits. However, single bits are limited in usefulness, so they are typically grouped together into larger units, with the most common grouping being 8 bits, known as a byte. Some other typical arrangements of bits primarily used in memory are:

UnitSymbolBits/Bytes
ByteB8 bits
KilobyteKB1024 bytes
MegabyteMB1,048,576 bytes
GigabyteGB1,073,741,824 bytes
TerabyteTB1,099,511,627,776 bytes
PetabytePB1,125,899,906,842,624 bytes
ExabyteEB1,152,921,504,606,846,976 bytes
ZettabyteZB1,180,591,620,717,411,303,424 bytes

Two commonly used groupings of bits in modern computing are 32-bit instructions and 64-bit instructions, which refer to the length of instructions that a computer can process at one time. Earlier systems typically used 32-bit instructions, but most modern computers now standardize on 64-bit instructions to allow for greater processing power and the ability to address larger amounts of memory. Data, like instructions, is also grouped into specific bit arrangements, which are closely tied to data types. These groupings of bits—whether instructions or data—form the basis of machine language, a computer-readable language composed entirely of 0s and 1s. Programs written in machine language are called machine code -- binary code executed by the CPU.

Although machine language is the fundamental way computers operate, it is highly complex and difficult for humans to understand without specialized knowledge. To make programming more accessible, we use high-level programming languages, which abstract away the intricate details of how the computer handles bits and machine code. These abstractions allow programmers to focus on solving problems and writing logical instructions. Programs written in a high-level language are called source code.

Note: Since there are 2 values for bits, the arrangements of them are typically in powers of 2.

Terms

  1. Input Devices - Hardware components that allow users to interact with a computer by providing data or control signals for processing.

  2. Output Devices - Hardware components that receive data from a computer system and translate it into a form understandable to users.

  3. Central Processing Unit (CPU) - - The primary component of a computer that performs most of the processing operations.

  4. Main (Primary) Memory (RAM) - Memory that stores data and instructions that the CPU uses during execution.

  5. Secondary Memory (Storage) - Storage devices that store data and programs permanently.

  6. Volatile – Memory that loses its content when the power is turned off.

  7. Non-Volatile – Memory that retains data without requiring a constant power supply.

  8. System BUS - Connects the major components of a computer system.

  9. Bit - The smallest unit of measurement used to represent computer data and can be the value 0 or 1.

  10. Memory Cell - Single electronic circuits that hold one bit of information.

  11. Memory Address - The specific location of a single memory cell.

  12. Machine Language - A computer-readable language composed entirely of 0s and 1s.

  13. High Level Language - A programming language which abstracts away the intricate details of how the computer handles bits and machine code.

  14. Machine Code - Binary code executed by the CPU.

Questions

Von Neumann Architecture

  1. What is the Von Neumann architecture, and who developed it?

  2. What are the main components of the Von Neumann architecture?

  3. How do input devices interact with the CPU in the Von Neumann architecture?

  4. What role does main memory play in the Von Neumann architecture?

  5. How does secondary memory interface with main memory and the CPU?

  6. What is the major bottleneck in the Von Neumann architecture, and how do modern computers address this issue?

Input Devices

  1. What are input devices, and why are they important in a computer system?

  2. List and describe at least five input devices.

  3. Why is memory considered an input device?

Output Devices

  1. What are output devices, and why are they important in a computer system?

  2. List and describe at least five output devices.

  3. Why is memory considered an output device?

Central Processing Unit (CPU)

  1. What is the function of the CPU in a computer system?

  2. What are the three main components of the CPU, and what does each do?

  3. What is the Arithmetic Logic Unit (ALU), and what operations does it perform?

  4. How do registers assist in CPU operations?

  5. What is the control unit, and what role does it play in instruction execution?

  6. What is a multi-core processor, and how does it improve performance?

  7. What is the difference between physical cores and virtual cores?

  8. What is hardware multithreading, and how does it benefit processing?

Main (Primary) Memory – Random Access Memory (RAM)

  1. What is the purpose of RAM in a computer system?

  2. Why is RAM considered volatile memory?

  3. What types of data and instructions are stored in RAM?

  4. What are bits, and how are they used in memory storage?

  5. What is a memory cell, and what does it store?

  6. What is a memory address, and how does it function in RAM?

  7. How are multiple memory cells grouped together, and why?

  8. What hardware components make up a bit in memory?

  9. How do transistors store binary values in RAM?

  10. Why are memory addresses important in computer programming?

Secondary Memory (Storage)

  1. What is secondary memory, and how does it differ from primary memory?

  2. Why is secondary memory considered non-volatile?

  3. What is the main disadvantage of secondary memory compared to RAM?

  4. How does data move between secondary memory and RAM?

  5. List and describe at least five types of secondary storage devices.

System BUS

  1. What is the system BUS, and what role does it play in a computer system?

  2. Why is the single system BUS a bottleneck in the Von Neumann architecture?

  3. How do modern computers mitigate the limitations of a shared system BUS?

Language of Computers

  1. What is a bit?

  2. What is a byte, and how many bits does it contain?

  3. What are some common groupings of bits in memory, and what are their sizes?

  4. What is the difference between 32-bit and 64-bit instructions?

  5. How do bits and bytes form machine language?

  6. What is machine code, and how does it differ from high-level programming languages?

  7. What are the advantages of high-level programming languages over machine code?

  8. Why do high-level programming languages exist if computers only understand machine code?

  9. What is the role of source code in computer programming?

  10. Why are memory and data arrangements typically in powers of 2?