Download presentation
Presentation is loading. Please wait.
Published byMelinda Wright Modified over 6 years ago
1
Ghifar Parahyangan Catholic University Sept 12, 2011
AKT211 – CAO 03 – SAP-1 Ghifar Parahyangan Catholic University Sept 12, 2011
2
Outline SAP-1 Characteristic SAP-1 Architecture SAP-1 Components
SAP-1 Instruction Set & Cycle
3
SAP Overview Simple As Possible
Describe the simplest computer workings Designed for academic purposes only 1st step evolution to advanced computer development
4
SAP-1 Characteristics Hardwire Architecture 2 8-bit general registers
1 8-bit output registers 8-bit ALU (additional, subtraction) 4-bit instructions and 4-bits operands (cccc oooo) cccc = OP CODE oooo = OPERAND 16x8 address RAM for mixed program and data 12 control signals
5
SAP-1 Architecture CPEPL’MCE’ L’IE’IL’AEA SUEUL’BL’O
6
Program Counter OUTPUT: 0000-1111 (0-F) CLK: Clock cycle
CLR: reset output to 0000 Cp: (PC) (PC)+1 Ep: (PC) bus W
7
Memory Address Register (MAR)
INPUT: 4 bits OUTPUT: 8 bits CLK: Clock cycle Lm: 0 : (MAR) bus W
8
Random Access Memory (RAM)
Store instruction & data INPUT: 8 bits from MAR OUTPUT: 8 bits to bus W CE: 0 : (RAM) bus W
9
Instruction Register (IR)
Read an instruction from RAM INPUT: 8 bits from RAM OUTPUT: 4 bits to bus W 4 bits to CU LI: 0 : (IR) 8-bit input EI: 0 : (IR) 4-bit bus W
10
CU/Sequencer Control all execution flow INPUT: 4 bits from IR OUTPUT:
12 bits to be distributed to all components (microinstruction) CPEPL’MCE’ L’IE’IL’AEA SUEUL’BL’O
11
Accumulator (ACC) Register buffer for storing temporary computation result INPUT : 8-bit from bus W OUTPUT : 8-bit to bus W 8-bit to ALU L’A : 0 : ACC bus W EA : 1 : ACC bus W
12
ALU Adder & Subtractor Only INPUT : Output : SU : EU : 8-bit from ACC
8-bit from B register Output : 8-bit to bus W SU : 1 : substract 0 : add EU : 1 : ALU bus W
13
B Register Buffer for arithmetic operation INPUT : 8-bit from bus W
Output : 8-bit to ALU L’B : 0 : B bus W
14
Output Register Output port INPUT : 8-bit from ACC via bus W
The processed data can be accessed by output device via this register INPUT : 8-bit from ACC via bus W OUTPUT : 8-bit to output device L’O : 0 : Output Register bus W
15
Binary Display An output device that consists of 8 LEDs
can be changed with any other output devices
16
Instruction Set 1 LDA Load memory data to acc. 0000 2 ADD
# Mnemonic Operand Num Operation Opcode 1 LDA Load memory data to acc. 0000 2 ADD Add acc. with memory data 0001 3 SUB Sub acc. with memory data 0010 4 OUT Move out the acc. Data 1110 5 HLT Stop program 1111
17
Instruction Cycle Fetch Cycle Execution Cycle T1 (Address State)
T2 (Increment State) T3 (Memory State) Execution Cycle 3 step (T4, T5, T6), but the task of each steps depends on the instruction
18
Fetch Cycle - T0 (Initial State)
CON= CP EP L’M C’E L’I E’I L’A EA SU EU L’B L’O 1
19
T1 (Address State) CON= CP EP L’M C’E L’I E’I L’A EA SU EU L’B L’O 1
20
T2 (Increment State) Increment the value of PC CON= CP EP L’M C’E L’I
L’A EA SU EU L’B L’O 1 Increment the value of PC
21
T3 (Memory State) CON= CP EP L’M C’E L’I E’I L’A EA SU EU L’B L’O 1
22
Exectution Cycle (LDA Instruction)
For LDA instruction, only T4 and T5 states that will be actived T4 : memory address is sent from IR to MAR T5 : data from memory is fetched and send to ACC T6 : do nothing ! = T0
23
T4 (send IR value to MAR) CON= CP EP L’M C’E L’I E’I L’A EA SU EU L’B
L’O 1
24
T5 (send RAM data to ACC) CON= CP EP L’M C’E L’I E’I L’A EA SU EU L’B
L’O 1
25
Execution Cycle What about the execution cycle for ADD / SUB / OUT instruction ?
26
SAP-1 Programming Problem :
Write a program using SAP-1 computer that computes the following operation :
27
SAP-1 Programming (2) Solution :
Assign the data memory with this data: R9= (16),RA= (20), RB= (24),RC= (28), RD= (32) The codes: LDA R9 ADD RA ADD RB ADD RC SUB RD OUT HLT
28
SAP-1 Programming (3) PROGRAM/DATA MEMORY Press start button
R (LDA R9) R (ADD RA) R (ADD RB) R (ADD RC) R (SUB RD) R xxxx (OUT) R xxxx (HLT) R7 - xxxx xxxx R8 - xxxx xxxx R (16) RA (20) RB (24) RC (28) RD (32) RE - xxxx xxxx RF - xxxx xxxx Press start button (PC) 0000 Start LDA R9 (MAR) (PC) fetch T1 (MAR)= 0000 R(MAR) (R) = (R0) (PC) (PC)+1 fetch T2 (PC) = 0001 IR fetch T3 (MAR) IR(low) exec T4 (MAR)= 1001 (ACC) R(MAR) exec T5 (ACC)= 16 {NOOP} exec T6 ADD RA (MAR) (PC) fetch T1 (MAR)= 0001 R(MAR) (R)= (R1) (PC) (PC)+1 fetch T2 (PC) = 0010 IR fetch T3 (MAR) IR(low) exec T4 (MAR)= 1010 (B) R(MAR) exec T5 (B)= (RA) (ACC) (ACC)+(B) exec T6 (ACC)= 16+20 ADD RB .
29
Busicom 141-PF 1st ever with a microprocessor powered by Intel 4004
more instruction sets compared to SAP-1 (46 : 5) Output : printer
30
THANK YOU
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.