About

1.1 Computer Organization vs. Architecture & Components

Theory: Computer Organization vs. Architecture & Components

This course is about what is inside a computer and how it runs programs. Before looking at any circuit or instruction, we need two words that are used throughout the subject (Null & Lobur, Ch. 1): organization and architecture. We then look at the three basic parts every computer has, and finish by learning to read a computer advertisement, which is full of units (GHz, GB, ns, …) that the rest of the course explains.

Computer Organization vs. Computer Architecture

Intuition. Think of a car. The driver sees a steering wheel, pedals and a gear stick: that is the interface they program the car through. The mechanic sees the engine, the fuel injection and the wiring that make those controls actually work. Two cars can have the same controls (same “architecture”) but completely different engines (different “organization”).

Computer organizationComputer architecture
What it coversAll the physical aspects of the computer systemThe logical aspects of the system as seen by the programmer
Typical examplesCircuit design, control signals, memory types (SRAM, DRAM), bus design, clock rate, how a multiplier is builtInstruction set, instruction formats, data types, addressing modes, number of programmer-visible registers
Question it answersHow does each component work, and how are the components connected to one another?What can the machine do, i.e. how do the components work together to perform tasks (programs)?
Who cares mostHardware designers / engineersProgrammers, compiler and OS writers

A handy test: “Would a programmer writing a correct program need to know this?” If yes, it is architecture. If the program would run exactly the same and only the speed, cost or physical build changes, it is organization.

Same architecture, different organization is very common. Every x86-64 processor from Intel and AMD runs the same machine programs (same architecture), yet the chips inside are built very differently (different organization). That is why you can install the same Windows on either one.

Mini-example

“Does the computer have a multiply instruction?” → architecture (the programmer can use it or not). “Is multiplication done by a fast dedicated multiplier circuit or by repeated shift-and-add?” → organization (the program is the same; only the speed differs).

The Lecture’s Mac and Windows Examples

The lecture applies the same split to two whole systems. Here the word “architecture” is used in a broader sense: the logical platform that software and users see (operating system design, file system, services), as opposed to the physical hardware.

macOS (Apple)Windows (Microsoft)
Organization (physical)Apple M1 chip, Thunderbolt ports, Retina displayIntel or AMD processors, various motherboard types, USB peripherals
Architecture (logical, as seen by software/users)Unix-based system, APFS file system, integration with iCloud and Apple services (incl. App Store)Windows NT-based system, NTFS file system, Microsoft services such as OneDrive and Office 365

Mini-example

A Windows laptop is upgraded from an Intel motherboard to an AMD motherboard, and NTFS and OneDrive still work exactly as before. Only the organization changed; the architecture the software sees is the same.

The Three Basic Components of a Computer

At the most basic level, a computer is a device consisting of three components:

  1. A processor (CPU) to interpret and execute programs.
  2. A memory to store both data and programs.
  3. A mechanism for transferring data to and from the various components, including devices outside the computer: the input/output (I/O) system (and the buses that connect everything).

Diagram loads as you scroll.

Notice that memory stores both data and programs. Keeping the program in memory (instead of in wiring) is the stored-program concept, the core idea of the von Neumann model in section 1.3.

Mini-example

Classify: hard disk → I/O (a storage device outside main memory, reached through the I/O system); RAM → memory; the ALU and registers → processor; USB port → I/O (transfer mechanism).

Reading a Computer Advertisement

Null & Lobur open the book with an advertisement like this one (the lecture shows it next to a present-day mini-PC spec sheet, which uses the same vocabulary):

FOR SALE: OBSOLETE COMPUTER - CHEAP! CHEAP! CHEAP!
 * Intel i7 Quad Core, 3.9GHz
 * 1600MHz 32GB DDR3 SDRAM
 * 128KB L1 cache, 2MB L2 cache
 * 1TB SATA hard drive (7200 RPM)
 * 10 USB ports, 1 serial port, 4 PCI expansion slots
   (1 PCI, 1 PCIx16, 2 PCIx1), Bluetooth, and HDMI
 * 24" widescreen LCD monitor, 16:10 aspect ratio,
   1920x1200 WUXGA, 300 cd/m2, active matrix, 1000:1 (static),
   8ms, 24-bit color (16.7 million colors), VGA/DVI input, 2 USB ports
 * 16x CD/DVD +/- RW drive
 * 1GB PCIe video card
 * PCIe sound card
 * Integrated 10/100/1000 Ethernet

