Add 5 to ACC
; Add 5 to the value stored in the Accumulator.
Stop
; Stop Executing new instructions.
In memory the program will look similar to what is shown below.
Address
Contents
Comments
0
0
The ‘Load ACC’ Opcode
1
3
The number ‘3’ to be loaded into the
Accumulator
2
1
The ‘Add to ACC’ Opcode.
3
5
The number 5 to be added to the
Accumulator
4
2
The ‘stop’ Opcode
This program added the number 3 and 5 and stored the result in the accumulator. We
reset our microprocessor after this operation using the Reset line. This program is
executed perfectly by the microprocessor.
Task 5-9: Add the ‘XOR’, ‘Zero’, ‘Subtract’, and ‘Store Acc’
Instructions.
FIRST we add the ‘XOR’ Instructions in to our PROM
Description
Instructions
XOR
Opcode
3
Pres.State
00
01
02
03
Pin Number

Subscribe to view the full document.
NextStateBits
Load IR
Write
Read
ACC to DataBus
Load ACC
Load MAR
Use PC
/~A_Only
/~Invert
Logic/~Arith
X
X
X
X
1-0
2
3
4
5
6
7
8
9
10
11
12
13
14
15
01
1
0
00
0
0
00
0
0
00
0
0
1
0
0
0
1
0
1
0
0
0
0
0
0
0
0
0
1
X
X
X
1
1
1
1
0
0
0
0
0
0
0
0
X
X
X
X
X
X
X
X
0
0
0
0
0
0
0
0
Hex Equivalent
0115
0F50
0000
0000
Testing:
I like to XOR number 5 and 4
Shown below are the Address and contents of the Rom. Also we see the corresponding
functions performed by the Prom.
Address
Contents
Comments
0
0
;The ‘Load ACC’ Opcode
1
4
;The number ‘4’ to be loaded in to theAccumulator
2
3
; The ‘XOR’ Opcode
3
5
;The number 5 to be XORed to the Accumulator
4
2
;The ‘Stop’ Opcode
As we see if we XOR 4 and 5 bit by bit we should get the result 1.
This function takes four clock pulses to finish the task.
SECOND: In this task we will subtract accumulator from itself and store the result(0)
back in to the accumulator.

In this task I like to load 6 to Accumulator and subtract it from itself.
Description
Instructions
ZERO
Opcode
4
Pres.State
00
01
02
03
Pin Number
NextStateBits
Load IR
Write
Read
ACC to DataBus
Load ACC
Load MAR
Use PC
/~A_Only
/~Invert
Logic/~Arith
X
X
X
X
1-0
2
3
4
5
6
7
8
9
10
11
12
13
14
15
01
1
0
00
0
0
00
0
0
00
0
0
1
0
0
0
0
1
1
0
0
0
0
0
0
0
0
0
1
X
X
X
1
1
0
0
0
0
0
0
0
0
0
0
X
X
X
X
X
X
X
X
0
0
0
0
0
0
0
0
Hex Equivalent
0115
0360
0000
0000
Shown below are the Address and contents of the Rom. Also we see the corresponding
functions performed by the Prom.
Address
Contents
Comments
0
0
;The ‘Load ACC’ Opcode
1
6
;The number ‘6’ to be loaded in to theAccumulator
2
4
; The ‘ZERO’ Opcode

Subscribe to view the full document.
It takes four clock pulses to accomplish the function.
THIRD: In this task I like to perform the subtraction function of 7 and 3.
Description
Instructions
Subtract
Opcode
5
Pres.State
00
01
02
03
Pin Number
NextStateBits
Load IR
Write
Read
ACC to DataBus
Load ACC
Load MAR
Use PC
/~A_Only
/~Invert
Logic/~Arith
X
X
X
X
1-0
2
3
4
5
6
7
8
9
10
11
12
13
14
15
01
1
0
00
0
0
00
0
0
00
0
0
1
0
0
0
1
0
1
0
0
0
0
0
0
0
0
0
1
X
X
X
1
1
0
0
0
0
0
0
0
0
0
0
X
X
X
X
X
X
X
X
0
0
0
0
0
0
0
0
Hex Equivalent
0115
0350
0000
0000
Shown below are the Address and contents of the Rom. Also we see the corresponding
functions performed by the Prom.


- Spring '18