Associate CET · Competency 15.0

Computer Electronics

Underneath every computer is the same handful of building blocks: a processor that executes instructions, memory that holds data and programs, buses that move information between them, and a clock that keeps everything in step. This covers the hardware architecture — the counterpart to the Computer Applications page, which covers ports, networking, and software. It also covers block diagrams and flow charts, programmable logic controllers, programming concepts and computer languages, and peripherals and the interface cards and chips that connect them.

Competency
15.0
Sections
11 + self-check
Then
Drill comp 15

The processor (CPU / MPU)

The CPU (Central Processing Unit) — the microprocessor when built on one chip — is the brain that fetches, decodes, and executes instructions. Inside it are three core sections: the ALU (Arithmetic Logic Unit) that does the math and logic, the control unit that sequences operations, and a set of registers — tiny fast storage cells for the data being worked on right now.

The CPU runs a relentless fetch–decode–execute cycle: fetch the next instruction from memory, decode what it means, execute it, repeat — billions of times a second.

Counting input and output separately gives the five classic functional sections of a computer: input, output, memory, control and the arithmetic/logic unit (Wikipedia, Computer, groups input and output together as I/O). Two registers keep the cycle on track: the program counter holds the memory address of the next instruction to fetch, and the instruction register holds the instruction being decoded and executed (Wikipedia, Program counter).

CPUALU · controlregisters
    • address bus
    MemoryRAM / ROM
    • data bus
    • control bus
    I/Oports / devices
A computer's core: the CPU exchanges addresses, data, and control signals with memory and I/O over the system bus.

The system bus

The CPU connects to memory and I/O through the system bus — a set of parallel lines, traditionally grouped into three:

Address bus
Carries the location the CPU wants to read or write. Its width sets how much memory can be addressed — n lines = 2ⁿ locations. One-way (CPU → memory).
Data bus
Carries the actual data to/from that location. Bidirectional. Its width (8/16/32/64 bits) is a big factor in how much data moves per cycle.
Control bus
Carries timing and command signals — read, write, clock, interrupt, reset — that coordinate who uses the bus and when.

On the exam

Key relationship: the address bus width determines the maximum addressable memory. A 16-line address bus can address 2¹⁶ = 65,536 locations (64K); a 20-line bus reaches 1 MB. The data bus width sets how many bits move at once.

The clock & timing

Everything in a synchronous computer marches to a clock — a steady square-wave from a crystal oscillator that synchronizes every operation. Each tick steps the processor through its cycle. Clock speed (in MHz/GHz) is roughly how many cycles run per second — higher generally means more instructions per second, though architecture matters too.

Worked example

Period ↔ frequency: clock period and frequency are inverses — T = 1/f. A 4 MHz clock has a period of 250 ns. The crystal's stability comes from the piezoelectric effect: quartz flexes when a voltage is applied and makes a voltage when flexed, so it rings at one precise frequency (see the RF guide's transmitter section).

Memory types

TypeCharacteristics
RAMRandom Access Memory — fast read/write working memory, but volatile (contents lost when power is removed). Holds running programs and data.
ROMRead Only Memory — non-volatile, permanent storage that survives power-off. Holds firmware/boot code. Generally not changed in normal operation.
CacheSmall, very fast RAM close to the CPU that holds recently-used data to avoid slower main-memory fetches.
Flash / EEPROMNon-volatile but electrically rewritable — the middle ground used for BIOS, SSDs, and firmware updates.

On the exam

Exam staple: permanent, non-volatile, non-removable storage in a computer is ROM. RAM is the volatile working memory that loses its contents when powered down.

Data representation

Computers represent everything — numbers, characters, instructions — as combinations of 0s and 1s (binary). A single 0/1 is a bit; 8 bits make a byte, which can represent 2⁸ = 256 distinct values. Characters are encoded in schemes like ASCII.

On the exam

Exam numbers: a byte = 8 bits; an 8-bit code gives 256 combinations.
ToolPractice base conversions in the Binary Converter and gate logic in Digital / Logic.

Microprocessor vs. microcontroller

Microprocessor (MPU)

Just the CPU on a chip. Needs external memory, I/O, and support chips to form a working system. Used where flexibility and high performance matter — PCs, servers.

Microcontroller (MCU)

A whole computer on one chip — CPU plus RAM, ROM/flash, and I/O built in. Cheap, compact, low-power; runs the embedded devices a technician services everywhere.

Block diagrams and flow charts

Competency 15.2 asks you to differentiate how the computer block diagram and flow charts are used. The two drawings answer different questions. A block diagram shows a system's principal parts as blocks, joined by lines that show how the blocks relate; the CPU, memory, I/O and buses in section 1 are one. It leaves out the circuit detail on purpose, and that makes it the map for hardware troubleshooting: it narrows a fault down to one block before you open the schematic for that block (Wikipedia, Block diagram). A flow chart shows a process: the steps of a program or a procedure in the order they happen, and the decisions that send it down one path or another. It is used to analyze, design, document and follow a program or process (Wikipedia, Flowchart).