Every line maps onto one of the three components:

Ad lineComponentMeaning
Intel i7 Quad Core, 3.9 GHzProcessor4 independent processing cores on one chip; the system clock ticks 3.9×1093.9 \times 10^9 times per second
1600 MHz 32 GB DDR3 SDRAMMemory32 GB of main memory (RAM). SDRAM = synchronous dynamic RAM; DDR3 = 3rd generation “double data rate” (transfers on both clock edges); 1600 MHz = memory bus speed
128 KB L1 cache, 2 MB L2 cacheMemory (inside/next to the CPU)Small, very fast memories that hold copies of recently used data so the CPU does not wait for slow RAM. L1 is closest/fastest/smallest, L2 is bigger and slower
1 TB SATA hard drive (7200 RPM)I/O (storage)1 terabyte of permanent storage on spinning platters (7200 revolutions per minute) attached via the SATA interface
USB, serial, PCI/PCIe slots, Bluetooth, HDMII/O (transfer mechanisms)Ports connect external devices; expansion slots (PCI, PCI Express) are connectors on the motherboard’s bus for adding cards
LCD monitor … 8 ms, 24-bit colorI/O (output)Display; 8 ms = response time; 24 bits per pixel → 224=16,777,2162^{24} = 16{,}777{,}216 colors
1 GB PCIe video card, PCIe sound cardI/OAdd-on cards in PCIe slots; the video card has its own 1 GB memory
10/100/1000 EthernetI/O (network)Network interface that can run at 10, 100 or 1000 megabits per second

Bus = a set of wires shared by components to move data, addresses and control signals. Port = a connector through which an external device plugs into a bus (USB, HDMI, serial). Cache = a small fast memory holding copies of frequently used data. Hertz (Hz) = cycles per second, a measure of clock rate (speed).

Units and Prefixes

Computers measure three kinds of quantities, and the prefixes mean different things depending on the quantity:

PrefixSymbolPower of 10Power of 2Power of 2 (exact value)
KiloK10310^32102^{10}1,0241{,}024
MegaM10610^62202^{20}1,048,5761{,}048{,}576
GigaG10910^92302^{30}1,073,741,8241{,}073{,}741{,}824
TeraT101210^{12}2402^{40}1,099,511,627,7761{,}099{,}511{,}627{,}776
PetaP101510^{15}2502^{50}≈1.126×1015\approx 1.126 \times 10^{15}

Rule of thumb (Null & Lobur):

To remove the ambiguity, the IEC defined binary prefixes KiB, MiB, GiB, TiB (kibi-, mebi-, gibi-, tebibyte) for 210,220,230,2402^{10}, 2^{20}, 2^{30}, 2^{40}. Many operating systems still display GiB values with the label “GB”, which is why a “1 TB” drive shows up as about 931 GB.

Small quantities (time, mostly) always use powers of 10:

PrefixSymbolValueTypical use
millim10−310^{-3} (one thousandth)disk access and display response times (ms)
microµ10−610^{-6} (one millionth)old transistor switching times, I/O timings (µs)
nanon10−910^{-9} (one billionth)CPU clock cycles, RAM access (ns)
picop10−1210^{-12} (one trillionth)gate delays (ps)

Byte and bit: 1 byte (B) = 8 bits (b). Storage uses capital B, network speeds use lowercase b (Mbps = megabits per second).

Frequency ↔ time: a clock of frequency ff ticks once every T=1fT = \dfrac{1}{f} seconds. So 1 MHz → 1 µs, 1 GHz → 1 ns.

Mini-example

A 2 GHz clock: T=12×109=0.5×10−9T = \dfrac{1}{2 \times 10^9} = 0.5 \times 10^{-9} s =0.5= 0.5 ns. A memory of 4 GB holds 4×230=22×230=232=4,294,967,2964 \times 2^{30} = 2^{2} \times 2^{30} = 2^{32} = 4{,}294{,}967{,}296 bytes.


