Cpu Design 1
Cpu Design 1
Every computer has its own unique instruction set. The ability
to store and execute instructions, the stored program
concept, is the most important property of a general-purpose
computer.
The most basic part of an instruction code is its operation part. The
operation code of an instruction is a group of bits that define such
operations as add, subtract, multiply, shift, and complement. The
number of bits required for the operation code of an instruction
depends on the total number of operations available in the computer.
The operation code must consist of at least n bits for a given 2n (or
less) distinct operations. As an illustration, consider a computer with
64 distinct operations, one of them being an ADD operation. The
operation code consists of six bits, with a bit configuration 110010
assigned to the ADD operation. When this operation code is decoded
in the control unit, the computer issues control signals to read an
operand from memory and add the operand to a processor register.
Computer registers
The program counter (PC) also has 12 bits and it holds the
address of the next instruction to be read from memory
after the current instruction is executed. The PC goes
through a counting sequence and causes the computer
to read sequential instructions previously stored in
memory. Instruction words are read and executed in
sequence unless a branch instruction is encountered. A
branch instruction calls for a transfer to a
nonconsecutive instruction in the program. The address
part of a branch instruction is transferred to PC to
become the address of the next instruction. To read an
instruction, the content of PC is taken as the address for
memory and a memory read cycle is initiated. PC is then
incremented by one, so it holds the address of the next
instruction in sequence.
Two registers are used for input and output. The input
register (INPR) receives an 8-bit character from an input
device. The output register (OUTR) holds an 8-bit
character for an output device.