About

Exam Practice

Cheat sheet, flashcards and quiz covering Lectures 1–7: computer evolution & the von Neumann model, number representation & arithmetic, floating point, character & recording codes, CRC & Hamming codes, Boolean algebra, K-maps, combinational & sequential circuits, and the MARIE processor, assembly language & control unit.

Reference text: The Essentials of Computer Organization and Architecture, Linda Null & Julia Lobur

Showing 194 cards
1.1 Organization vs. Architecture & Components

Computer organization

termtap to reveal ↺
Definition

The physical aspects of a computer system: circuit design, control signals, memory types, buses, clock rate. Answers how each component works and how components are connected.

Computer organizationtap to flip back ↺
1.1 Organization vs. Architecture & Components

Computer architecture

termtap to reveal ↺
Definition

The logical aspects of the system as seen by the programmer: instruction set, instruction formats, data types, addressing modes, registers. Answers what the machine can do.

Computer architecturetap to flip back ↺
1.1 Organization vs. Architecture & Components

Test for architecture vs. organization

termtap to reveal ↺
Definition

Would a programmer need to know it to write a correct program? Yes → architecture. If only speed, cost or physical build changes → organization.

Test for architecture vs. organizationtap to flip back ↺
1.1 Organization vs. Architecture & Components

Multiply instruction vs. multiplier circuit

termtap to reveal ↺
Definition

Whether a multiply instruction exists is architecture; whether it uses a dedicated circuit or shift-and-add is organization.

Multiply instruction vs. multiplier circuittap to flip back ↺
1.1 Organization vs. Architecture & Components

Three basic components of a computer

termtap to reveal ↺
Definition

A processor to interpret and execute programs, a memory to store data and programs, and a mechanism (I/O system and buses) for transferring data.

Three basic components of a computertap to flip back ↺
1.1 Organization vs. Architecture & Components

Bus, port, cache

termtap to reveal ↺
Definition

Bus: shared wires carrying data, addresses and control. Port: connector for an external device (USB, HDMI). Cache: small fast memory holding copies of frequently used data.

Bus, port, cachetap to flip back ↺
1.1 Organization vs. Architecture & Components

Which quantities use powers of 2 vs. powers of 10?

termtap to reveal ↺
Definition

Memory size (RAM, cache) uses powers of 2 (1 KB = 2102^{10} B). Clock speed, data rates and advertised disk capacity use powers of 10 (1 GHz = 10910^9 Hz, 1 TB = 101210^{12} B).

Which quantities use powers of 2 vs. powers of 10?tap to flip back ↺
1.1 Organization vs. Architecture & Components

Clock period of a 2 GHz CPU

termtap to reveal ↺
Definition

T=1/f=1/(2×109)T = 1/f = 1/(2 \times 10^9) s = 0.5 ns.

Clock period of a 2 GHz CPUtap to flip back ↺
1.1 Organization vs. Architecture & Components

Why a 1 TB drive shows about 931 GB

termtap to reveal ↺
Definition

Maker uses 101210^{12} bytes; the OS divides by 2302^{30}: 1012/230≈931.310^{12}/2^{30} \approx 931.3 GiB. No bytes are missing.

Why a 1 TB drive shows about 931 GBtap to flip back ↺
1.1 Organization vs. Architecture & Components

4 GB of RAM in bytes

termtap to reveal ↺
Definition

4×230=232=4,294,967,2964 \times 2^{30} = 2^{32} = 4{,}294{,}967{,}296 bytes.

4 GB of RAM in bytestap to flip back ↺
1.2 Historical Development & Moore's/Rock's Laws

What defines a computer generation?

termtap to reveal ↺
Definition

Its dominant (switching) hardware technology, plus the machines, memory, software and uses it made possible.

What defines a computer generation?tap to flip back ↺
1.2 Historical Development & Moore's/Rock's Laws

Generation 0

termtap to reveal ↺
Definition

Mechanical calculators (1642–1945): Schickard's Calculating Clock, Pascal's Pascaline, Babbage's Difference and Analytical Engines, Hollerith's punched-card tabulator.

Generation 0tap to flip back ↺
1.2 Historical Development & Moore's/Rock's Laws

ENIAC

termtap to reveal ↺
Definition

1st generation (1946), Mauchly and Eckert: first all-electronic general-purpose computer, about 17,468 vacuum tubes, programmed by moving plugs and wires.

ENIACtap to flip back ↺
1.2 Historical Development & Moore's/Rock's Laws

2nd generation highlights

termtap to reveal ↺
Definition

Transistors (Bell Labs 1947, germanium), ~10× faster with 1/10 power and space, magnetic core RAM, FORTRAN/COBOL/ALGOL/SNOBOL, IBM 7094, CDC 6600.

2nd generation highlightstap to flip back ↺
1.2 Historical Development & Moore's/Rock's Laws

3rd generation highlights

termtap to reveal ↺
Definition

Integrated circuits on silicon, ~1 MIPS, online systems (airline reservations), IBM and the BUNCH, IBM System/360 family, PDP-8/PDP-11, Cray-1, UNIX rewritten in C.

3rd generation highlightstap to flip back ↺
1.2 Historical Development & Moore's/Rock's Laws

VLSI and the first microprocessor

termtap to reveal ↺
Definition

VLSI = more than 10,000 components per chip (4th generation). First microprocessor: 4-bit Intel 4004 (1971, about 2,300 transistors).

VLSI and the first microprocessortap to flip back ↺
1.2 Historical Development & Moore's/Rock's Laws

Components of the 5th generation

termtap to reveal ↺
Definition

ULSI multicore CPUs and SoCs, GPUs and AI accelerators (NPU, TPU), multi-level caches, DDR5 and HBM, NVMe SSDs, PCIe/Thunderbolt, 5G/IoT, cloud computing, AI/ML software.

Components of the 5th generationtap to flip back ↺
1.2 Historical Development & Moore's/Rock's Laws

Likely components of the 6th generation

termtap to reveal ↺
Definition

Quantum processors, neuromorphic chips, in-memory computing, optical computing, beyond-silicon materials and 3-D chips, DNA storage, brain-computer interfaces, 6G. Moves beyond silicon and the von Neumann model.

Likely components of the 6th generationtap to flip back ↺
1.2 Historical Development & Moore's/Rock's Laws

Moore's law (original and contemporary)

termtap to reveal ↺
Definition

Original (1965): IC transistor density doubles every year. Contemporary: silicon chip density doubles every 18 months. N(t)=N0×2t/dN(t) = N_0 \times 2^{t/d}.

Moore's law (original and contemporary)tap to flip back ↺
1.2 Historical Development & Moore's/Rock's Laws

Rock's law and its relation to Moore's law

termtap to reveal ↺
Definition

Cost of semiconductor fab equipment doubles every 4 years. For Moore's law to hold, Rock's law must fail, or vice versa.

Rock's law and its relation to Moore's lawtap to flip back ↺
1.3 The von Neumann Model

How was the ENIAC programmed?

termtap to reveal ↺
Definition

At the digital logic level, by moving plugs and wires and setting switches; each unique problem type needed a different hardware configuration.

How was the ENIAC programmed?tap to flip back ↺
1.3 The von Neumann Model

Stored-program concept

termtap to reveal ↺
Definition

Program instructions are stored in the same memory as data, as binary numbers, so a new program is loaded instead of rewiring. Conceived by Mauchly and Eckert, ascribed to von Neumann.