Worked Examples

Exercise 1

Classify each item as an issue of computer organization or computer architecture:

(a) the instruction set of the CPU; (b) the type of RAM chips (DDR3 vs DDR4); (c) the addressing modes available to the programmer; (d) the control signals that move data between registers; (e) the data types the instructions support (e.g. 16-bit two’s-complement integers); (f) the clock speed; (g) whether the machine has a “multiply” instruction; (h) whether multiplication is done by a dedicated circuit or by shift-and-add.

Show solution ↓
Solution

Apply the test: does a programmer need to know it to write a correct program?

ItemClassificationReason
(a) instruction setArchitectureIt is exactly what the programmer writes programs with
(b) RAM chip typeOrganizationPhysical memory technology; programs run unchanged
(c) addressing modesArchitectureProgrammer chooses how operands are addressed
(d) control signalsOrganizationInternal hardware timing, invisible to the program
(e) data typesArchitectureProgrammer must know how numbers are represented
(f) clock speedOrganizationChanges only how fast the program runs
(g) has a multiply instructionArchitectureProgrammer can (or cannot) use it
(h) how multiply is builtOrganizationSame result, only speed/cost differ

Architecture: (a), (c), (e), (g). Organization: (b), (d), (f), (h).

Exercise 2

The advertised computer has a 3.9 GHz processor and 1600 MHz memory.

(a) How long is one processor clock cycle, in nanoseconds? (b) How long is one memory bus cycle? (c) Roughly how many processor cycles pass during one memory bus cycle?

Show solution ↓
Solution

Frequencies use powers of 10, and T=1/fT = 1/f.

(a)

TCPU=13.9×109 Hz=0.2564×10−9 s≈0.256 nsT_{CPU} = \frac{1}{3.9 \times 10^9\ \text{Hz}} = 0.2564 \times 10^{-9}\ \text{s} \approx 0.256\ \text{ns}

(b)

Tmem=11600×106 Hz=11.6×109=0.625×10−9 s=0.625 nsT_{mem} = \frac{1}{1600 \times 10^6\ \text{Hz}} = \frac{1}{1.6 \times 10^9} = 0.625 \times 10^{-9}\ \text{s} = 0.625\ \text{ns}

(c)

TmemTCPU=0.6250.2564≈2.44(equivalently 3900 MHz1600 MHz=2.4375)\frac{T_{mem}}{T_{CPU}} = \frac{0.625}{0.2564} \approx 2.44 \quad \left(\text{equivalently } \tfrac{3900\ \text{MHz}}{1600\ \text{MHz}} = 2.4375\right)

So the processor goes through about 2.4 cycles for every memory bus cycle. Real RAM needs many bus cycles per access, so the CPU would wait a lot. This is exactly why the ad also lists cache: small fast memory that keeps the CPU supplied.

Check: 0.256 ns×3.9×109≈10.256\ \text{ns} \times 3.9 \times 10^9 \approx 1 s ✓.

Exercise 3

The ad lists 32 GB of RAM, a 128 KB L1 cache and a 2 MB L2 cache.

(a) Give each size exactly in bytes as a power of 2 and as a number. (b) How many times larger is L2 than L1? (c) How many times larger is main memory than the L2 cache?

Show solution ↓
Solution

Memory sizes use powers of 2: K = 2102^{10}, M = 2202^{20}, G = 2302^{30}.

(a)

  • L1: 128 KB=27×210=217=131,072128\ \text{KB} = 2^7 \times 2^{10} = 2^{17} = 131{,}072 bytes
  • L2: 2 MB=21×220=221=2,097,1522\ \text{MB} = 2^1 \times 2^{20} = 2^{21} = 2{,}097{,}152 bytes
  • RAM: 32 GB=25×230=235=34,359,738,36832\ \text{GB} = 2^5 \times 2^{30} = 2^{35} = 34{,}359{,}738{,}368 bytes

(b) 221217=24=16\dfrac{2^{21}}{2^{17}} = 2^{4} = 16 → L2 is 16 times larger than L1.

(c) 235221=214=16,384\dfrac{2^{35}}{2^{21}} = 2^{14} = 16{,}384 → main memory is 16,384 times larger than L2.

