Sap 1
Sap 1
Computer
S. M. Raiyan Chowdhury
June 10, 2023 CSE 442: Microprocessor and Interfacing Lecturer, Dept of EEE, EWU
Grad Student, BUET
S. M. Raiyan Chowdhury
June 10, 2023 CSE 442: Microprocessor and Interfacing Lecturer, Dept of EEE, EWU
Grad Student, BUET
Instruction Set
1. LDA <memory address>
accumulator=content of memory address
2. ADD <memory address>
accumulator<=acc + content of memory.
3. SUB <memory address>
accumulator<=acc - content of memory.
5. HLT
-stops clock
S. M. Raiyan Chowdhury
June 10, 2023 CSE 442: Microprocessor and Interfacing Lecturer, Dept of EEE, EWU
Grad Student, BUET
Example
25-9+10-18=?
-Load 25 in accumulator
-Subtract 9 from 25
-Add 10 with the result
-Subtract 18
-Show output
S. M. Raiyan Chowdhury
June 10, 2023 CSE 442: Microprocessor and Interfacing Lecturer, Dept of EEE, EWU
Grad Student, BUET
Example
25-9+10-18=?
Source Machine F 00010010 7 XXXXXXXX
Code Code E 00001010 6 XXXXXXXX
LDA CH 00001100 D 00001001 5 1111XXXX
SUB DH 00101101 C 00011001 4 1110XXXX
ADD EH 00011110 B XXXXXXXX 3 00101111
SUB FH 00101111 A XXXXXXXX 2 00011110
OUT 1110XXXX 9 XXXXXXXX 1 00101101
HLT 1111XXXX 8 XXXXXXXX 0 00001100
S. M. Raiyan Chowdhury
June 10, 2023 CSE 442: Microprocessor and Interfacing Lecturer, Dept of EEE, EWU
Grad Student, BUET
Control Word
CON =
= 00 1 1 1 1 1 0 0011
= 3E3 H
S. M. Raiyan Chowdhury
June 10, 2023 CSE 442: Microprocessor and Interfacing Lecturer, Dept of EEE, EWU
Grad Student, BUET
Timing (T) States
• Controller/Sequencer controls all the
operations. Each instruction is executed
through a series of step. Each such step
is called a Timing state (T state)
• The 6-bit Ring Counter produces 6 T
states for SAP-1
• Different CON words are produced in
different T states
S. M. Raiyan Chowdhury
June 10, 2023 CSE 442: Microprocessor and Interfacing Lecturer, Dept of EEE, EWU
Grad Student, BUET
T states
S. M. Raiyan Chowdhury
June 10, 2023 CSE 442: Microprocessor and Interfacing Lecturer, Dept of EEE, EWU
Grad Student, BUET
Fetch Cycle : T1
S. M. Raiyan Chowdhury
June 10, 2023 CSE 442: Microprocessor and Interfacing Lecturer, Dept of EEE, EWU
Grad Student, BUET
Fetch Cycle : T2
S. M. Raiyan Chowdhury
June 10, 2023 CSE 442: Microprocessor and Interfacing Lecturer, Dept of EEE, EWU
Grad Student, BUET
Fetch Cycle : T3
S. M. Raiyan Chowdhury
June 10, 2023 CSE 442: Microprocessor and Interfacing Lecturer, Dept of EEE, EWU
Grad Student, BUET
Execution Cycle : T4 <LDA>
S. M. Raiyan Chowdhury
June 10, 2023 CSE 442: Microprocessor and Interfacing Lecturer, Dept of EEE, EWU
Grad Student, BUET
Execution Cycle : T5 <LDA>
S. M. Raiyan Chowdhury
June 10, 2023 CSE 442: Microprocessor and Interfacing Lecturer, Dept of EEE, EWU
Grad Student, BUET
Execution Cycle : T6 <LDA>
NOP
S. M. Raiyan Chowdhury
June 10, 2023 CSE 442: Microprocessor and Interfacing Lecturer, Dept of EEE, EWU
Grad Student, BUET
Microprogramming
• Each control word is called a microinstruction
S. M. Raiyan Chowdhury
June 10, 2023 CSE 442: Microprocessor and Interfacing Lecturer, Dept of EEE, EWU
Grad Student, BUET