0% found this document useful (0 votes)
117 views22 pages

MMSD - Part 2 - SAP Computer

Uploaded by

Ronin Beltran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
117 views22 pages

MMSD - Part 2 - SAP Computer

Uploaded by

Ronin Beltran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

2/19/24

Fernando Victor V. de Vera, ECE, M.Tech


Electronics Engineering Department

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

This material is coyrighted. For information,


contact +639228211379 or mailto:
fvictordevera@gmail.com 1
2/19/24

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

Input and MAR


Ø MAR ‒ Memory Address
Register
Ø It includes the address and
data switch registers,
Ø These switch registers, which
are part of the input unit,
allow you to send 4 address
bits and 8 data bits to the
RAM.

© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com

30

This material is coyrighted. For information,


contact +639228211379 or mailto:
fvictordevera@gmail.com 2
2/19/24

Random Access Memory


Ø 16 x 8 static TTL RAM
Ø You can program the RAM by
means of the address and
data switch registers.
Ø This allows you to store a
program and data in the
memory before a computer
run.

© 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

This material is coyrighted. For information,


contact +639228211379 or mailto:
fvictordevera@gmail.com 3
2/19/24

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

This material is coyrighted. For information,


contact +639228211379 or mailto:
fvictordevera@gmail.com 4
2/19/24

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

This material is coyrighted. For information,


contact +639228211379 or mailto:
fvictordevera@gmail.com 5
2/19/24

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

This material is coyrighted. For information,


contact +639228211379 or mailto:
fvictordevera@gmail.com 6
2/19/24

© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com

39

SAP-1 Instruction Set


INSTRUCTION SET Ø SAP-1 Instruction Set:
1. LDA ‒ Load the Accumulator
Ø The basic operations that can 2. ADD ‒ Add a value to the
be performed by the SAP-1 contents of the accumulator
computer 3. SUB ‒ Subtract a value from
contents of the accumulator
4. OUT ‒ Transfer the contents
of the accumulator to the
output port
5. HLT - halt

© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com

40

This material is coyrighted. For information,


contact +639228211379 or mailto:
fvictordevera@gmail.com 7
2/19/24

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

This material is coyrighted. For information,


contact +639228211379 or mailto:
fvictordevera@gmail.com 8
2/19/24

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

This material is coyrighted. For information,


contact +639228211379 or mailto:
fvictordevera@gmail.com 9
2/19/24

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

Summary of Instruction Sets of SAP-1


MNEMONICS
MNEMONIC OPERATION Ø Memory aids
LDA Load RAM data into
accumulator Ø Abbreviated instructions
ADD Add RAM data to Ø Popular in computer work
accumulator
because they remind you of
SUB Subtract RAM data from
accumulator the operation that will take
OUT Load accumulator data into place when the instruction is
output register executed.
HLT Stop processing

© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com

46

This material is coyrighted. For information,


contact +639228211379 or mailto:
fvictordevera@gmail.com 10
2/19/24

SAP and 8080/8085


8080 Ø The SAP-I instructions LDA,
Ø The first widely used ADD, SUB, OUT, and HLT are
microprocessor 8080/8085 instructions.
Ø Has 72 instructions
Ø The SAP-2 and SAP3
8085 instructions will be part of
the 8080/8085 instruction
Ø An enhanced version of the set.
8080 with essentially the
same instruction set.

© 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

This material is coyrighted. For information,


contact +639228211379 or mailto:
fvictordevera@gmail.com 11
2/19/24

Assembly and Machine Languages


ASSEMBLY LANGUAGE MACHINE LANGUAGE

Ø Involves working with Ø Involves working with binary


mnemonics when writing a (1s and 0s)
program. Ø The program is the OBJECT
Ø The program is the SOURCE PROGRAM
PROGRAM

© 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

This material is coyrighted. For information,


contact +639228211379 or mailto:
fvictordevera@gmail.com 12
2/19/24

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

Address Mnemonics Machine Language

SAP-1 Programming 0000


0001
0010
Ø EXAMPLE 3: Create a SAP-1 0011
machine program that 0100

performs the following 0101


0110
operation:
0111
1000
Decimal: 55 ‒ 10 + 39 ‒ 73 + 21 1001
1010
1011
1100
1101
1110
1111
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com

52

This material is coyrighted. For information,


contact +639228211379 or mailto:
fvictordevera@gmail.com 13
2/19/24

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

Address State (T1)


Ø T1 state is called the address
state because the address the
program counter (PC) is
transferred to the memory
address register (MAR)
during this state.

© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com

54

This material is coyrighted. For information,


contact +639228211379 or mailto:
fvictordevera@gmail.com 14
2/19/24

Increment State (T2)


Ø This state is called the
increment state because the
program counter is
incremented.

© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com

55

Memory State (T3)


Ø The T3 state is called the
memory state because the
addressed RAM instruction is
transferred from the memory
to the instruction register.

© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com

56

This material is coyrighted. For information,


contact +639228211379 or mailto:
fvictordevera@gmail.com 15
2/19/24

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.

Ø The register transfers during Ø Example: LDA 9H requires


the execution cycle depend different register transfers
on the particular instruction than ADD BH.
being executed.

© 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

This material is coyrighted. For information,


contact +639228211379 or mailto:
fvictordevera@gmail.com 16
2/19/24

ADD and SUB Routines

© 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

Ø The instruction field goes to the


controller-sequencer for
decoding. Then the controller-
sequencer sends out the
control word needed to load
the accumulator contents into
drs the output register.
© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com

60

This material is coyrighted. For information,


contact +639228211379 or mailto:
fvictordevera@gmail.com 17
2/19/24

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

SAP-1 Micro Program

© FERNANDO VICTOR V. DE VERA, ECE, M.TECH. Copyrighted material. Do not share. For inquiries, contact +639228211379 or mailto: fvictordevera@gmail.com

62

This material is coyrighted. For information,


contact +639228211379 or mailto:
fvictordevera@gmail.com 18
2/19/24

© 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

This material is coyrighted. For information,


contact +639228211379 or mailto:
fvictordevera@gmail.com 19
2/19/24

© 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

This material is coyrighted. For information,


contact +639228211379 or mailto:
fvictordevera@gmail.com 20
2/19/24

© 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

This material is coyrighted. For information,


contact +639228211379 or mailto:
fvictordevera@gmail.com 21
2/19/24

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

This material is coyrighted. For information,


contact +639228211379 or mailto:
fvictordevera@gmail.com 22

You might also like