Assignment MSAP Final
Assignment MSAP Final
(Fall-22)
ASSIGNMENT ON
Modified Simple As Possible
Computer (MSAP)
Block Diagram of MSAP
D
CP 8 bit
Register Ld
Ed
EP Program CLK
LP 16 bit
CLK
counter
(16 bit)
C
Hexadecimal
8 bit
Register Lc
Ec
input pad
CLK
Input encoder
Ein and register 8/16 bit A
CLK (16 bit)
8 bit
Register La
Ea
CLK
W Bus
16 bit
MAR 16 bit Lf CLK
Lmr Eal
CLK
(16 bit)
S0
Flag
ALU S1 register
S2
Erm
R1
D 8 bit
E R1 RAM
R C W1 B
O R2 64 KB 8 bit
Register
W D Lb
E W1 W2 Eb
R 8 bit CLK
W2
8 bit
8 bit
R2 Temporary
8 bit Register Lt
Et
MDR CLK
Emd (16 bit)
DE
Lmd 16 bit no C O
Stack op. Es
DE
CLK
16 bit pointer (16 dec
inc
R Id
bit) En
C
LK
Lir Instruction
Output
CLK
Register 8 bit Eo
8 bit Register
(8 bit) CLK
(8 bit)
Control
CLK ROM
Display
CLK
26 Control Words
Explanation of control words:
Es, Id:
00= no operation
01= decrease stack pointer value by 1
10= increase stack pointer value by 1
11= Connects stack pointer register to bus
Group - A Group - B
Opcode Instruction Opcode Instruction
00 IN A 00 IN B
01 INC B 01 MOV C, B
02 MOV B, byte 02 MOV A, byte
03 MOV C, byte 03 RCL A
04 RCL A 04 MOV A, D
05 MOV D, B 05 XOR A, D
06 XOR A, D 06 INC B
07 OUT A 07 OUT A
08 HLT 08 HLT
Group - C Group - D
Opcode Instruction Opcode Instruction
00 IN C 00 IN D
01 MOV B, byte 01 MOV D, byte
02 MOV B, C 02 MOV B, D
03 MOV D, byte 03 MOV C, byte
04 XOR A, D 04 XOR A, D
05 MOV C, B 05 MOV B, C
06 RCL A 06 IN B
07 OUT C 07 OUT D
08 HLT 08 HLT
Group - E Group - F
Opcode Instruction Opcode Instruction
00 IN A 00 IN B
01 MOV B, byte 01 INC B
02 INC B 02 MOV C, B
03 MOV D, byte 03 MOV A, byte
04 XOR A, D 04 XOR A, D
05 MOV C, A 05 MOV B, D
06 RCL A 06 RCL A
07 OUT C 07 OUT B
08 HLT 08 HLT
Group Allocation
Group - G Group - H
Opcode Instruction Opcode Instruction
00 IN A 00 IN B
01 INC A 01 MOV A, B
02 MOV B, A 02 MOV D, byte
03 MOV D, byte 03 RCL A
04 RCL A 04 MOV C, D
05 MOV C, D 05 MOV D, byte
06 XOR A, D 06 INC B
07 OUT A 07 OUT B
08 HLT 08 HLT
Group - I Group - J
Opcode Instruction Opcode Instruction
00 IN C 00 IN D
01 MOV B, C 01 INC B
02 INC B 02 MOV D, B
03 MOV D, byte 03 MOV C, byte
04 XOR A, D 04 MOV A, C
05 MOV B, C 05 RCL A
06 RCL A 06 XOR A, D
07 OUT B 07 OUT A
08 HLT 08 HLT
Group - K Group - L
Opcode Instruction Opcode Instruction
00 IN A 00 IN B
01 INC B 01 INC B
02 RCL A 02 MOV A, B
03 MOV D, byte 03 MOV D, byte
04 XOR A, D 04 XOR A, D
05 MOV B, A 05 MOV B, A
06 MOV C, byte 06 RCL A
07 OUT B 07 OUT A
08 HLT 08 HLT
Group Allocation
ST Id ( A ) Group ST Id ( A) Group
190105001 A 190105032 A
190105002 B 190105033 B
190105003 C 190105035 C
190105006 D 190105036 D
190105007 E 190105038 E
190105008 F 190105041 F
190105009 G 190105042 G
190105011 H 190105044 H
190105012 I 190105045 I
190105014 J 190105046 J
190105015 K 190105047 K
190105016 L 190105049 L
190105017 A 190105050 A
190105019 B 190105051 B
190105020 C 190105052 C
190105021 D 160105180 D
190105022 E 170205040 E
190105024 F 170205088 F
190105025 G 180105108 G
190105026 H 180105129 H
190105027 I 180105197 I
190105028 J 180205007 J
190105029 K
190105031 L
Group Allocation
Assignment Instructions:
1. Write the control words for your instructions
2. Generate the .bin files for address and control ROMs by provided
MATLAB code
3. Load the necessary files on the circuit and verify your instruction