Human-oriented DFA for the CSC-1

This shows the sequence of signals that must occur for each instruction of the CSC-1. A "subroutine" notation is used to avoid having to refer to the same sets of signals each time. For instance, the chunk "Load Instruction" is used for each instruction. To avoid duplicating this code all the time, we use the chunk. This is not how it is really done. Instead, the states for each instruction all go through "Load instruction" and then branch off to the specific instruction. See dfa.html.

The notation MARMUX=01 means there are two wires labeled MARMUX1 and MARMUX0. MARMUX1 is set to 0, and MARMUX0 is set to 1. F=011 means F2=0, F1=1 and F0=1.

CHUNK:  "Load Instruction"

	MARMUX=01
	MARLD=1
	MARLD=0   MA=1   WR=0   MBRMUX=10
	MBRLD=1
	MBRLD=0   MA=0   PCINCR=1   IRLD=1
	IRLD=0   PCLD=1
	PCINCR=0   PCLD=0
	
CHUNK:     "Fetch operand"

	MARMUX=00
	MARLD=1
	MARLD=0   MA=1   WR=0   MBRMUX=10
	MBRLD=1
	MBRLD=0   MA=0
	TMPLD=1
	TMPLD=0

CHUNK:     "Store back into A"

	AMUX=00
	ALD=1
	ALD=0

INSTRUCTION:  ADD

	Use Chunk "Load Instruction"
	Use Chunk "Fetch Operand"
	F=101   SH=00
	Use Chunk "Store back into A"

INSTRUCTION:  SUB

	Use Chunk "Load Instruction"
	Use Chunk "Fetch Operand"
	F=110   SH=00
	Use Chunk "Store back into A"

INSTRUCTION:  AND

	Use Chunk "Load Instruction"
	Use Chunk "Fetch Operand"
	F=010   SH=00
	Use Chunk "Store back into A"

INSTRUCTION:  OR

	Use Chunk "Load Instruction"
	Use Chunk "Fetch Operand"
	F=011  SH=00
	Use Chunk "Store back into A"

INSTRUCTION:  NOT

	Use Chunk "Load Instruction"
	Use Chunk "Fetch Operand"
	F=100   SH=00
	Use Chunk "Store back into A"

INSTRUCTION:  LOD

	Use Chunk "Load Instruction"
	Use Chunk "Fetch Operand"
	F=00   SH=00
	Use Chunk "Store back into A"

INSTRUCTION:  LDI

	Use Chunk "Load Instruction"
	AMUX=11
	ALD=1
	ALD=0

INSTRUCTION:  STD

	Use Chunk "Load Instruction"
	MARMUX=00
	MARLD=1
	MARLD=0  MBRMUX=01
	MBRLD=1
	MBRLD=0  MA=1  WR=1
	MA=0  WR=0

INSTRUCTION:  STS

	Use Chunk "Load Instruction"
	MARMUX=10
	MARLD=1
	MARLD=0  MBRMUX=01
	MBRLD=1
	MBRLD=0  MA=1  WR=1
	MA=0  WR=0

INSTRUCTION:  LDS

	Use Chunk "Load Instruction"
	MARMUX=10
	MARLD=1
	MARLD=0  MA=1  WR=0  MBRMUX=10
	MBRLD=1
	MBRLD=0  MA=0  AMUX=01
	ALD=1
	ALD=0

INSTRUCTION:  A2S

	Use Chunk "Load Instruction"
	SMUX=1
	SLD=1
	SLD=0

INSTRUCTION:  S2A

	Use Chunk "Load Instruction"
	AMUX=10
	ALD=1
	ALD=0

INSTRUCTION:  SHL

	Use Chunk "Load Instruction"
	F=000   SH=10
	Use Chunk "Store back into A"

INSTRUCTION:  SHR

	Use Chunk "Load Instruction"
	F=000   SH=01
	Use Chunk "Store back into A"

INSTRUCTION:  JMP

	Use Chunk "Load Instruction"
	PCMUX=1
	PCLD=1
	PCLD=0

INSTRUCTION:  JC

	Use Chunk "Load Instruction"
	PCMUX=1
	PCLD=C
	PCLD=0

INSTRUCTION:  JN

	Use Chunk "Load Instruction"
	PCMUX=1
	PCLD=N
	PCLD=0

INSTRUCTION:  JP

	Use Chunk "Load Instruction"
	PCMUX=1
	PCLD=~N & ~Z
	PCLD=0

INSTRUCTION:  JV

	Use Chunk "Load Instruction"
	PCMUX=1
	PCLD=V
	PCLD=0

INSTRUCTION:  JZ

	Use Chunk "Load Instruction"
	PCMUX=1
	PCLD=Z
	PCLD=0

INSTRUCTION:  CAL

	Use Chunk "Load Instruction"
	SMUX=0   PCMUX=1
	SLD=1   PCLD=1
	SLD=0   PCLD=0

INSTRUCTION:  RET

	Use Chunk "Load Instruction"
	PCMUX=0
	PCLD=1
	PCLD=0

INSTRUCTION:  NOP
	Use Chunk "Load Instruction"

INSTRUCTION:  HLT
	Use Chunk "Load Instruction"
	(Go into an infinite loop)

Fixed Oct. 7, 2002