MMSD - Part 2 - SAP Computer
MMSD - Part 2 - SAP Computer
Part 2
SAP-1 COMPUTER
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
27
SAP Computer
Ø Simple as Possible Computer
Ø The beginner s computer
Ø SAP-I is the first stage in the
evolution toward modern
computers.
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
28
Program Counter
Ø A 4-bit Counter
Ø Counts from 0000 to 1111
Ø Sometimes called a POINTER
‒ It points to an address in
memory where something
important is being stored.
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
29
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
30
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
31
Instruction Register
Ø The instruction register is part of the
control unit.
Ø To fetch instruction from the memory
the computer does a memory read
operation.
Ø This places the contents of the
addressed memory location on the W
bus.
Ø At the same time, the instruction
register is set up for loading on the
next positive clock edge.
Ø The contents of the instruction
register are split into two nibbles.
§ Upper nibble is a two-state output that
goes directly to the block labeled
"Controller-sequencer. "
§ Lower nibble is a three-state output
that is read onto the W bus when
needed.
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
32
Controller/ Sequencer
Ø A combinational circuit that
produces a 12-bit word that
controls the rest of a
computer.
Ø It supervises the over-all
operation
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
33
Accumulator A
Ø A buffer register that
contains the immediate
answers
Ø Has two output:
§ Goes to the W bus
§ Goes to the Adder/ Subtractor
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
34
Adder/ Subtracter
Ø A combinational circuit used
to perform addition or
subtraction
Ø The contents coming from
accumulator A and B register
is added or subtracted
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
35
B Register
Ø Another buffer register
Ø Holds the number coming
from the W bus to be added
or subtracted from the
content of the accumulator A
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
36
Output Register
Ø This is where the output is
temporarily stored
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
37
Binary Display
Ø Has 8 LEDs to display the 8-
bit output data word
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
38
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
39
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
40
LDA
Ø Load the Accumulator
Ø Example:
LDA AH
Ø Put the contents of the
memory location AH (1010)
to the Accumulator A
Ø This is a MEMORY REFERENCE
INSTRUCTION because it
involves data stored in the
memory.
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
41
ADD
Ø Add a value to the contents
of the accumulator.
Ø Example:
ADD 8H
Ø Add the value in the
memory location 8H (1000)
to the contents of the
Accumulator
Ø This is a memory reference
instruction
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
42
SUB
Ø Subtract a value from
contents of the accumulator
Ø Example:
SUB DH
Ø Subtract the value in the
memory location DH (1101)
from the contents of the
Accumulator
Ø This is a memory reference
instruction
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
43
OUT
Ø The instruction OUT tells the
SAP-I computer to transfer
the accumulator contents to
the output port.
Ø Example:
OUT
Ø Complete by itself, no
memory address is required
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
44
HLT
Ø Stands for halt
Ø This tells the computer to
stop processing data
Ø Marks the end of a program
Ø Example:
HLT
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
45
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
46
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
47
Op Codes
Ø Binary representation of the Mnemonic Op Code
LDA 0000
instructions to load it to the
ADD 0001
computer. SUB 0010
Ø This tells the computer which OUT 1110
operation to perform HLT 1111
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
48
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
49
Address Mnemonics
SAP-1 Programming 0H
1H
LDA 8H
ADD 9H
2H ADD AH
Ø EXAMPLE 1: Simulate the 3H SUB BH
SAP-1 program shown. 4H SUB CH
5H OUT
6H HLT
7H FFH
8H 0AH
9H 05H
AH 07H
BH 0CH
CH 09H
DH FFH
EH FFH
FH FFH
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
50
Address Mnemonics
SAP-1 Programming 0H
1H
2H
Ø EXAMPLE 2: Create a SAP-1 3H
program that performs the 4H
5H
following operation:
6H
7H
Decimal: 55 ‒ 10 + 39 ‒ 73 + 21 8H
9H
AH
BH
CH
DH
EH
FH
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
51
52
Fetch Cycle
Ø The control unit generates the Ø Ring Counter
control words that fetch and
execute each instruction.
Ø While each instruction is
fetched and executed, the
computer passes through
different timing states (T
states), periods during register
contents change.
Ø The ADDRESS, INCREMENT, and
MEMORY states are called the
fetch cycle of SAP-I.
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
53
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
54
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
55
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
56
Execution Cycle
Ø The next three states (T4, T5, Ø Different SAP-I instructions
and T6) are the execution has different control
cycle of SAP-I. routines.
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
57
LDA Routine
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
58
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
59
OUT Routine
Ø Suppose the instruction
register contains the OUT
instruction at the end of a fetch
cycle. Then
IR = 1110 XXXX
60
HLT
Ø HLT does not require a Ø The controller-sequencer
control routine because no stops the computer by
registers are involved in the turning off the clock.
execution of an HLT
instruction.
Ø When the IR = 1111 XXXX, the
instruction field 1111 signals
the controller-sequencer to
stop processing data.
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
61
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
62
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
63
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
64
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
65
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
66
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
67
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
68
ASSIGNMENT 2.1
ØSAP-1 Programming.
1. Write a SAP-1 assembly and machine program that
performs the following operations: Decimal: 176 + 191
‒ 43 + 113 + 384. Simulate your program by
identifying the hex and binary content of the
accumulator in each step of your program. Explain the
output of the program.
2. Explain how the product of 12 x 21 can (or cannot) be
programmed using the SAP 1 computer.
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
69
ASSIGNMENT 2.2
ØSAP Computer Generations.
1. Compare and contrast SAP1, SAP2 and SAP3
computers in terms of their Hardware Architecture and
Instruction Sets.
2. Create an infographic about the evolution of
microprocessors and write a discussion about it.
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com
70