Sap-1 Architecture
Sap-1 Architecture
Sap-1 Architecture
The first four bits make the Opcode while the last four bits make the operand (address).
Program Counter:
The program/Instructions are stored at the beginning of the memory with the first instruction at
binary address 0000, the second at 0001 and so on. The PC is a part of the control unit. Its job is
to send to the memory address register, the address of the next instruction to be executed and
fetched. The PC is reset to 0000 before each computer run
RAM:
The RAM is a 16×8 static TTL (Transistor Transistor Logic) RAM. During a computer run, the
RAM receives 4-bit addresses from the MAR and a READ operation is performed. In this way,
the instruction or data word stored in the RAM is placed on the W-bus.
Instruction Register:
1) The instruction register is part of the control unit.
2) To fetch an instruction from the memory the computer does a memory read operation. This
places the contents of the addressed memory location on the W-bus.
3) At the same time, the IR is set up for loading on the next positive clock edge.
4) The contents of the IR are split into two nibbles.
5) The upper nibble is a two state output that goes directly to the block labeled ‘Controller-
sequencer.
6) The lower nibble is a three state output that is read onto the W-bus when needed.
Controller-Sequencer:
1) Before each computer run, (CLR’) signal is sent to the PC and CLR signal to the IR.
2) This resets the PC to 0000 and wipes out the last instruction in the IR.
3) A clock signal CLK is sent to all buffer registers, this synchronizes the operation of the
computer.
4) The 12 bits that come out of the CS form a word controlling the rest of the computer. The 12
wires carrying the control word are called the control bus.
5) The control word has the format:
This word determines how the registers will react to the next positive CLK edge.
Accumulator:
1) The accumulator is a buffer register that stores immediate answers during a computer run.
2) It has two output. The first one goes directly to the Adder-Subtracter.
3) The three state output goes to the W-bus when EA is high.
Adder-Subtractor:
1) When SU is low, the sum out of the adder-subtracter is S=A+B.
2) When SU is high, the sum out of the adder-subtracter is S=A+B’.
3) The adder-subtractor is asynchronous (unlocked); this means that its contents can change as
soon as the input words change.
4) When EU is high, these contents appear on the W-bus.
B Register:
1) The B register is also a buffer register.
2) A low LB‘ and positive CLK edge load the word on the W-bus into the B-register.
3) The two state output of the B register drives the B- register.
Output Register:
1) At the end of a computer run, the accumulator contains the answer to the problem being
solved.
2) At this point, we need to transfer the answer to the outside world. This is where the output
register is used.
3) When EA is high, is low, the next positive clock edge loads the word of the accumulator into
the output register.
4) The output register is often called an output port processed data can leave the computer
through these register.
Output Port:
1) The binary display is a row of 8 LEDs.
2) Each LED connects to one flip-flop of the output port.
3) After we have transferred an answer from the accumulator to the output port, we can see the
answer in binary form.
INSTRUCTION FORMAT:
Instruction of SAP-1 is of 8 bit length - XXXX XXXX. First 4 bits are Opcode and last 4 bits
are Operand.
INSTRUCTION SET:
Example:
Write a program to compute 16+20+24-32 (decimal) and display result in SAP-1 computer
Instruction Cycle:
Fetch 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
Fetch Cycle
The control unit is the key to a computer’s automatic operation. The CU generates the 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 which register contents
modify
Control Signal during each T state
Microinstructions
The controller-sequencer sends out control words, one during each T- state or clock cycle. These
words are like directions telling the rest of the computer what to do. Because it produces a small
step in the data processing, each control word is called a micro-instruction.
Macro-instruction
The instructions LDA, ADD, SUB are sometimes called macro-instructions. Each SAP-1 macro-
instruction is made up of three micro-instructions (i.e. T4, T5 and T6 state).
Control Matrix
The LDA, ADD, SUB and OUT signals from the instruction decoder drive the control matrix, at
the same time, the ring counter signals, T1 to T6, are driving the matrix. The matrix produces
CON, a 12-bit micro-instruction that tells the rest of the computer what to do.
Figure: SAP -1 Micro-Program
Microprogramming
The control matrix is one way to generate the microinstructions needed for each execution cycle.
With larger instruction sets, the control matrix becomes very complicated and requires hundreds
or even thousands of gates. Microprogramming is the alternative. The basic idea is to store
microinstructions in a ROM rather than produce them with a control matrix. This approach
simplifies the problem of building a controller-sequencer.
Address ROM
The address ROM contains the starting addresses. The starting address of the LDA routine is
0011; the starting address of the ADD routine is 0110 and so on. When the op-code bits I7I6I5I4
drive the address ROM, the starting address is generated. For instance, if the ADD instruction is
being executed, I7I6I5I4 is 0001.This is the input to the address ROM, the output of the ROM is
0110.
Presettable Counter
When computer run begins, the counter output is 0000 during T1 state, 0001 during T2 state, and
0011 during T3 state. Every Fetch cycle is the same because 0000, 0001, and 0010 come out of
the counter during states T1, T2 and T3. The op code in the IR controls the execution cycle. If an
ADD instruction has been fetched, the I7I6I5I4 bits are 0001. These opcode bits drive the address
ROM, producing an output of 0110.This starting address is the input to the presettable counter.
When T3 is high the negative clock edge loads 0110 into the presettable counter. The counter is
now preset, and counting can resume at the starting address of the ADD routine. The counter
output is 0110 during T4 state, 0111 during T5 state and 1000 during T6 state.
Control ROM
The control ROM stores the SAP-1 microinstructions .During the fetch cycle; it receives
addresses 0000, 0001, 0010. Therefore its outputs are
5E3H 0101 1110 0011
BE3H 1011 1110 0011
263H 0010 0110 0011
These control bits is sent to different components of computer during T1, T2 and T3 state
respectively.