Check (b): 16×131,072=2,097,15216 \times 131{,}072 = 2{,}097{,}152 ✓.

Exercise 4

A customer installs the advertised 1 TB hard drive, but the operating system reports its capacity as only about “931 GB”. Explain the difference with a calculation.

Show solution ↓
Solution

The drive maker uses powers of 10 for disk capacity:

1 TB=1012=1,000,000,000,000 bytes1\ \text{TB} = 10^{12} = 1{,}000{,}000{,}000{,}000\ \text{bytes}

The operating system divides by powers of 2 (1 GiB=230=1,073,741,8241\ \text{GiB} = 2^{30} = 1{,}073{,}741{,}824 bytes) but labels the result “GB”:

1012230=1,000,000,000,0001,073,741,824≈931.3 GiB\frac{10^{12}}{2^{30}} = \frac{1{,}000{,}000{,}000{,}000}{1{,}073{,}741{,}824} \approx 931.3\ \text{GiB}

Nothing is missing: the same number of bytes is just measured with a larger unit. In tebibytes: 1012/240≈0.90910^{12} / 2^{40} \approx 0.909 TiB.

Check: 931.3×1,073,741,824≈1.0000×1012931.3 \times 1{,}073{,}741{,}824 \approx 1.0000 \times 10^{12} ✓.

Exercise 5

(a) The hard drive spins at 7200 RPM. How long does one revolution take, in milliseconds? What is the average rotational delay (half a revolution)? (b) The monitor’s response time is 8 ms. How many clock cycles of the 3.9 GHz processor pass in 8 ms? (c) Express 8 ms in µs and in ns.

Show solution ↓
Solution

(a) Revolutions per second: 7200/60=1207200 / 60 = 120 rev/s. Time per revolution:

1120 s=0.008333 s=8.33 ms\frac{1}{120}\ \text{s} = 0.008333\ \text{s} = 8.33\ \text{ms}

Average rotational delay =12×8.33=4.17= \tfrac{1}{2} \times 8.33 = 4.17 ms.

(b)

8×10−3 s×3.9×109 cycles/s=31.2×106=31,200,000 cycles8 \times 10^{-3}\ \text{s} \times 3.9 \times 10^{9}\ \text{cycles/s} = 31.2 \times 10^{6} = 31{,}200{,}000\ \text{cycles}

(c) 8 ms=8×10−3 s=8,000×10−6 s=8,000 μs=8,000,000 ns8\ \text{ms} = 8 \times 10^{-3}\ \text{s} = 8{,}000 \times 10^{-6}\ \text{s} = 8{,}000\ \mu\text{s} = 8{,}000{,}000\ \text{ns}.

Moral: mechanical and display devices work in milliseconds, the CPU works in fractions of a nanosecond, so a millisecond is millions of CPU cycles. This speed gap drives the design of memory hierarchies and I/O systems later in the course.

Exercise 6

The monitor is 1920 × 1200 pixels with 24-bit color.

(a) How many different colors can each pixel show? (b) How many bytes of video memory are needed to hold one full screen image? Give the answer in bytes and in MB (binary). (c) Does the 1 GB video card have enough memory for it?

Show solution ↓
Solution

(a) 24 bits per pixel give 224=16,777,216≈16.72^{24} = 16{,}777{,}216 \approx 16.7 million colors (matches the ad).

(b) Pixels: 1920×1200=2,304,0001920 \times 1200 = 2{,}304{,}000. Each pixel needs 24/8=324 / 8 = 3 bytes:

2,304,000×3=6,912,000 bytes2{,}304{,}000 \times 3 = 6{,}912{,}000\ \text{bytes}

In binary megabytes: 6,912,000/220=6,912,000/1,048,576≈6.596{,}912{,}000 / 2^{20} = 6{,}912{,}000 / 1{,}048{,}576 \approx 6.59 MB.

(c) 1 GB=1024 MB1\ \text{GB} = 1024\ \text{MB}, and 1024/6.59≈1551024 / 6.59 \approx 155, so the card can hold about 155 full screens: plenty (the rest is used for textures, 3-D data, etc.).