Dark Mode
Image

COA_Misc

Simplified Instructional Computer (SIC)

SIC is a type of hypothetical computer, which contains some hardware features. Real machines are most often containing these features. The simplified instructional computer basically has two versions, i.e.,

  • SIC standard model
  • SIC/XE (extra expensive or equipment)

1. SIC machine Architecture/components

The simplified instruction computer contains a lot of components, which are described as follows:

Memory

The memory in a simplified instructional computer is organized as a sequence of 8-bit bytes (1 byte = 8 bits). A word can be formed by 3 consecutive bytes (1 word = 24 bits). This means that with the help of 24 bits, the simplified instructional computer is designed. The lower number byte is used to address a word, and the addressing starts by 0 byte. A computer memory contains 215 bytes.

Simplified Instructional Computer (SIC)

Registers

The simplified instruction computer contains 5 types of registers. There is an address associated with every register, and that address is known as the register number. Each register can contain only 3 bytes that mean its size is 3 bytes. The size of the integer depends on the size of a register. There is no stack in the SIC, and it basically stores the address with the help of linkage register. If we want to write the recursive program, it is very difficult in SIC. If we write a function call with more than one layer, the programmer is required to maintain memory for return addresses.

Mnemonic Number Special use
A (Accumulator) 0 This register is used to perform the arithmetic operations.
X (Index Register) 1 This register is used for addressing.
L (Linkage Register) 2 If there is a case of the subroutine, this register will save the return address of an instruction.
PC (Program Counter) 8 This register is used to store the next instruction address, which will be executed.
SW (Status Word) 9 This register is used to contain a variety of information such as Conditional code (CC).

There are five types of status word register, which is described as follows:

Mode: The supervision mode (value = 1) or user mode (value = 0) are referred by this mode bit. 1 bit is occupied by the mode bit. [0]

State: In this, we will see whether the process is in an idle state (value = 1) or running state (value = 0). 1 bit is occupied by the State bit. [1]

Id: The process id (PID) is referred by the id bit. 3 bits are occupied by the Id bit. [2-5]

CC: The condition code is referred by CC bit. The means the CC bit will show whether the device is ready or not. 2 bits are occupied by the CC bit. [6-7]

Mask: The interrupt mask is referred by the mask bit. 4 bits are occupied by the mask bit. [8-11]

X: The unused bits are referred by the X. 4 bits are occupied by the X. [12-15]

ICode: The interrupt code is referred by the ICode. The remaining bits are occupied by the ICode. [16-23]

Data format

  • With the help of 24 bit, the integer numbers are represented.
  • With the help of 8 bit ASCII value, the characters are represented.
  • There is no available bit to represent the floating-point numbers, but it exists in the SIC/XE.
  • With the help of 2's complement, the negative numbers are represented. That means -N ⇔ 2n - N. For example: if n = 4, then -1 ⇔ 24 -1 = (1111)2.

Instruction Format

There is a total 24-bit format contained by all instructions in a simplified instructional computer. The memory size of a simplified instructional computer is 215sup bytes.

Simplified Instructional Computer (SIC)

In this image, X is used to show the index address mode.

Addressing Mode:

The SIC can only support 2 modes, which are described as follows:

  • Indexed
  • Direct

If X = 0, it will show the direct addressing mode. If X = 1, it will show the indexed addressing mode, which is shown as follows:

Mode Indicate Target address Calculation
Direct X = 0 TA = address
Indexed X = 1 TA = address + (X)

Here the content of register is shown by the ().

Instruction Set:

The instruction set in SIC is described as follows:

Arithmetic Instruction:

SIC uses memory and register A to perform the operations. With the help of register, the result will be stored. The arithmetic instructions are represented with the help of ADD, MUL, SUB, DIV, etc. For example:

  1. ADD    ALPHA   ⇔   (A)   ←   (A)  +  (ALPHA)  

Examples of arithmetic

  1. LDA     ALPHA      It uses register A to load the ALPHA.   
  2. ADD     INCR         It is used to add the value of INCR.   
  3. LDA     GAMMA   It is used to load the GAMMA into register A.  
  4. SUB      ONE          It is used to subtract 1.   
  5. STA      DELTA     It is used to store in DELTA.   

