4
Tie 2 inputs together. Then tie the other 2 inputs together.
SAP 2 - adds a lot of functionality to the SAP-1 hardware, and we'llPresent this to see what the hardware does, but the important additions are toThe instruction set.Load/Store instructions1. The SAP-2 can now store data into the RAM as well as load data.2. Recall: instructions that need a memoryAddresses are 3 bytes long: one for theopcode, and the remaining 2 for the highAnd low halves (bytes) of the address.3. This is direct addressing: specifying theOperand by including the memory address.4. Example: Store what's in the A register in memory 3c55ha) SAP-2: sta 3c55 is translated to 32h / 55h / 3chb) HC11: staa 3c55 is translated to b7h / 3ch / 55c) Note that HC11 and SAP-2 use different order for the halves (bytes) of the address.(1) In HC11, the most significant byte comes first (smaller address)(2) In SAP-2, the least significant byte comes first.d) Note also that the instructions have different opcodes - This is not surprising,As the different instruction sets have different instructions etc.e) We find the opcode for the HC11 instruction by looking in appendix Af) it tells us that if we want to store what's in "A" to a two-byte memoryAddress, we use opcode 67.g) If you look, it also tells us that this is called "extended" addressing. ForThe HC11, Direct addressing just like we use it, except with the most significantbyte ="00h".h) Extended addressing in the HC11 is direct addressing using the full 16Bit address.5. Note that while the HC11 has staa and stab, the SAP-2 doesn't have stb or stca) This kind of asymmetry is common in assembly language design - someOther function was deemed more important in the SAP-2.Shifts and Rotates1. SAP-2 has two instructions that do register rotate.2. Rotate is like a shift except that the MSB isTransferred to the LSB for a left rotate, andFor a right rotate, the LSB is fed into theMSB.3. SAP-2 instructions are RAL and RAR (forRotate A left and rotate A right4. HC11 has ROR and ROL (usage, eg:RORA), but they're slightly different, asWe'll see. Components of SAP-2Input pots:- SAP-2 has 2 i/p ports: port 1 and port 2. - A hexadecimal encoder is connected to port 1. It allows us to enter hexadecimal instructions and data through port 1.- The hexadecimal keyboard encoder sends a ready signal of bit 0 to port 2. This signal indicates when the data in port 1 is valid, the SERIAL IN, signal going to pin 7 or port 2.Program Counter (PC):- Program Counter has 16-bit, therefore it can count from: PC = 0000 0000 0000 0000 0000To PC = 1111 1111 1111 1111 1111i.e., from 0000H to FFFFH.- The low CLR signal resets the PC before each computer run, so the data processing starts with the instruction stored in memory location 0000H.MAR and Memory:- During the fetch cycle, the MAR receives 16 bit addresses from PC. The two state MAR output then addressed memory location. - The memory has 2K ROM with address 0000H too 07FFH. The ROM contains a program called monitor that initializes the computer on power-up, interprets the keyboard inputs and so on.- The rest of memory is 64 K RAM with addresses from 0800H to FFFFH.Memory Data Register (MDR):- The MDR is an 8-bit for the opcode. - An 8-bit opcode can accommodate 256 instructions.- SAP-2 has only 42 instructions are identical with 8080/8085 instructions.Controller-Sequencer:- The controller-sequencer produces the control word or microinstructions that coordinates and direct the computer. - SAP-2 has bigger instruction set; the controller-sequencer has more hardware.- The control word (CON) or microinstructions determine how the registers react to the next positive edge dock.Accumulator:- The two-state output of the accumulator goes to the ALU; the three-state output to the W-bus. Therefore, the 8-bit word in the accumulator continuously drives the ALU, but this same word appears on the bus when EA is active. ALU and Flags:- The ALUs are commercially available as integrated circuit (IC). - These ALUs have 4 or more control bits that determine arithmetic and logic operation performed on word A and B.- The ALU used in SAP-2 includes arithmetic and logic operation.- Flag is a flip-flop that keeps track of a changing condition during computer run. The SAP-2 has two flags:Sign Flag:The sign flag is set when the accumulator contents become negative during the execution of some instructions. Zero Flag:The zero flag is set when the accumulator contents are zero. TMP, B & C register:- Instead of using B register to hold the data being added or subtracted from the accumulator, a temporary register (TMP) is used. This allows more freedom in using the B-register. - Besides the TMP and B registers, SAP-2 includes a C register. This gives us more flexibility in moving data during a computer run.Output Ports:- SAP-2 has two output ports: port 3 and port 4. - The contents of the accumulator can be loaded into port 3, which drives the hexadecimal display.- The contents of the accumulator can also be sent to port 4. The pin 7 of port 4 sends ACKNOWLEDGE signal to the hexadecimal encoder. This ACKNOWLEDGE signal and READY signal are part of a concept called handshaking.- The SERIAL OUT signal from pin 0 of port 4 converts parallel data in the accumulator into serial output data.Instruction Set of SAP2