Coa Chapter 6
Coa Chapter 6
The central processing unit (CPU) of a computer is the main unit that dictates the rest of the
computer organization.
1. Register set:
t: Stores intermediate data during the execution of instructions;
2. Arithmetic logic unit (ALU):
(ALU Performs the required micro-operations
perations for executing the
instructions;
3. Control unit:
t: supervises the transfer of information among the registers and instructs
the ALU as to which operation to perform by generating control signals.
Control word: The 14 binary selection inputs. It consists of four fields. (3 bits for SELA, 3 for
SELB, 3 for SELD, and 5 for OPR)
The three bit s of SELA select a source register for the A input of the ALU. The three bit s of SELB
select a register for the B input of the ALU. The three bits of SELD select a destination register
using the decoder and its seven load outputs. The five bits OPR select one of the operations in
the ALU. The 14 bits control word when applied to the selection inputs specify a particular
microoperation.
Example:
R1 R 2 R3
The encoding of the register selections is specified in the following table. The 3 bit binary code
listed in the first column of the table specifies the binary code for each of the three fields.
A control word of 14 bits is needed to specify a microoperation in the CPU. The control
word for a given microoperation can be derived from the selection variables, for example,
the subtract microoperation given by the statement.
R1 R2 – R3
Specifies R2 for the A input of the ALU, R3 for the B input of the ALU, R1 for the destination
register, and an ALU operation to subtract A-B. The binary control word for the subtract
microoperation is 010 011 001 00101 is obtained as follows:
The control word for this Microoperation and a few others are listed in the following table:
Symbolic designation
The increment and transfer Microoperation do not use the B input of the ALU. For these cases,
the B field is marked with a dash. We assign 000 to any unused field when formulating the
binary control word. To place the content of a register into the output terminals we place the
content of the register into the A input of the ALU, but none of the registers are selected to
accept the data.
The most efficient way to generate control words with a large number of bits is to store them in
a memory unit. A memory unit that stores control words is referred to as a control memory.
This type of control is referred to as micro programmed control.
Assembly Language:
• Alphanumeric equivalent of machine language
• Mnemonics more human-oriented than 1’s and 0’s
Assembler:
• Computer program that transliterates (one-to-one mapping)
assembly to machine language
• Computer’s native language is machine/assembly language
INSTRUCTION FORMATS
A computer will usually have a variety of instruction code formats. It is the function of the
control unit within the CPU to interpret each instruction code and provide the necessary
control functions needed to process the instruction.
The bits of the instruction are divided into groups called fields. The most common fields found
in instruction formats are:
1. Mode field:
d: Specifies the way the effective address is determined
2. Operation code:e: Specifies the operations to be performed.
3. Address field: Designates a memory address or a processor register
The operation code field of an instruction is a group of bits that define various processor
operations, such as add, subtract, complement, and shift.
The bits that define the mode field of an instruction
instruction code specify a variety of alternatives for
choosing the operands from the given address.
Operations specified by computer instructions are executed on some data stored in
memory or processor registers.
Operands residing in memory are specified by their
the memory address.
Operands residing in processor registers are specified with a register address
address.
A register address is a binary number of k bits that defines one of 2k registers in the CPU. Thus a
CPU with 16 processor registers R0 through R15 will have a register address field of 4 bits.
All operations are performed with an implied accumulator register. The instruction format in
this type of computer uses one address field.
For example, the instruction that specifies an arithmetic addition is defined by an
assembly language instruction as
ADD X
Where X is the address of the operand. The ADD instruction in this case results in the
operation
AC AC + M[X]
AC is the accumulator register and M[X] symbolizes the memory word located at
address X
The instruction format in this type of computer needs three register address fields.
ADD R1, R2, R3
to denote the operation R1 R2 + R3.
The number of address fields in the instruction can be reduced from 3 to 2 if the
destination register is the same as one of the source registers.
ADD R1, R2
would denote the operation R1 R1 + R2. Only register addresses for R1 and R2 need
be specified in this instruction.
Computers with multiple processor registers use the move instruction with a mnemonic
MOV to symbolize a transfer instruction.
MOV R1 , R2 denotes the transfer R1 R2
Some computers combine features from more than one organizational structure.
For Example, the intel 8080 microprocessor has 7 CPU registers, one of which is an accumulator
register. The processor has some of the characteristics of a general register type and some of
the characteristics of an accumulator type. Moreover, the intel 8080 processor has a stack
pointer and instructions to push and pop from a memory stack.
We will assume that the operands are in memory addresses A,B,C, and D, and the result must be
stored in memory at address X
Three Address Instructions:
ADD R1, A, B ie., R1 M[A] + M[B]
ADD R2, C, D i.e., R2 M[C] + M[D]
MUL X, R1, R2 i.e., M[X] R1 * R2
It is assumed that the computer has two processor registers, R1, and R2. The symbol M[A]
denotes the operand at memory address symbolized by A.