Stored-program concepttap to flip back ↺
1.3 The von Neumann Model

Three characteristics of a von Neumann machine

termtap to reveal ↺
Definition

Three hardware systems (CPU, main memory holding programs and data, I/O); sequential instruction processing; a single data path between CPU and main memory.

Three characteristics of a von Neumann machinetap to flip back ↺
1.3 The von Neumann Model

Von Neumann bottleneck

termtap to reveal ↺
Definition

The single path between CPU and memory that every instruction and operand must cross one at a time, so the CPU waits on memory. Softened by caches, wider buses, split I/D caches.

Von Neumann bottlenecktap to flip back ↺
1.3 The von Neumann Model

Fetch step (register level)

termtap to reveal ↺
Definition

MAR ← PC, IR ← M[MAR], PC ← PC + 1. The PC is incremented during fetch, so it already points to the next instruction while the current one executes.

Fetch step (register level)tap to flip back ↺
1.3 The von Neumann Model

Roles of PC, IR, MAR, MBR, AC

termtap to reveal ↺
Definition

PC: address of next instruction. IR: current instruction. MAR: address sent to memory. MBR: data read from or written to memory. AC: working value/ALU results.

Roles of PC, IR, MAR, MBR, ACtap to flip back ↺
1.3 The von Neumann Model

Decode 3105

termtap to reveal ↺
Definition

Opcode 3 = Add, address 105: AC ← AC + M[105].

Decode 3105tap to flip back ↺
1.3 The von Neumann Model

Harvard architecture

termtap to reveal ↺
Definition

Separate memories and paths for instructions and data, so an instruction fetch and a data access can happen at the same time (microcontrollers, DSPs).

Harvard architecturetap to flip back ↺
1.3 The von Neumann Model

Dataflow computing

termtap to reveal ↺
Definition

Non-von Neumann model with no program counter: an instruction executes as soon as its input data are available.

Dataflow computingtap to flip back ↺
1.3 The von Neumann Model

Non-von Neumann models (list)

termtap to reveal ↺
Definition

Harvard, special-purpose processors (GPU), dataflow, quantum, cellular automata, parallel computing, machine intelligence (neural networks, neuromorphic chips).

Non-von Neumann models (list)tap to flip back ↺
2.1 Bits, Bytes & Number Conversions

Nibble vs byte vs word

termtap to reveal ↺
Definition

Nibble = 4 bits (one hex digit); byte = 8 bits, the smallest addressable unit in most machines; word = machine-dependent group of bytes (commonly 16, 32 or 64 bits).

Nibble vs byte vs wordtap to flip back ↺
2.1 Bits, Bytes & Number Conversions

Division-remainder method

termtap to reveal ↺
Definition

Repeatedly divide by the target base, recording remainders; read them bottom to top (the first remainder is the least significant digit). 10410=102123104_{10} = 10212_3.

Division-remainder methodtap to flip back ↺
2.1 Bits, Bytes & Number Conversions

Converting a decimal fraction to binary

termtap to reveal ↺
Definition

Repeatedly multiply the fraction by 2; each integer part is the next bit; read top to bottom. 0.375→0.01120.375 → 0.011_2.

Converting a decimal fraction to binarytap to flip back ↺
2.1 Bits, Bytes & Number Conversions

When does a decimal fraction terminate in binary?

termtap to reveal ↺
Definition

Only when, in lowest terms, its denominator is a power of 2. 0.8125=13/160.8125 = 13/16 terminates; 0.1=1/100.1 = 1/10 gives 0.00011‾20.0\overline{0011}_2.

When does a decimal fraction terminate in binary?tap to flip back ↺
2.1 Bits, Bytes & Number Conversions

Binary → hex/octal grouping rule

termtap to reveal ↺
Definition

Group 4 (hex) or 3 (octal) bits starting at the radix point, moving outward both ways, padding outer groups with 0s. .112=.1102=.68.11_2 = .110_2 = .6_8, not .38.3_8.

Binary → hex/octal grouping ruletap to flip back ↺
2.1 Bits, Bytes & Number Conversions

Number of base-bb digits needed for NN

termtap to reveal ↺
Definition

⌊log⁡bN⌋+1\lfloor \log_b N \rfloor + 1. 1000101000_{10} needs ⌊9.97⌋+1=10\lfloor 9.97 \rfloor + 1 = 10 bits.

Number of base-bb digits needed for NNtap to flip back ↺
2.1 Bits, Bytes & Number Conversions

Unsigned range of nn bits

termtap to reveal ↺
Definition

00 to 2n−12^n - 1. 12 bits: 0 to 4095.

Unsigned range of nn bitstap to flip back ↺
2.1 Bits, Bytes & Number Conversions

Byte- vs word-addressable address bits

termtap to reveal ↺
Definition

Byte-addressable: log⁡2(bytes)\log_2(\text{bytes}). Word-addressable: log⁡2(words)\log_2(\text{words}). 2242^{24} bytes with 4-byte words: 24 vs 22 bits.

Byte- vs word-addressable address bitstap to flip back ↺
2.2 Signed Magnitude & Complements

Signed magnitude

termtap to reveal ↺
Definition

MSB is the sign (1 = negative), remaining n−1n-1 bits hold the magnitude. −18=1001 0010-18 = 1001\,0010. Range ±(2n−1−1)\pm(2^{n-1}-1), two zeros.

Signed magnitudetap to flip back ↺
2.2 Signed Magnitude & Complements

One's complement of NN

termtap to reveal ↺
Definition

(2n−1)−N(2^n - 1) - N, i.e. flip every bit. −19=1110 1100-19 = 1110\,1100 (8 bits). Two zeros: 00⋯000\cdots0 and 11⋯111\cdots1.

One's complement of NNtap to flip back ↺
2.2 Signed Magnitude & Complements

Two's complement of NN

termtap to reveal ↺
Definition

2n−N2^n - N = one's complement + 1. −19=1110 1101-19 = 1110\,1101. Range −2n−1-2^{n-1} to 2n−1−12^{n-1}-1, one zero.

Two's complement of NNtap to flip back ↺
2.2 Signed Magnitude & Complements

Copy-then-flip shortcut

termtap to reveal ↺
Definition

Scan from the right, copy bits through the first 1, flip all bits to its left. 0010 1100→1101 01000010\,1100 → 1101\,0100 (±44\pm 44).

Copy-then-flip shortcuttap to flip back ↺
2.2 Signed Magnitude & Complements

Value of a two's complement pattern

termtap to reveal ↺
Definition

MSB has weight −2n−1-2^{n-1}. 1110 1101=−128+109=−191110\,1101 = -128 + 109 = -19.

Value of a two's complement patterntap to flip back ↺
2.2 Signed Magnitude & Complements

8-bit ranges

termtap to reveal ↺
Definition

Signed magnitude and one's complement: −127 to +127. Two's complement: −128 to +127. Unsigned: 0 to 255.

8-bit rangestap to flip back ↺
2.2 Signed Magnitude & Complements

Sign extension rules

termtap to reveal ↺
Definition

Two's/one's complement: copy the sign bit into new high bits. Signed magnitude: move sign to new MSB, fill 0s between sign and magnitude. −5-5: SM 1000 01011000\,0101, two's 1111 10111111\,1011.

Sign extension rulestap to flip back ↺
2.2 Signed Magnitude & Complements