Load and Store Instruction:

It is used to store or move the data from memory to accumulator or from the accumulator to memory. The load and store instructions are represented with the help of LDX, STA, LDA, STX, etc. For example:

  1. LDA    ALPHA   ⇔   (A)   ←   (ALPHA)  
  2. STA     ALPHA   ⇔   (ALPHA)   ←   (A)  

Comparison Instruction:

It is used to compare the contents in register A and the data in memory. It uses the CC (conditional code) of SW to save the result. The comparison instruction is represented with the help of COMP. For example:

  1. COMP    ALPHA   ⇔   CC   ←   (<, +, >) of (A) ? (ALPHA)  

Subroutine Linkage Instruction:

It is used to show the instruction which is related to the subroutine. The subroutine linkage instructions are represented with the help of RSUB, JSUB. Here, RSUB will be returned with the help of jumping the address in register L, and JSUB is used to jump and place the return address in L.

Conditional Jump Instruction:

It is first used to compare the contents of memory and accumulator. After that, on the basis of the condition, it will perform the task. The condition jump instructions are represented with the help of JLT, JGT, and JEQ. For example:

  1. Test CC and jump accordingly   

Input and Output

An 8 bits address is contained by each device. In the form of a single byte, the data is transferred to or from the rightmost byte of register A. The input and output instructions are of three types, which are described as follows:

Test Device (TD): It uses the status word and conditional code to test whether the device is ready to send or receive a byte of data. If CC (conditional code) is <, in this case, the device will be ready. If CC is >, in this case, the device will be busy.

Read Data (RD): With the help of RD, a byte can be read from the device. That byte will be stored in register A.

Write Data (WD): With the help of WD, a byte can be written into the d specified by memory device from register A.

Example of I/O for SIC

  1. INLOOP     TD        INDEV      It is used to test the input device  
  2.                     JEQ      INLOOP    It is used to maintain a loop until the device is ready.   
  3.                     RD       INDEV      It is used to read a single data byte from register A  
  4.                     STCH  DATA        It is used to store the byte that was read.    
  5.                     .  
  6.                     .  
  7. OUTLP       TD         OUTDEV It is used to test the output device  
  8.                     JEQ       OUTLP     It is used to maintain a loop until the device is ready.   
  9.                     LDCH   DATA       It uses register A to load the data byte.   
  10.                     WD       OUTDEV  It uses the output device to write one byte.    

2. SIC/XE

The SIC/XE is an advanced version of SIC (simplified instructional computer), which stands for Extra Expensive or Extra Equipment. The SIC (simplified instructional computer) and SIC/XE are both upward compatible because they are closely related to each other.

SIC/XE machine architecture/components

The SIC/XE contains a lot of components, which are described as follows:

Memory

The 8 bytes are usually contained by the memory. In SIC/XE system, the maximum available memory is 1 megabyte that means 220 bytes. The memory size of standard SIC is very small. Due to these memory size changes, the addressing mode and instruction format are changed in the simplified instructional computer extra expensive (SIC/XE). Just like the SIC, in the architecture of SIC/XE, a word (24 bits) can be formed with the help of 3 consecutive bytes. In SIC/XE, all the addresses are byte addresses. With the help of location of lower number bytes of a word, a word can be addressed.

Registers

Instead of the registers of SIC (simplified instructional computer), there are 4 additional general-purpose registers in the SIC/XE. That means there are total 9 registers (4 additional registers + 5 registers of SIC). The four additional registers of SIC/XE are described as follows:

Mnemonic Number Special use
B (Base Register) 3 This type of register is mainly used for addressing.
S 4 This type of register is a general-purpose register, and there is no special use of this register.
T 5 This type of register is also the general-purpose register, and there is no special use of this register.
F 6 This is a floating-point register.

With the help of all 9 registers of SIC and SIC/XE, the easiest tasks are able to perform in a customized assembly language. The S and T registers can only be used for storing. We are not able to use these registers for the accumulator. For example:

  1. ADD          S, A          A ← A + S  
  2. COMPR     X, T  

