Professional Documents
Culture Documents
Architecture
Simple As Possible- 2
Microprocessor
Design
SAP-2 Registers
SAP-2 Registers
Accumulator
The high LB and positive clock edge load the word on the W bus into the B register. The twostate output of the B register drives the ALU.
It has 4 select bits that determine the arithmetic and logic operation performed on words A
and B.
The select bits S3 through S0 cover 0000 through 1111, which can select 16 arithmetic and
logic functions. SAP-2 uses three arithmetic functions (NULL, ADD, SUB) and seven logic
functions (Complement A, Complement B, OR, AND, NOR, NAND, and XOR).
B Register
The two-state output goes directly to the arithmetic logic unit ALU. The three-state output
goes to the W bus. Therefore, the 12-bit accumulator word continuously drives the ALU; the
same word appears on the W bus when EA is high.
Interface circuits convert signals from peripheral devices to binary signals suitable for entry
into a computer. A high LN load this word into the Input register and a high EN can read the
input word onto the W bus for transfer to the accumulator.
The index register has an increment input INX and a decrement input DEX.
High INX means index register counts up; High DEX means it counts down.
The output register connects to an interface circuit. The interface circuit converts the contents
of the output register into signals suitable for driving the peripheral devices.
STA
Example:
Jump Instructions
JMP
LP
CLK
CLK
EI
PC
IR
CON
High EI and LP
T3 Phase of JMP Instruction
8-bit address
Field
R40
R41
.
.
.
R50
R51
R52
R53
= ADD 80
= SUB 81
=
=
=
=
STA 91
SUB 92
LDX 93
JMP 40
R48
R49
R50
R51
R52
.
.
.
R70
=
=
=
=
=
LDX 95
ADD 96
JMP 70
ADD 97
STA 98
= LDX 83
JAM
JAZ
JMS
Example:
Describe what happens during the execution
of this program:
R0
R1
R2
R3
R4
R5
R6
R7
=
=
=
=
=
=
=
=
LDA 6
SUB 7
JAM 5
JAZ 5
JMP 1
HLT
2510
910
=
=
=
=
=
=
=
=
=
LDA 6
JMS A2
ADD 7
JMS C5
STA 8
HLT
40010
8010
(ANSWER)
OPERATE INSTRUCTIONS
NOP
NOP mnemonic for no operation.
During
the
execution
of
a
NOP
instructions, all the phases are do
nothings. Therefore, nothing happens
when a NOP is executed.
CLA
CLA means clear the accumulator.
The execution of a CLA resets
accumulator bits to zero.
all
XCH
XCH is the mnemonic for exchange
accumulator and index.
During the execution of an XCH, the words
in the accumulator and index register are
interchanged.
DEX
decrement
DEX
means
the
index
register.
The execution of a DEX decreases the
contents of the index register by one.
INX
INX means increment the index register.
This instruction adds one to the index
register.
CMA
for
complement
CMA
stands
the
accumulator.
The execution of a CMA inverts each bit in
the
accumulator,
producing
1s
complement.
CMB
for complement
CMB stands
the B
register.
This instruction inverts each bit in the B
register, resulting in the 1s complement.
IOR
IOR means inclusive OR, identical to the
OR function. The execution of an IOR will
OR the corresponding bits in the
accumulator and B register, the result
appears in the accumulator.
INP
INP means input. This instruction is
executed in two phases. The first
execution phase loads the input register
with a word from the interface circuit. The
second execution phase transfers this
word to the accumulator.
OUT
OUT stands for output. When the
instruction is executed, the accumulator
word is loaded into the output register.
SAP-2 Programming
Create a
program a
program that
multiplies two
integers. Use
12 and 8 for
this example.
SAP-2 Programming
Instruction Register