Which signed representation is best and why?

termtap to reveal ↺
Definition

Two's complement: single zero, widest range, and subtraction uses the same adder with the carry simply discarded.

Which signed representation is best and why?tap to flip back ↺
2.3 Integer Arithmetic, Overflow & Multiplication

Signed-magnitude addition rule

termtap to reveal ↺
Definition

Same signs: add magnitudes, keep the sign. Different signs: subtract smaller magnitude from larger and take the sign of the larger. Overflow = carry out of the magnitude.

Signed-magnitude addition ruletap to flip back ↺
2.3 Integer Arithmetic, Overflow & Multiplication

End-around carry

termtap to reveal ↺
Definition

In one's complement addition, a carry out of the MSB is added back into the LSB, because dropping it would leave A−B−1A - B - 1.

End-around carrytap to flip back ↺
2.3 Integer Arithmetic, Overflow & Multiplication

Two's complement subtraction

termtap to reveal ↺
Definition

A−B=A+B′+1A - B = A + B' + 1; add including sign bits and discard any carry out of the MSB.

Two's complement subtractiontap to flip back ↺
2.3 Integer Arithmetic, Overflow & Multiplication

Overflow rule (two's complement)

termtap to reveal ↺
Definition

Overflow iff carry into MSB ≠ carry out of MSB: V=Cn−1⊕CnV = C_{n-1} \oplus C_n. Equivalently, two same-sign operands give an opposite-sign result.

Overflow rule (two's complement)tap to flip back ↺
2.3 Integer Arithmetic, Overflow & Multiplication

Is a carry out of the MSB always overflow?

termtap to reveal ↺
Definition

No. 1100+1111=1 10111100 + 1111 = 1\,1011 (−4+−1=−5-4 + -1 = -5) has a carry out but no overflow since carry in = carry out.

Is a carry out of the MSB always overflow?tap to flip back ↺
2.3 Integer Arithmetic, Overflow & Multiplication

Role of MM in the XOR adder/subtractor

termtap to reveal ↺
Definition

MM feeds every BiB_i XOR and the carry-in C0C_0. M=0M = 0 adds BB; M=1M = 1 adds B′+1B' + 1, i.e. subtracts.

Role of MM in the XOR adder/subtractortap to flip back ↺
2.3 Integer Arithmetic, Overflow & Multiplication

Sequential multiplier cycle

termtap to reveal ↺
Definition

If Q0=1Q_0 = 1, C,A←A+MC,A ← A + M; then shift C, A, Q right one bit and decrement Count. After nn cycles the 2n2n-bit product is in A,Q.

Sequential multiplier cycletap to flip back ↺
2.3 Integer Arithmetic, Overflow & Multiplication

Why the C bit in the multiplier?

termtap to reveal ↺
Definition

It catches the carry out of A+MA + M; the right shift moves it into An−1A_{n-1} so it is not lost (e.g. 0110+1011=1 00010110 + 1011 = 1\,0001 in 11×1311 \times 13).

Why the C bit in the multiplier?tap to flip back ↺
2.4 Floating-Point Representation & IEEE 754

Three parts of a floating-point number

termtap to reveal ↺
Definition

Sign, exponent (sets the range) and significand/mantissa (sets the precision).

Three parts of a floating-point numbertap to flip back ↺
2.4 Floating-Point Representation & IEEE 754

Lecture 14-bit model layout

termtap to reveal ↺
Definition

1 sign bit, 5-bit exponent (excess-16), 8-bit fraction with an implicit leading 1.

Lecture 14-bit model layouttap to flip back ↺
2.4 Floating-Point Representation & IEEE 754

Implicit (hidden) leading 1

termtap to reveal ↺
Definition

Every normalized nonzero binary number starts with 1., so that bit is not stored, gaining one bit of precision.

Implicit (hidden) leading 1tap to flip back ↺
2.4 Floating-Point Representation & IEEE 754

Excess-16 exponent

termtap to reveal ↺
Definition

Stored = true + 16, giving true exponents −16 to +15. e=−2→14=01110e = -2 → 14 = 01110.

Excess-16 exponenttap to flip back ↺
2.4 Floating-Point Representation & IEEE 754

Why use a biased exponent?

termtap to reveal ↺
Definition

An unsigned exponent cannot be negative; the bias allows negative exponents while keeping the field unsigned, so magnitudes compare and sort like plain binary.

Why use a biased exponent?tap to flip back ↺
2.4 Floating-Point Representation & IEEE 754

IEEE 754 single vs double

termtap to reveal ↺
Definition

Single: 1 + 8 + 23 bits, bias 127. Double: 1 + 11 + 52 bits, bias 1023.

IEEE 754 single vs doubletap to flip back ↺
2.4 Floating-Point Representation & IEEE 754

IEEE special values

termtap to reveal ↺
Definition

E = 0, F = 0: ±0. E all 1s, F = 0: ±∞. E all 1s, F ≠ 0: NaN.

IEEE special valuestap to flip back ↺
2.4 Floating-Point Representation & IEEE 754

9.6259.625 in the 14-bit model

termtap to reveal ↺
Definition

1001.1012=1.001101×231001.101_2 = 1.001101 \times 2^3 → 0 10011 001101000\ 10011\ 00110100.

9.6259.625 in the 14-bit modeltap to flip back ↺
2.4 Floating-Point Representation & IEEE 754

1.01.0 in IEEE single

termtap to reveal ↺
Definition

S=0S = 0, E=127=01111111E = 127 = 01111111, F=0F = 0 → 3F80000016\text{3F800000}_{16}.

1.01.0 in IEEE singletap to flip back ↺
2.5 Floating-Point Arithmetic & Errors

FP addition steps

termtap to reveal ↺
Definition

Check zeros; align by shifting the smaller-exponent significand right; add/subtract; normalize; round/truncate and check over/underflow.

FP addition stepstap to flip back ↺
2.5 Floating-Point Arithmetic & Errors

Why shift the smaller number during alignment?

termtap to reveal ↺
Definition

Shifting it right only loses its least significant bits; shifting the larger left would lose its most significant bits.

Why shift the smaller number during alignment?tap to flip back ↺
2.5 Floating-Point Arithmetic & Errors

FP multiplication

termtap to reveal ↺
Definition

Sign = XOR of signs; add exponents (biased: EX+EY−16E_X + E_Y - 16); multiply significands; normalize (at most one right shift).

FP multiplicationtap to flip back ↺
2.5 Floating-Point Arithmetic & Errors

FP division

termtap to reveal ↺
Definition

Sign = XOR; subtract exponents (biased: EX−EY+16E_X - E_Y + 16); divide significands; normalize. 18÷618 \div 6: 0.11×22=1.1×21=30.11 \times 2^2 = 1.1 \times 2^1 = 3.

FP divisiontap to flip back ↺
2.5 Floating-Point Arithmetic & Errors

Overflow vs underflow (FP)

termtap to reveal ↺
Definition

Overflow: exponent too large to store. Underflow: nonzero result whose exponent is too small, i.e. too close to zero.

Overflow vs underflow (FP)tap to flip back ↺
2.5 Floating-Point Arithmetic & Errors

Spacing of 14-bit values near 2e2^e

termtap to reveal ↺
Definition

2e−82^{e-8} (8 fraction bits). Near 128 the gap is 0.5, so 128.75128.75 is stored as 128.5128.5.

Spacing of 14-bit values near 2e2^etap to flip back ↺
2.5 Floating-Point Arithmetic & Errors

Blatant vs subtle errors

termtap to reveal ↺
Definition

Blatant: obvious (crash, overflow/underflow). Subtle: plausible but wrong, e.g. truncation 128.75→128.5128.75 → 128.5. A crash is better than a plausible wrong answer.

Blatant vs subtle errorstap to flip back ↺
2.5 Floating-Point Arithmetic & Errors

How to compare floating-point values

termtap to reveal ↺
Definition

Never with == (especially == 0.0); use a tolerance: abs(x - y) < epsilon.

How to compare floating-point valuestap to flip back ↺
3.1 Character Codes & Parity

BCD encoding of a decimal number

termtap to reveal ↺
Definition

Each decimal digit is encoded separately in 4 bits (0000–1001). 30510305_{10} = 0011 0000 0101; 1010–1111 are unused.

BCD encoding of a decimal numbertap to flip back ↺
3.1 Character Codes & Parity

BCD sign/zone nibbles

termtap to reveal ↺
Definition

1111 = unsigned, 1100 = positive, 1101 = negative.

BCD sign/zone nibblestap to flip back ↺
3.1 Character Codes & Parity

Zoned decimal vs packed BCD

termtap to reveal ↺
Definition

Zoned: one digit per byte, zone 1111 except the last digit whose zone is the sign (+305+305 = F3 F0 C5). Packed: two digits per byte plus a sign nibble at the end, padded with 0000 if needed (+305+305 = 30 5C).

Zoned decimal vs packed BCDtap to flip back ↺
3.1 Character Codes & Parity

EBCDIC

termtap to reveal ↺
Definition

IBM's 8-bit Extended Binary-Coded Decimal Interchange Code (1964): zone nibble picks the row, digit nibble the column. "A" = C1, "7" = F7, space = 40.

EBCDICtap to flip back ↺
3.1 Character Codes & Parity

ASCII size and anchors

termtap to reveal ↺
Definition

7 bits, 128 codes (00–7F). "0" = 30 hex, "A" = 41 hex, "a" = 61 hex; upper and lower case differ by 20 hex.

ASCII size and anchorstap to flip back ↺
3.1 Character Codes & Parity

How to add an even parity bit

termtap to reveal ↺
Definition

Count the 1s in the 7-bit code; parity bit (leftmost) = 1 if the count is odd, else 0. "C" = 100 0011 → 1100 0011.

How to add an even parity bittap to flip back ↺
3.1 Character Codes & Parity

Limitation of a single parity bit

termtap to reveal ↺
Definition

Detects any odd number of bit errors but misses an even number, and cannot say which bit is wrong.

Limitation of a single parity bittap to flip back ↺
3.1 Character Codes & Parity

Unicode code space

termtap to reveal ↺
Definition

21-bit, U+0000 to U+10FFFF: 17 planes × 65,536 = 1,114,112 code points. Plane 0 is the BMP; U+0000–U+007F equal ASCII.

Unicode code spacetap to flip back ↺
3.1 Character Codes & Parity

Finding a code point's Unicode plane

termtap to reveal ↺
Definition

Divide by 6553665536 (100001610000_{16}): the hex digits in front of the last four. U+1F600 → plane 1; U+20AC → plane 0 (BMP).

Finding a code point's Unicode planetap to flip back ↺
3.2 Recording & Transmission Codes

Bit cell

termtap to reveal ↺
Definition

For transmission, the time one bit lasts (1/bit rate1/\text{bit rate}; 2 Kbps → 0.5 ms). For storage, the surface area holding one bit.

Bit celltap to flip back ↺
3.2 Recording & Transmission Codes

Flux reversal

termtap to reveal ↺
Definition

A change of magnetic polarity between adjacent areas of the surface; the read head detects the change, not the polarity.

Flux reversaltap to flip back ↺
3.2 Recording & Transmission Codes

NRZ

termtap to reveal ↺
Definition

1 = high for the whole cell, 0 = low. Most compact, but long runs of identical bits give a flat line and loss of synchronisation.

NRZtap to flip back ↺
3.2 Recording & Transmission Codes

NRZI

termtap to reveal ↺
Definition

A 1 causes a transition, a 0 none; the level itself is meaningless. Fixes runs of 1s, still loses sync on long runs of 0s. Transitions = number of 1s.

NRZItap to flip back ↺
3.2 Recording & Transmission Codes

Manchester code

termtap to reveal ↺
Definition

Mid-cell transition in every cell: 1 = low→high, 0 = high→low, plus a boundary flip between equal neighbours. Self-clocking; classic Ethernet. Up to 2 transitions per bit.

Manchester codetap to flip back ↺
3.2 Recording & Transmission Codes

FM

termtap to reveal ↺
Definition

Clock transition at every cell boundary plus a mid-cell data transition for each 1. Transitions = nn + number of 1s ("OK": 16 + 10 = 26).

FMtap to flip back ↺
3.2 Recording & Transmission Codes

MFM

termtap to reveal ↺
Definition

Mid-cell transition for each 1; boundary transition only between two adjacent 0 cells. "OK": 10 + 2 = 12 transitions.

MFMtap to flip back ↺
3.2 Recording & Transmission Codes

RLL(2,7)

termtap to reveal ↺
Definition

Data is re-coded (2 code bits per data bit) so there are at least 2 and at most 7 zeros between code 1s, then recorded with NRZI. "OK" needs only 8 transitions.

RLL(2,7)tap to flip back ↺
3.2 Recording & Transmission Codes

Rank FM, MFM, RLL by density

termtap to reveal ↺
Definition

RLL >\gt MFM >\gt FM: RLL needs the fewest flux reversals per data bit, so the smallest bit cells. RLL saves 25% vs MFM on "OK".

Rank FM, MFM, RLL by densitytap to flip back ↺
3.3 Check Digits & CRC

Check digit

termtap to reveal ↺
Definition

An extra digit computed from the others (e.g. last digit of UPC barcodes and ISBNs) so a single wrong digit is caught.

Check digittap to flip back ↺
3.3 Check Digits & CRC

UPC-A check digit rule

termtap to reveal ↺
Definition

3 × (sum of odd positions) + (sum of even positions) = SS; check digit = 10−(S mod 10)10 - (S \bmod 10), or 0. 01234567890 → S=85S = 85 → 5.

UPC-A check digit ruletap to flip back ↺
3.3 Check Digits & CRC

Syndrome (for CRC)

termtap to reveal ↺
Definition

The group of error-control bits appended to the end of a data block.

Syndrome (for CRC)tap to flip back ↺
3.3 Check Digits & CRC

Modulo-2 addition and subtraction

termtap to reveal ↺
Definition

Both are bitwise XOR with no carries or borrows: 1101−0111=10101101 - 0111 = 1010.

Modulo-2 addition and subtractiontap to flip back ↺
3.3 Check Digits & CRC

Key length vs CRC length

termtap to reveal ↺
Definition

A key of n+1n+1 bits (degree nn) gives an nn-bit CRC, so the sender appends nn zeros. CRC-16-CCITT (17 bits) → 16-bit CRC.

Key length vs CRC lengthtap to flip back ↺
3.3 Check Digits & CRC

CRC sender steps

termtap to reveal ↺
Definition

Append nn zeros, mod-2 divide by the key, replace the zeros with the nn-bit remainder. 1111101 / 1101 → 1111101111.

CRC sender stepstap to flip back ↺
3.3 Check Digits & CRC

CRC receiver test

termtap to reveal ↺
Definition

Divide the received codeword by the key: remainder 0 → accept; otherwise reject and request retransmission.

CRC receiver testtap to flip back ↺
3.3 Check Digits & CRC

Errors a degree-nn CRC always catches

termtap to reveal ↺
Definition

All single-bit errors, all bursts of length ≤n\le n, and all odd-count errors when (x+1)(x+1) is a factor of the key.

Errors a degree-nn CRC always catchestap to flip back ↺
3.3 Check Digits & CRC

When does a CRC miss an error?

termtap to reveal ↺
Definition

Only when the error pattern E(x)E(x) is a multiple of the key, e.g. key 1101 shifted: 0001101000.

When does a CRC miss an error?tap to flip back ↺
3.4 Hamming Codes

Hamming distance

termtap to reveal ↺
Definition

Number of bit positions in which two code words differ: XOR them and count the 1s. 10001001⊕10110001=0011100010001001 \oplus 10110001 = 00111000 → 3.

Hamming distancetap to flip back ↺
3.4 Hamming Codes

D(min) needed to detect / correct k errors

termtap to reveal ↺
Definition

Detect: D(min⁡)=k+1D(\min) = k + 1. Correct: D(min⁡)=2k+1D(\min) = 2k + 1.

D(min) needed to detect / correct k errorstap to flip back ↺
3.4 Hamming Codes

Check-bit inequality

termtap to reveal ↺
Definition

Smallest rr with (m+r+1)≤2r(m + r + 1) \le 2^r. m=8m = 8 → r=4r = 4 (13≤1613 \le 16), n=12n = 12.

Check-bit inequalitytap to flip back ↺
3.4 Hamming Codes

Where do check bits go?

termtap to reveal ↺
Definition

Number positions 1..n from the right; check bits at powers of 2 (1, 2, 4, 8 …); data fills the rest from the highest position down.

Where do check bits go?tap to flip back ↺
3.4 Hamming Codes

Which positions does P4 check (n = 12)?

termtap to reveal ↺
Definition

Those whose binary number contains 4: positions 4, 5, 6, 7, 12.

Which positions does P4 check (n = 12)?tap to flip back ↺
3.4 Hamming Codes

Computing a check bit (even parity)

termtap to reveal ↺
Definition

XOR of the data bits in the positions it covers. Data 1011 (m = 4) → P1 = 1, P2 = 0, P4 = 0 → 1010101.

Computing a check bit (even parity)tap to flip back ↺
3.4 Hamming Codes

Syndrome interpretation

termtap to reveal ↺
Definition

K⊕K′K \oplus K': 0 = no error; a power of 2 = error in that check bit (data fine); any other value = position of the wrong data bit.

Syndrome interpretationtap to flip back ↺
3.4 Hamming Codes

Why Hamming instead of CRC for memory?

termtap to reveal ↺
Definition

Memory has no sender to retransmit, so the code must correct errors, not just detect them.

Why Hamming instead of CRC for memory?tap to flip back ↺
3.4 Hamming Codes

Reed-Solomon codes

termtap to reveal ↺
Definition

Error-correcting codes good at burst errors (runs of adjacent damaged bits); used on CD-ROMs.

Reed-Solomon codestap to flip back ↺
4.1 Boolean Operators & Logic Gates

Truth table rows for nn inputs

termtap to reveal ↺
Definition

2n2^n rows, listed in binary counting order (3 inputs → 8 rows, 5 inputs → 32).

Truth table rows for nn inputstap to flip back ↺
4.1 Boolean Operators & Logic Gates

Number of different Boolean functions of nn variables

termtap to reveal ↺
Definition

22n2^{2^n}: each of the 2n2^n output bits is free. n=2n = 2 → 16 functions.

Number of different Boolean functions of nn variablestap to flip back ↺
4.1 Boolean Operators & Logic Gates

XOR in AND/OR/NOT form

termtap to reveal ↺
Definition

x⊕y=xy′+x′yx \oplus y = xy' + x'y; 1 when inputs differ. Multi-input XOR is 1 for an odd number of 1s (parity).

XOR in AND/OR/NOT formtap to flip back ↺
4.1 Boolean Operators & Logic Gates

When is NAND 0? When is NOR 1?

termtap to reveal ↺
Definition

NAND is 0 only when all inputs are 1; NOR is 1 only when all inputs are 0.

When is NAND 0? When is NOR 1?tap to flip back ↺
4.1 Boolean Operators & Logic Gates

Why are NAND and NOR called universal?

termtap to reveal ↺
Definition

Any Boolean function can be built using only NAND (or only NOR); they are cheap to mass-produce and faster / lower-power than other gate configurations.

Why are NAND and NOR called universal?tap to flip back ↺
4.1 Boolean Operators & Logic Gates

OR from NAND gates only

termtap to reveal ↺
Definition

Invert each input with a NAND whose inputs are tied: x′x', y′y'; then NAND(x′,y′x', y') =(x′y′)′=x+y= (x'y')' = x + y (3 gates).

OR from NAND gates onlytap to flip back ↺
4.1 Boolean Operators & Logic Gates

AND from NOR gates only

termtap to reveal ↺
Definition

NOR(x,xx,x) =x′= x', NOR(y,yy,y) =y′= y', then NOR(x′,y′x', y') =(x′+y′)′=xy= (x' + y')' = xy (3 gates).

AND from NOR gates onlytap to flip back ↺
4.1 Boolean Operators & Logic Gates

CMOS NOR gate structure

termtap to reveal ↺
Definition

Two pMOS in series from +5 V to YY, two nMOS in parallel from YY to ground: 4 transistors. pMOS conducts on 0, nMOS on 1.

CMOS NOR gate structuretap to flip back ↺
4.1 Boolean Operators & Logic Gates

7400 chip

termtap to reveal ↺
Definition

SSI quad 2-input NAND: 14 pins = power + ground + 4 gates × 3 pins. 10 NAND gates need ⌈10/4⌉=3\lceil 10/4 \rceil = 3 chips.

7400 chiptap to flip back ↺
4.2 Boolean Identities & Sum-of-Products

DeMorgan's law

termtap to reveal ↺
Definition

(xy)′=x′+y′(xy)' = x' + y' and (x+y)′=x′y′(x + y)' = x'y': complement of a product is the sum of complements, and vice versa.

DeMorgan's lawtap to flip back ↺
4.2 Boolean Identities & Sum-of-Products

Distributive law (OR over AND)

termtap to reveal ↺
Definition

x+yz=(x+y)(x+z)x + yz = (x + y)(x + z); no ordinary-algebra counterpart, but often the key simplification step.

Distributive law (OR over AND)tap to flip back ↺
4.2 Boolean Identities & Sum-of-Products

Absorption law

termtap to reveal ↺
Definition

x+xy=xx + xy = x and x(x+y)=xx(x + y) = x.

Absorption lawtap to flip back ↺
4.2 Boolean Identities & Sum-of-Products

Recipe for F′F'

termtap to reveal ↺
Definition

Complement each variable, swap AND ↔ OR, keep old products grouped: (xy+x′z)′=(x′+y′)(x+z′)(xy + x'z)' = (x' + y')(x + z').

Recipe for F′F'tap to flip back ↺
4.2 Boolean Identities & Sum-of-Products

Simplify x+x′yx + x'y

termtap to reveal ↺
Definition

(x+x′)(x+y)=1⋅(x+y)=x+y(x + x')(x + y) = 1 \cdot (x + y) = x + y (Distributive, Inverse, Identity).

Simplify x+x′yx + x'ytap to flip back ↺
4.2 Boolean Identities & Sum-of-Products

Consensus theorem

termtap to reveal ↺
Definition

xy+x′z+yz=xy+x′zxy + x'z + yz = xy + x'z: the term yzyz is redundant.

Consensus theoremtap to flip back ↺
4.2 Boolean Identities & Sum-of-Products

Minterm vs maxterm

termtap to reveal ↺
Definition

Minterm: product of all variables, 1 in exactly one row (used in SOP). Maxterm: sum of all variables, 0 in exactly one row (used in POS).

Minterm vs maxtermtap to flip back ↺
4.2 Boolean Identities & Sum-of-Products

Canonical SOP of a truth table

termtap to reveal ↺
Definition

OR the minterms of the rows where F=1F = 1; e.g. F=xz′+y=Σm(2,3,4,6,7)F = xz' + y = \Sigma m(2, 3, 4, 6, 7).

Canonical SOP of a truth tabletap to flip back ↺
4.2 Boolean Identities & Sum-of-Products

Operator precedence

termtap to reveal ↺
Definition

NOT first, then AND, then OR (parentheses override). xy′xy' complements only yy; (xy)′(xy)' complements the product.

Operator precedencetap to flip back ↺
4.3 Karnaugh Maps

Column order on a 3-variable K-map

termtap to reveal ↺
Definition

yzyz = 00, 01, 11, 10 (Gray code), giving cell order m0 m1 m3 m2 / m4 m5 m7 m6.

Column order on a 3-variable K-maptap to flip back ↺
4.3 Karnaugh Maps

Why Gray-code ordering?

termtap to reveal ↺
Definition

Adjacent cells (including wrap-around) differ in exactly one variable, so each pair of neighbouring 1s merges: xy′z+xyz=xzxy'z + xyz = xz.

Why Gray-code ordering?tap to flip back ↺
4.3 Karnaugh Maps

Allowed group sizes and shapes

termtap to reveal ↺
Definition

Power-of-2 rectangles of 1s (1, 2, 4, 8, 16); no diagonals; as large as possible; overlap and wrap-around allowed.

Allowed group sizes and shapestap to flip back ↺
4.3 Karnaugh Maps

Literals in a group of 4 on a 4-variable map

termtap to reveal ↺
Definition

2 literals (a group of 2k2^k cells eliminates kk variables: 4−2=24 - 2 = 2).

Literals in a group of 4 on a 4-variable maptap to flip back ↺
4.3 Karnaugh Maps

The four corners of a 4-variable map

termtap to reveal ↺
Definition

m0, m2, m8, m10 form one group (wrap both ways): x′z′x'z'.

The four corners of a 4-variable maptap to flip back ↺
4.3 Karnaugh Maps

Don't-care condition

termtap to reveal ↺
Definition

An input that never occurs (e.g. BCD codes 1010–1111). Marked d; used as 1 only if it enlarges a group; never has to be covered.

Don't-care conditiontap to flip back ↺
4.3 Karnaugh Maps

Simplify Σm(1,3)+d(5,7)\Sigma m(1, 3) + d(5, 7) for F(x,y,z)F(x,y,z)

termtap to reveal ↺
Definition

Using d5, d7: columns 01 and 11 form a group of 4 with z=1z = 1 constant, so F=zF = z.

Simplify Σm(1,3)+d(5,7)\Sigma m(1, 3) + d(5, 7) for F(x,y,z)F(x,y,z)tap to flip back ↺
4.3 Karnaugh Maps

How to read a group's term

termtap to reveal ↺
Definition

Keep only variables constant over the group: constant 1 → uncomplemented, constant 0 → complemented; changing variables drop out.

How to read a group's termtap to flip back ↺
4.4 Combinational Circuits

Half adder equations

termtap to reveal ↺
Definition

Sum =x⊕y= x \oplus y, Carry =xy= xy: one XOR and one AND.

Half adder equationstap to flip back ↺
4.4 Combinational Circuits

Full adder equations

termtap to reveal ↺
Definition

Sum =x⊕y⊕Cin= x \oplus y \oplus C_{in}, Cout=xy+Cin(x⊕y)C_{out} = xy + C_{in}(x \oplus y); built from two half adders and an OR gate.

Full adder equationstap to flip back ↺
4.4 Combinational Circuits

Ripple-carry adder drawback

termtap to reveal ↺
Definition

Slow for wide words: bit n−1n-1 waits for the carry to pass through all n−1n - 1 previous full adders.

Ripple-carry adder drawbacktap to flip back ↺
4.4 Combinational Circuits

Decoder

termtap to reveal ↺
Definition

nn inputs → 2n2^n outputs, exactly one active; each output is a minterm. Used for memory address decoding (64 outputs → 6 inputs).

Decodertap to flip back ↺
4.4 Combinational Circuits

Multiplexer select lines

termtap to reveal ↺
Definition

log⁡2(data inputs)\log_2(\text{data inputs}): 8 inputs → 3, 32 inputs → 5. The select value chooses which input reaches the single output.

Multiplexer select linestap to flip back ↺
4.4 Combinational Circuits

Any function from a decoder

termtap to reveal ↺
Definition

Feed the variables to an nn-to-2n2^n decoder and OR the outputs of the function's minterms.

Any function from a decodertap to flip back ↺
4.4 Combinational Circuits

Lecture 2-bit ALU function codes

termtap to reveal ↺
Definition

f1f0f_1f_0: 00 ADD, 01 OR, 10 NOT AA, 11 AND; a 2-to-4 decoder enables one result.

Lecture 2-bit ALU function codestap to flip back ↺
4.4 Combinational Circuits

Combinational circuit

termtap to reveal ↺
Definition

Outputs depend only on current inputs (no memory, no feedback): adders, decoders, multiplexers, ALU.

Combinational circuittap to flip back ↺
4.5 Sequential Circuits & Flip-Flops

Sequential circuit

termtap to reveal ↺
Definition

Output depends on current inputs and current state; memory is created by feedback; state changes on clock ticks.

Sequential circuittap to flip back ↺
4.5 Sequential Circuits & Flip-Flops

Edge- vs level-triggered

termtap to reveal ↺
Definition

Edge-triggered: changes state at the rising or falling edge. Level-triggered: changes whenever the clock is high.

Edge- vs level-triggeredtap to flip back ↺
4.5 Sequential Circuits & Flip-Flops

SR flip-flop characteristic table

termtap to reveal ↺
Definition

00 hold, 01 reset to 0, 10 set to 1, 11 undefined (both NOR outputs forced to 0).

SR flip-flop characteristic tabletap to flip back ↺
4.5 Sequential Circuits & Flip-Flops

JK flip-flop characteristic table

termtap to reveal ↺
Definition

00 hold, 01 reset, 10 set, 11 toggle. Q+=JQ′+K′QQ^+ = JQ' + K'Q; internally S=JQ′S = JQ', R=KQR = KQ.

JK flip-flop characteristic tabletap to flip back ↺
4.5 Sequential Circuits & Flip-Flops

D flip-flop

termtap to reveal ↺
Definition

Q+=DQ^+ = D; built from SR with S=DS = D, R=D′R = D'. Fundamental 1-bit memory cell; registers are D flip-flops on a shared clock.

D flip-floptap to flip back ↺
4.5 Sequential Circuits & Flip-Flops

T flip-flop

termtap to reveal ↺
Definition

JK with J=K=TJ = K = T: Q+=T⊕QQ^+ = T \oplus Q (0 hold, 1 toggle). Basis of binary counters.

T flip-floptap to flip back ↺
4.5 Sequential Circuits & Flip-Flops

When does bit BiB_i of the JK binary counter toggle?

termtap to reveal ↺
Definition

When Count Enable = 1 and all lower bits are 1 (Ji=Ki=J_i = K_i = CE⋅B0⋯Bi−1\cdot B_0 \cdots B_{i-1}); B0B_0 toggles every pulse.

When does bit BiB_i of the JK binary counter toggle?tap to flip back ↺
4.5 Sequential Circuits & Flip-Flops

JK inputs needed for transition 1 → 0

termtap to reveal ↺
Definition

J=dJ = d (don't care), K=1K = 1: reset (01) or toggle (11) both give 0.

JK inputs needed for transition 1 → 0tap to flip back ↺
4.5 Sequential Circuits & Flip-Flops

Clock period of 800 MHz

termtap to reveal ↺
Definition

1/(800×106)=1.251 / (800 \times 10^6) = 1.25 ns.

Clock period of 800 MHztap to flip back ↺
6.1 CPU, Buses, Clocks & Memory

Datapath vs control unit

termtap to reveal ↺
Definition

The datapath (ALU, registers, buses) does the work; the control unit decides which datapath actions happen and when, based on the instruction, PC and status flags.

Datapath vs control unittap to flip back ↺
6.1 CPU, Buses, Clocks & Memory

Clock cycle time formula

termtap to reveal ↺
Definition

t=1/ft = 1/f; in ns, t=1000/fMHzt = 1000 / f_{\text{MHz}}. 800 MHz → 1.25 ns; 2.5 GHz → 0.4 ns.

Clock cycle time formulatap to flip back ↺
6.1 CPU, Buses, Clocks & Memory

Three groups of bus lines

termtap to reveal ↺
Definition

Data lines (the value), address lines (where), control lines (what and when: read/write, clock, arbitration, interrupts).

Three groups of bus linestap to flip back ↺
6.1 CPU, Buses, Clocks & Memory

Multipoint bus drawback and fix

termtap to reveal ↺
Definition

Only one device may drive the shared wires at a time; hardware protocols (bus arbitration) grant access. It is cheap but can become a bottleneck.

Multipoint bus drawback and fixtap to flip back ↺
6.1 CPU, Buses, Clocks & Memory

Address lines for 4M × 16 (word- vs byte-addressable)

termtap to reveal ↺
Definition

Word: 4M=2224\text{M} = 2^{22} → 22 lines. Byte: 222×2=2232^{22} \times 2 = 2^{23} → 23 lines. Width (16) affects data lines only.

Address lines for 4M × 16 (word- vs byte-addressable)tap to flip back ↺
6.1 CPU, Buses, Clocks & Memory

Chips for L × W memory from l × w chips

termtap to reveal ↺
Definition

(L/l)×(W/w)(L/l) \times (W/w). MARIE 4K × 16 from 1K × 8: 4 rows × 2 = 8 chips.

Chips for L × W memory from l × w chipstap to flip back ↺
6.1 CPU, Buses, Clocks & Memory

Chip-select bits

termtap to reveal ↺
Definition

log⁡2(L/l)\log_2(L/l) high-order address bits into a decoder; the remaining log⁡2l\log_2 l bits go to every chip. MARIE: 2 bits (2-to-4 decoder) + 10 bits.

Chip-select bitstap to flip back ↺
6.1 CPU, Buses, Clocks & Memory

High- vs low-order interleaving

termtap to reveal ↺
Definition

High-order: chip select from leftmost bits, consecutive addresses fill one row. Low-order: from rightmost bits, consecutive addresses spread across rows so they can work in parallel.

High- vs low-order interleavingtap to flip back ↺
6.1 CPU, Buses, Clocks & Memory

Why registers use D flip-flops

termtap to reveal ↺
Definition

A D flip-flop stores its input at the clock edge (Q(t+1)=DQ(t+1) = D), exactly "load this word"; an n-bit register needs n of them.

Why registers use D flip-flopstap to flip back ↺
6.2 MARIE Architecture & Instruction Set

MARIE key characteristics

termtap to reveal ↺
Definition

Two's complement, stored program, 16-bit fixed words, 4K words word-addressable memory, 16-bit instruction = 4-bit opcode + 12-bit address, 7 registers.

MARIE key characteristicstap to flip back ↺
6.2 MARIE Architecture & Instruction Set

Why MAR/PC are 12 bits but AC/MBR/IR are 16

termtap to reveal ↺
Definition

MAR and PC hold addresses: 4K=2124\text{K} = 2^{12} words. AC, MBR, IR hold data words/instructions, which are 16 bits.

Why MAR/PC are 12 bits but AC/MBR/IR are 16tap to flip back ↺
6.2 MARIE Architecture & Instruction Set

Bus device numbers

termtap to reveal ↺
Definition

Memory 0, MAR 1, PC 2, MBR 3, AC 4, InREG 5, OutREG 6, IR 7.

Bus device numberstap to flip back ↺
6.2 MARIE Architecture & Instruction Set

Skipcond codes

termtap to reveal ↺
Definition

Skipcond 000 (8000): skip if AC < 0; 400 (8400): AC = 0; 800 (8800): AC > 0. Condition is in IR bits 11–10.

Skipcond codestap to flip back ↺
6.2 MARIE Architecture & Instruction Set

LoadI X vs Load X

termtap to reveal ↺
Definition

Load: AC ← M[X]. LoadI: AC ← M[M[X]], X holds a pointer; one extra memory read.

LoadI X vs Load Xtap to flip back ↺
6.2 MARIE Architecture & Instruction Set

What does JnS X do?

termtap to reveal ↺
Definition

Stores the return address (current PC) in M[X], then PC ← X + 1. AC is overwritten with X + 1. Return with JumpI X.

What does JnS X do?tap to flip back ↺
6.2 MARIE Architecture & Instruction Set

Encode AddI 20F

termtap to reveal ↺
Definition

Opcode B + address 20F → B20F = 1011 0010 0000 1111.

Encode AddI 20Ftap to flip back ↺
6.2 MARIE Architecture & Instruction Set

Purpose of the AC/MBR/ALU dedicated path

termtap to reveal ↺
Definition

Lets AC ← AC ± MBR return the ALU result to the AC without using the common bus (signal LALTL_{ALT}).

Purpose of the AC/MBR/ALU dedicated pathtap to flip back ↺
6.2 MARIE Architecture & Instruction Set

How many opcodes can MARIE encode?

termtap to reveal ↺
Definition

4 bits → 16; MARIE uses 15 (0–E), leaving F free.

How many opcodes can MARIE encode?tap to flip back ↺
6.3 Fetch–Decode–Execute & RTL

RTL of fetch

termtap to reveal ↺
Definition

MAR ← PC; IR ← M[MAR]; PC ← PC + 1.

RTL of fetchtap to flip back ↺
6.3 Fetch–Decode–Execute & RTL

RTL of decode

termtap to reveal ↺
Definition

MAR ← IR[11–0]; the control unit decodes IR[15–12].

RTL of decodetap to flip back ↺
6.3 Fetch–Decode–Execute & RTL

When is "get operand" (MBR ← M[MAR]) used?

termtap to reveal ↺
Definition

Only when the instruction reads a value from memory: Load, Add, Subt, the indirect instructions. Not for Store, Halt, Jump, Clear, Input, Output, Skipcond.

When is "get operand" (MBR ← M[MAR]) used?tap to flip back ↺
6.3 Fetch–Decode–Execute & RTL

What is in the PC while an instruction executes?

termtap to reveal ↺
Definition

The address of the next instruction, because the PC was incremented during fetch.

What is in the PC while an instruction executes?tap to flip back ↺
6.3 Fetch–Decode–Execute & RTL

Registers changed by fetch

termtap to reveal ↺
Definition

MAR, IR and PC. MBR and AC are untouched.

Registers changed by fetchtap to flip back ↺
6.3 Fetch–Decode–Execute & RTL

Trace table convention

termtap to reveal ↺
Definition

One row per microoperation, values after the step; only the destination register changes (fetch also increments PC); unchanged values are copied down.

Trace table conventiontap to flip back ↺
6.3 Fetch–Decode–Execute & RTL

Memory reads for the addition program (Load, Add, Store, Halt)

termtap to reveal ↺
Definition

4 fetches + 2 operand reads = 6 reads, plus 1 write (Store).

Memory reads for the addition program (Load, Add, Store, Halt)tap to flip back ↺
6.3 Fetch–Decode–Execute & RTL

Interrupt handling in the cycle

termtap to reveal ↺
Definition

After execute, check for an interrupt; if pending, save PC/state, run the interrupt service routine, restore, continue. MARIE's basic cycle omits this.

Interrupt handling in the cycletap to flip back ↺
6.4 MARIE Assembly & the Assembler

Assembler pass 1

termtap to reveal ↺
Definition

Walk the source with a location counter from ORG; record each label → address in the symbol table; LC + 1 per instruction or DEC/HEX word.

Assembler pass 1tap to flip back ↺
6.4 MARIE Assembly & the Assembler

Assembler pass 2

termtap to reveal ↺
Definition

Substitute label addresses into operands, convert DEC/HEX constants to 16-bit hex, emit machine words.

Assembler pass 2tap to flip back ↺
6.4 MARIE Assembly & the Assembler

Why a two-pass assembler?

termtap to reveal ↺
Definition

Forward references: a label may be used before the line that defines it.

Why a two-pass assembler?tap to flip back ↺
6.4 MARIE Assembly & the Assembler

Directives ORG, DEC, HEX, END

termtap to reveal ↺
Definition

ORG n: start at hex address n. DEC n / HEX n: one data word in decimal / hex. END: end of source. They are assembler instructions, not CPU instructions.

Directives ORG, DEC, HEX, ENDtap to flip back ↺
6.4 MARIE Assembly & the Assembler

Assemble DEC -23

termtap to reveal ↺
Definition

23 = 0017 → invert FFE8 → +1 → FFE9.

Assemble DEC -23tap to flip back ↺
6.4 MARIE Assembly & the Assembler

If (X > Y) pattern

termtap to reveal ↺
Definition

Load X / Subt Y / Skipcond 800 / Jump Else then the THEN part; the Jump is skipped when X − Y > 0.

If (X > Y) patterntap to flip back ↺
6.4 MARIE Assembly & the Assembler

Subroutine skeleton

termtap to reveal ↺
Definition

JnS Sub ... Sub, HEX 0000 (return address), body, JumpI Sub. Parameters go through agreed memory locations (no stack).

Subroutine skeletontap to flip back ↺
6.4 MARIE Assembly & the Assembler

Why place data after Halt?

termtap to reveal ↺
Definition

The CPU cannot tell data from instructions; running into DEC 35 would execute 0023 as JnS 023.

Why place data after Halt?tap to flip back ↺
7.1 Control Unit & Microprogramming

P2P1P0P_2P_1P_0 vs P5P4P3P_5P_4P_3

termtap to reveal ↺
Definition

P2P1P0P_2P_1P_0 = number of the register read onto the bus (source); P5P4P3P_5P_4P_3 = number of the register written from the bus (destination).

P2P1P0P_2P_1P_0 vs P5P4P3P_5P_4P_3tap to flip back ↺
7.1 Control Unit & Microprogramming

ALU codes A1A0A_1A_0

termtap to reveal ↺
Definition

00 nothing, 01 add, 10 subtract, 11 clear. With LALTL_{ALT} the AC loads the ALU result.

ALU codes A1A0A_1A_0tap to flip back ↺
7.1 Control Unit & Microprogramming

Signals for Add X

termtap to reveal ↺
Definition

T3T_3: P3P2P1P0T3P_3P_2P_1P_0T_3; T4T_4: P4P3T4MRP_4P_3T_4M_R; T5T_5: CrA0P5T5LALTC_rA_0P_5T_5L_{ALT}.

Signals for Add Xtap to flip back ↺
7.1 Control Unit & Microprogramming

Signals for Load X step AC ← MBR

termtap to reveal ↺
Definition

P5 P1 P0 T5 CrP_5\ P_1\ P_0\ T_5\ C_r: MBR (011) onto the bus, AC (100) loads; no ALU, no LALTL_{ALT}.

Signals for Load X step AC ← MBRtap to flip back ↺
7.1 Control Unit & Microprogramming

Role of CrC_r

termtap to reveal ↺
Definition

Counter reset: returns the timing ring counter to T0T_0; placed on the last step of each instruction.

Role of CrC_rtap to flip back ↺
7.1 Control Unit & Microprogramming

Hardwired control unit parts

termtap to reveal ↺
Definition

Instruction decoder (AND of opcode bits), ring counter for TnT_n, and OR-of-AND logic: each signal = Σ(instruction · TnT_n).

Hardwired control unit partstap to flip back ↺
7.1 Control Unit & Microprogramming

Microprogrammed control

termtap to reveal ↺
Definition

Each instruction runs a microroutine from a control store; one microinstruction is fetched per clock into a buffer, decoded into control signals. A computer in miniature.

Microprogrammed controltap to flip back ↺
7.1 Control Unit & Microprogramming

MARIE microinstruction format

termtap to reveal ↺
Definition

18 bits: MicroOp1 (5) | MicroOp2 (5) | Jump (1) | Dest (7). Routine ends with Jump = 1, Dest = 0000000 (back to fetch).

MARIE microinstruction formattap to flip back ↺
7.1 Control Unit & Microprogramming

Microcode for MARIE fetch (lines 0–3)

termtap to reveal ↺
Definition

01010 MAR ← PC; 00110 IR ← M[MAR]; 10001 PC ← PC + 1; 01000 MAR ← IR[11–0]; MicroOp2 NOP, Jump 0.

Microcode for MARIE fetch (lines 0–3)tap to flip back ↺
7.1 Control Unit & Microprogramming

Hardwired vs microprogrammed trade-off

termtap to reveal ↺
Definition

Hardwired is faster (RISC). Microprogrammed is slower but easy to change and good for complex instructions (CISC).

Hardwired vs microprogrammed trade-offtap to flip back ↺