BCS302 Unit-3 (Part-II)
BCS302 Unit-3 (Part-II)
Name Mnemonic
Branch BR
Jump JMP
Skip SKP
Call CALL
Return RET
Compare (by subtraction) CMP
Test (by ANDing) TST
Following table (*MM Table 8-11) gives a list of the most common branch instructions. Each mnemonic is constructed with the
letter B (for branch) and an abbreviation of the condition name. When the opposite condition state is used, the letter N (for no)
is inserted to define the 0 state.
NOTE: The conditional instructions can be associated also with the jump, skip, call, or return type of program control instructions.
Numerical Example
Consider an 8-bit ALU as shown in the above figure (*MM Fig. 8-8).
Let A = 11110000 and B = 00010100. To perform A - B, the ALU takes the 2's complement of B and adds it to A.
A: 11110000
B + 1: + 11101100
A - B: 111011100 C=1 S=1 V=0 Z=0
If we assume unsigned numbers, the decimal equivalent of A is 240 and that of B is 20.
The subtraction in decimal is 240 - 20 = 220 i.e. binary result 11011100.
Since 240 > 20, we have that A > B and A ≠ B. The instructions that will cause a branch after this comparison are BHI (branch if
higher), BHE (branch if higher or equal), and BNE (branch if not equal).
If we assume signed numbers, the above subtraction in decimal is (-16) - (+20) = -36.
Since (-16) < (+20) we have that A < B and A ≠ B.
These two relations can also be derived from the fact that status bits S = 1 (negative), V = 0 (no overflow), and Z = 0 (not zero).
The instructions that will cause a branch after this comparison are BLT (branch if less than), BLE (branch if less or equal), and
BNE (branch if not equal).
A hardwired control, as the name implies, requires changes in the wiring among the various components if the design has
to be modified or changed.
The block diagram of the control unit is shown in the above figure. It consists of two decoders, a sequence counter, and a
number of control logic gates.
An instruction read from memory is placed in the instruction register (IR) which is divided into three parts: the I bit, the
operation code, and bits 0 through 11.
The 4-bit sequence counter can count in binary from 0 through 15. The outputs of the counter are decoded into 16 timing
signals T0 through T15 using the 4 x 16 decoder.
Once in awhile, the counter is cleared to 0, causing the next active timing signal to be T0.
As an example, consider the case where SC is incremented to provide timing signals T0, T1 T2, T3, and T4 in sequence.
At time T4, SC is cleared to 0 if decoder output D3 is active.
This is expressed symbolically by the statement D3 T4: SC ← 0
Mapping of Instruction
A mapping from instruction code to microinstruction address is needed to map opcode (4-bits) with address of control memory (7-
bits).
Figure 7-3 Mapping from instruction code to microinstruction address
One simple mapping process that converts the 4-bit opcode to a 7-bit address for control memory is shown in above figure
(*MM Fig. 7-3).
This mapping consists of placing a 0 in the MSB of the address, transferring the four opcode bits, and clearing the two least
significant bits of the control address register.
Microinstruction Format
The computer instruction format is depicted in the following figure (*MM Figure 7-5). It consists of three fields as shown below.
The microinstruction format for the control memory is shown in the following figure (*MM Fig. 7-6).
Compiled by- Durgesh Pandey (CSED)
PSIT, Kanpur
The 20 bits of the microinstruction are divided into four functional parts:
1. The three fields F1, F2, and F3 specify microoperations for the computer.
2. The CD field selects status bit conditions.
3. The BR field specifies the type of branch to be used.
4. The AD field contains a branch address. The address field is seven bits wide, since the control memory has 128 = 27
words.
CISC Characteristics
A large number of instructions-typically from 100 to 250 instructions
A large variety of addressing modes- typically from 5 to 20 different modes
Variable-length instruction formats
Instructions that manipulate operands in memory
RISC Characteristics
Relatively few instructions
Relatively few addressing modes
Memory access limited to load and store instructions
All operations done within the registers of the CPU
Fixed-length, easily decoded instruction format
Single-cycle instruction execution
Hardwired rather than microprogrammed control
Efficient instruction pipeline
CISC Vs RISC Architecture