QuestionBlock diagramFlow chart
What does it show?The parts of a system (hardware or functions) and what connects to what.The steps and decisions of a program or procedure, in order.
What does a line mean?A connection between blocks, such as a bus, a signal or power.The order of operations: which step comes next.
What is it used for?Understanding how a computer is organized, and isolating a hardware fault to one block.Planning and documenting a program, and following a test or troubleshooting procedure step by step.

Flow-chart symbols are standardized in ISO 5807, Documentation symbols and conventions for data, program and system flowcharts. The ones you will meet most are these (Wikipedia, Flowchart):

SymbolShapeMeaning
TerminalRounded rectangle (oval)The start or end of a program or procedure.
ProcessRectangleAn operation, such as a calculation or an action.
DecisionDiamondA yes-or-no test that chooses one of two paths.
Input/outputParallelogramData received or sent, such as reading a sensor or printing a result.
FlowlineLine with an arrowheadThe order of the steps.
ConnectorSmall circle with a letterJoins two parts of the chart without a long line.

Section 2 of the Technician Procedures guide covers using flow diagrams for work and troubleshooting procedures (competency 6.9).

On the exam

Block diagram vs. flow chart: a block diagram shows what connects to what and is used to isolate a hardware fault to a block; a flow chart shows the steps and decisions of a program or procedure in order, and its diamond is a decision.

Trap

The lines mean different things. On a block diagram a line is a connection that carries a signal, data or power; on a flow chart an arrow only says which step comes next.

Programmable logic controllers (PLCs)

Competency 15.5 asks you to explain programmable logic controllers and list their uses. A programmable logic controller (PLC) is an industrial computer that has been ruggedized: built to tolerate dust, moisture, heat and cold, with immunity to electrical noise and resistance to vibration and impact. PLCs came from car manufacturing. In 1968 General Motors' Hydramatic division asked for an electronic replacement for hard-wired relay control systems, which were hard to change whenever the process changed; the first PLC, the Modicon 084, followed in 1969. Changing the process became a matter of changing the program instead of rewiring relays (Wikipedia, Programmable logic controller).

PartWhat it does
Input modulesRead the field devices: discrete (on/off) signals such as limit switches, and analog signals such as temperature and pressure from process sensors.
ProcessorRuns the stored program that decides what each output should be.
Output modulesDrive the loads: indicator lamps and sirens, relays, electric motors, solenoids, pneumatic or hydraulic cylinders, and analog outputs.
Programming deviceThe maker's software on a personal computer, a desktop console or a handheld unit, used to write the program and load it into the PLC.

A PLC runs its program in a repeating scan: read the inputs, execute the program, write the outputs, then start again. One scan typically takes tens of milliseconds, and a PLC is a hard real-time system: it must respond within a set time. The original PLC language is ladder logic, which strongly resembles a relay-logic schematic, so it reads like the relay panels it replaced. The IEC 61131-3 standard adds function block diagram, sequential function chart and structured text. PLCs control manufacturing processes such as assembly lines, machines and robotic devices (Wikipedia, Programmable logic controller).

On the exam

PLC: a ruggedized industrial computer that replaced hard-wired relay logic; it scans continuously (read the inputs, run the program, write the outputs), is usually programmed in ladder logic, and controls machines, assembly lines and other processes.

Basic programming concepts

Competency 15.6 asks you to describe basic programming concepts. A program is a list of instructions that the computer carries out in order. It usually takes input, processes it and produces output, and it keeps the values it is working on in variables: named storage locations whose value can change while the program runs (Wikipedia, Variable). Any program, however large, can be built from just three control structures, as Böhm and Jacopini showed in 1966 (Wikipedia, Structured program theorem):

StructureWhat it doesIn a flow chartOn an Arduino
SequenceRuns one step, then the next.Process boxes in a line.setup() running pinMode, then the next statement.
Selection (decision)Runs one of two paths, chosen by a true-or-false test.A decision diamond.An if/else test on a digitalRead.
Iteration (loop)Repeats a block while a test stays true.A flowline back up to an earlier step.loop(), which runs over and over.

Writing a program is a cycle. Edit the source code; translate it into machine code by compiling or assembling it (section 10); load it into the target's memory (an Arduino upload, in the Digital Electronics guide's section 10, writes it into the microcontroller); then test and debug it. Debugging is finding the root cause of a fault (a bug) and fixing it, with tools such as breakpoints that pause the program, stepping through it one step at a time, and printing the values of variables (Wikipedia, Debugging). A flow chart (section 7) is a common way to plan the steps before writing the code.

Worked example

Tracing a loop: start with total = 0 and count = 0. While count < 3, add 2 to total and 1 to count. Pass 1 leaves total = 2, count = 1; pass 2, total = 4, count = 2; pass 3, total = 6, count = 3. Now the test 3 < 3 is false, so the loop ends after three passes with total = 6. Sequence (the two additions), selection (the test) and iteration (the repeat) are all in these few lines.

On the exam

Programming concepts: a program is a list of instructions run in order; variables hold values that can change; every program is built from sequence, selection (an if/else decision) and iteration (a loop); you edit, compile, load, then test and debug.