Data format:

The data format of a SIC standard version and SIC/XE is almost the same. There are some differences in data formats, which are described as follows:

  • Sign bits 0 and 1 are represented by S. Here, 1 is used to show negative, and bit 0 is used to show positive.
  • With the help of binary numbers, the integers are represented.
  • With the help of ASCII codes, the characters are represented.
  • Exponent is a type of unsigned binary number, which is represented with the help of a value between 0 and 2047.
  • Fraction is represented with the help of a value between 0 and 1.

The SIC/XE contains an additional floating-point data type with 48 bit, which is shown as follows:

Simplified Instructional Computer (SIC)

The value will be represented with the help of following formula:

  1. Value = (s) * f * 2(exponent-1024)  

For example:

  1. 5 = 22+ 20 = (2-1 + 2-3) * 23 = (2-1 + 2-3) * 21027-1024  
  2. 0,10000000011, 1010000....0  

Instruction format:

The instruction format of simplified instructive format is not enough for SIC/XE because the available memory size of SIC/XE is 220 bytes. That means an address of SIC/XE cannot fit into the field of 15 bit.

There are two ways to solve the memory-related problem, which is described as follows:

  • It can be solved with the help of using relative addressing, which is shown by instruction format 3.
  • It can be solved by extending the address field to 20 bits, which is shown by instructive format 4.

The SIC/XE contains four types of format. Where, format 1 and format 2 cannot be used to reference the memory. The bit 'e' is used to distinguish between format 3, and format 4.

Format 1: It is a 1-byte format. For example: HIO, NORM, SIO, TIO.

Simplified Instructional Computer (SIC)

Format 2: It is a 2-byte format.

Simplified Instructional Computer (SIC)

The registers are represented with the help of above two addresses. So we don't require to access the memory for execution.

Format 3: It is a 3-byte format.

Simplified Instructional Computer (SIC)

The instruction will be interpreted in the form of simple SIC instruction if and only if "n bit" and "i bit" both bits are 0.

Format 4: It is a 4-byte format.

Simplified Instructional Computer (SIC)

Here

  • n is used to show the indirect bit
  • i is used to show the immediate bit
  • x is used to show the index bit
  • b is used to show the base bit
  • p is used to show the PC relative bit
  • e is used to show the extended bit

The variation of the instruction can be interpreted with the help of the above-described bits alone or in combination, shown as follows:

Bit representation Use
x = 1 It is used to show the indexed addressing
e = 0 It is used to show the 3-byte format
e = 1 It is used to show the 4-byte format
b = 0 and p = 1 It is used to show the PC relative addressing
b = 1 and p = 0 It is used to show the base or displacement addressing
n = 1 and i = 1 It is used to show the direct addressing
n = 1 and i = 0 It is used to show the indirect addressing
n = 0 and i = 1 It is used to show the immediate addressing
n = 0 and i = 0 It is used to show the simple SIC interpretation.

So the last 15 bits, as well as the bpe bits, are treated as an address.

Addressing Modes

For the format 3, the two new addressing modes are introduced in SIC/XE, which are described as follows:

Mode Indication Target Address Calculation
Base Relative b = 1, p = 0 TA = (B) + disp (0 ≤ disp ≤ 4095)
Program Counter Relative b = 0, p = 1 TA = (PC) + disp (-2048 ≤ disp ≤ 2047)

If b bit and p bit both are set to 0 in format 3, the disp is taken in the form of a target address. This process is known as the direct addressing mode. With the help of direct, indirect, and relative addressing modes, and many other addressing modes, we can calculate the target address, which is described as follows:

Base Relative addressing

If we use the base relative mode, in this case, disp will be 12 bits unsigned integer.

Simplified Instructional Computer (SIC)

In this image, b stands for Base.

Program Counter Relative

If we use the program counter relative mode, in this case, disp will be 12 bits signed integer.

Simplified Instructional Computer (SIC)

In this image, p stands for Program.

Direct addressing

