UNIHIVE

Study Hub UNIPORT CSC 382

CSC 382 · Computer Architecture 1

A real simple mini-computer: the PDP-8

The architecture of DEC's PDP-8: its 12-bit word, memory pages, eight instructions, addressing and a short program.

Our notes

2 min read

Why the PDP-8

The PDP-8 (Digital Equipment Corporation, 1965) was the first commercially successful minicomputer and one of the simplest real computers ever sold, so it is a classic for studying a complete architecture.

The machine

  • 12-bit words; memory of 4,096 words (4 K, addresses 0000 to 7777 in octal).
  • Memory is divided into 32 pages of 128 words.
  • Registers: AC (12-bit accumulator), L (one-bit link, the carry), PC, plus MA and MB (memory address and buffer) and the IR.
  • Programmers write numbers in octal (4 octal digits = 12 bits).

Instruction format (memory reference)

Bits0-2345-11
Fieldopcodeindirect (I)page (Z: 0 page zero, 1 current page)offset in the page (7 bits)

So an instruction reaches 128 words on page zero or the current page directly; anything else is reached indirectly through a pointer.

The eight instructions

OpcodeMnemonicAction
0ANDAC ← AC AND M[EA]
1TADtwo's complement add: AC ← AC + M[EA] (carry flips L)
2ISZM[EA] ← M[EA] + 1; skip next instruction if the result is 0
3DCAM[EA] ← AC; AC ← 0 (deposit and clear)
4JMSjump to subroutine: M[EA] ← return address; PC ← EA + 1
5JMPPC ← EA
6IOTinput/output transfer
7OPRoperate: microcoded group (CLA clear AC, CMA complement, IAC increment, rotates, skips such as SZA skip if AC is zero, HLT)

There is no subtract or load: to load, clear AC then TAD; to subtract, complement and increment (CMA IAC) then TAD.

Worked example: C = A − B

Assume A at 0200 holds 9, B at 0201 holds 4, C at 0202.
CLA CLL
TAD 0201 AC = 4
CMA IAC AC = −4 (two's complement)
TAD 0200 AC = 9 − 4 = 5
DCA 0202 C = 5, AC = 0
HLT
The program shows how a tiny instruction set still does everything.

Loops with ISZ

Put −n in a counter word; ISZ it at the end of each pass: when it reaches 0 the next instruction (a JMP back) is skipped and the loop ends. For n = 10, store −10 (7766 octal).

Subroutines with JMS

JMS stores the return address in the subroutine's first word and starts at the next; the subroutine returns with JMP I to that first word. Simple, but it cannot handle recursion (one saved address per subroutine).

Exams usually ask

  • Describe the PDP-8's word size, memory organisation and registers.
  • Explain its instruction format and the eight instructions.
  • Write a short PDP-8 program (subtract, loop with ISZ).

Common mistake

Expecting a LOAD instruction. On the PDP-8 you clear AC (CLA) and add (TAD); DCA stores and clears at the same time.

Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.

No reading links here yet

Our team adds free books, videos and practice for each topic, and opens every link before it goes up.

All CSC 382 topics

Report

Sign in to report this. It is free.

Is this your work (a lecturer, author or publisher)? Ask us to take it down.