Computer languages and how they relate

Competency 15.7 asks you to describe the reasons for different computer languages and their relationships. A CPU runs only machine code: each instruction is a pattern of bits from that processor's instruction set, and instruction sets differ between CPU families (Wikipedia, Machine code). Every other language is translated down to machine code before or while it runs.

LevelWhat it isHow it reaches the CPU
Machine codeBinary instruction patterns for one CPU family.The CPU runs it directly.
Assembly languageMnemonics such as MOV, usually one statement per machine instruction; specific to one processor architecture (Wikipedia, Assembly language).An assembler converts it into machine code.
Compiled high-level language, such as CReadable statements, each of which may become many machine instructions.A compiler translates the whole program into an executable before it runs (Wikipedia, Compiler).
Interpreted language, such as BASIC or PythonReadable statements, run without first being compiled to machine code.An interpreter executes the source as it goes: slower to run, but a shorter edit-and-run cycle (Wikipedia, Interpreter).
Ladder logic and the other IEC 61131-3 languagesLanguages for PLCs (section 8); ladder logic looks like a relay schematic.The PLC maker's software loads the program into the PLC.

Why so many languages? The levels trade closeness to the hardware for convenience. Machine code and assembly work instruction by instruction on one processor, which ties the program to that architecture; high-level languages are easier to read and write and are portable between machines, because a compiler or interpreter does the translation for each one (Wikipedia, Assembly language). Others are built for one job, such as ladder logic for machine control.

On the exam

Languages: machine code is the binary the CPU runs; assembly uses mnemonics that an assembler turns into machine code, roughly one for one; a compiler translates a whole high-level program before it runs, while an interpreter executes the source directly.

Trap

Assembly is not portable. Each assembly language belongs to one processor architecture, so an assembly program written for one CPU family does not run on another; a high-level program can be recompiled for each.

Peripherals and interface devices

Competency 15.8 asks you to define a peripheral and list various types; 15.9 asks you to explain the reasons for using interface devices, chips and cards and name common types. A peripheral is an auxiliary device that the computer uses to move information in or out. It is controlled by the computer but is not one of its core components, the CPU and memory (Wikipedia, Peripheral).

TypeExamples
InputKeyboard, mouse, scanner, microphone, webcam, game controller.
OutputMonitor, printer, speakers, headphones.
Storage and two-way devicesExternal disk drives and SSDs, USB flash drives, memory cards and tape drives, which both store and return data; modems and network adapters, which both send and receive.

Most peripherals cannot connect to the CPU's bus directly: the bus carries parallel data at its own levels and timing, while a printer, a network or an instrument expects its own standard. An interface device sits between them and converts one to the other. On a PC it is often an expansion card, a circuit board plugged into a motherboard slot (PCI, or today PCI Express) to add an interface or a function the motherboard lacks (Wikipedia, Expansion card). The same circuit is often built onto the motherboard instead, as most network interfaces now are.

Interface deviceWhat it connects, and how
Network interface card (NIC)Connects the computer to a network; most newer computers have one built into the motherboard, or use a USB adapter. It carries a factory-assigned MAC address (Wikipedia, Network interface controller).
Video (graphics) cardDrives the display.
Sound cardAudio in and out.
UARTA chip, or a block inside a microcontroller, whose shift register converts between the bus's parallel data and asynchronous serial; a separate driver chip sets the RS-232 or RS-485 line levels (Wikipedia, UART; the Interfacing guide's section 9).
Storage controllerConnects disk drives; the original IBM PC needed a hard disk controller card for one.
Data acquisition cardSamples analog signals for measurement and process control, through an analog-to-digital converter (Computer Applications, section 7).

On the exam

Peripherals and interfaces: a peripheral is an auxiliary input, output or storage device outside the CPU and memory; an interface device (a NIC, video or sound card, UART or storage controller) converts the computer's bus to the standard an external device expects.

Check yourself

Answer in your head first, then reveal.

  1. What determines the maximum amount of memory a CPU can address?

    the address bus width determines the maximum addressable memory

  2. Which section of the CPU does the math and logic?

    the ALU (Arithmetic Logic Unit) that does the math and logic

  3. Is the data bus one-way or bidirectional?

    Carries the actual data to/from that location. Bidirectional.

  4. What is the period of a 4 MHz clock?

    A 4 MHz clock has a period of 250 ns.

  5. What does a microcontroller have that a microprocessor does not?

    A whole computer on one chip — CPU plus RAM, ROM/flash, and I/O built in.

  6. How is a block diagram used differently from a flow chart?

    a block diagram shows what connects to what and is used to isolate a hardware fault to a block; a flow chart shows the steps and decisions of a program or procedure in order, and its diamond is a decision

  7. What does a PLC do in each scan?

    read the inputs, execute the program, write the outputs, then start again

  8. What are the three basic control structures of a program?

    every program is built from sequence, selection (an if/else decision) and iteration (a loop)

Practice this topic: Computer Electronics questions are in the Study Hub quiz bank, number systems are in the Binary Converter, and ports/networking are on the Computer Applications page.