In the direct addressing mode, the target address can be directly taken from the field of address or disp if and only if bits b and p are set to 0.

Simplified Instructional Computer (SIC)

For format 3 and format 4 in direct addressing, the indication, target address, and calculation are described as follows:

  1. Format 3 (e = 0): n = 1, i = 1, b = 0, p = 0, TA = disp (0 ≤ disp ≤ 4095)  
  2. Format 4 (e = 1): n = 1, i = 1, b = 0, p = 0, TA = address   

Indexed addressing

The term (x) is added in indexed addressing to calculate the target address. If bit x is set to 1, in this case, the register X's value will be added in the calculation of a target address.

Simplified Instructional Computer (SIC)

For format 3 and format 4 in direct indexed addressing, the indication, target address are described as follows:

Format 3: n = 1, i = 1, x = 1, TA = (X) + disp

Format 4: n = 1, i = 1, x = 1, TA = (X) + address

Now we will see the use of target address with the help of bit i and n, which is described as follow:

Mode Indication Operand Value
Immediate Addressing i = 1, n = 0 TA = It will be used in the form of operand value, and there is no memory reference
Indirect Addressing i = 0, n = 1 TA = The word at the target address is fetched. In the form of address of operand value, the TA value is taken.
Simple Addressing Case 1: i = 0, n = 0 It will show the standard SIC
  Case 2: i = 1, n = 1 (TA) = In the form of address of operand value, the TA (target address) is taken.

The immediate indexing mode is described as follows:

 

Simplified Instructional Computer (SIC)

In this image, i stand for immediate.

The indirect indexing mode is described as follows:

Simplified Instructional Computer (SIC)

In this image, n stands for indirect.

The simple addressing mode is described as follows:

Case 1:

Simplified Instructional Computer (SIC)

Case 2:

Simplified Instructional Computer (SIC)

Example of Addressing Mode

Hex OP n I x b P e disp/address Target Address Value Loaded into register A
032600 000000 1 1 0 0 1 0 0110 0000 0000 3600 103000
03C300 000000 1 1 1 1 0 0 0011 0000 0000 6390 00C303
022030 000000 1 0 0 0 1 0 0000 0011 0000 3030 103000
010030 000000 0 1 0 0 0 0 0000 0011 0000 30 000030
003600 000000 0 0 0 0 1 1 0110 0000 0000 3600 103000
0310C303 000000 1 1 0 0 0 1 0000 1100 0011 0000 0011 C303 003030

Instruction set

The instruction sets of SIC and SIC/XE are almost the same, but there is some additional instruction set in the SIC/XE because of the additional floating-point data format. So SIC/XE also provides a lot of additional instructions, including floating-point arithmetic instruction. All the additional instructions are described as follows:

  • Standard instruction of SIC (simplified instructional computer)
  • Load and store new registers with the help of following operations:
  • LDB, STB, etc

The operations of floating-point arithmetic are described as follows:

  1. ADDF, MULF, SUBF, DIVF  

The operation of register move is described as follows:

  1. RMO  

The operations of Register to register arithmetic are described as follows:

  1. ADDR, MULR, SUBR, DIVR  

The operation of supervision call is described as follows:

  1. SVC  

The supervision call is used to generate an interrupt for OS (Operating system)

The operations of Input/Output channel are described as follows:

  1. SIO (Start)  
  2. TIO (Test)  
  3.  HIO (Halt)  

With the help of Appendix A, we are able to get the list of all instructions. The notations for appendix are described as follows:

C: Conditional code CC

P: Privileged instruction

A ← (x. .x+2): It will move the word starting at x to A.

X: This instruction is only available in SIC/XE

Input and Output

The SIC/XE provides the I/O channel. With the help of this channel, we can perform the operations of input and output while the CPU (Central processing unit) is executing the other instructions. It also allows the overlapping of input or output and computing. Due to this overlapping, the architecture of SIC/XE has become more effective. The instruction sets of I/O are SIO, TIO, and HIO, which have the ability to start, test, and halt the operations of I/O channel, respectively.

Comment / Reply From