Ca 2
Ca 2
ORGANIZATION OF A COMPUTER
Register transfer: Register transfer language, register transfer, bus and memory transfers,
arithmetic micro operations, logic micro operations, shift micro operations; Control memory.
Contents
Register transfer:
Control memory
2
Register Transfer Language
A digital system is an interconnection of digital hardware modules that accomplish a
specific information-processing task.
Digital system design uses a modular approach.
The modules are constructed from such digital components as registers, decoders,
arithmetic elements, and control logic.
Digital modules are best defined by the registers they contain and the operations that are
performed on the data stored in them.
The operations executed on data stored in registers are called microoperations.
A microoperation is an elementary operation performed on the information stored in one
Or more registers. The result of the operation may replace the previous binary information
of a register or may be transferred to another register.
Examples of microoperations are shift, count, clear, and load.
3
Register Transfer Language
Examples of registers that implement microoperations:
A counter with parallel load is capable of performing the microoperations increment
and load.
A bidirectional shift register is capable of performing the shift right and shift left
microoperations.
The internal hardware organization of a digital computer is best defined by specifying:
1. The set of registers it contains and their function.
2. The sequence of microoperations performed on the binary information stored in
the registers.
3. The control that initiates the sequence of microoperations.
4
Register Transfer Language
The symbolic notation used to describe the microoperation transfers among registers is
called a register transfer language.
A register transfer language is a system for expressing in symbolic form, the microoperation
sequences among the registers of a digital module.
It is a convenient tool for describing the internal organization of digital computers in concise
and precise manner. It can also be used to facilitate the design process of digital systems.
5
Register Transfer
Registers:
Computer registers are designated by capital letters (sometimes followed by numerals) to
denote the function of the register.
For example, the register that holds an address for the memory unit is usually called a
memory address register and is designated by the name MAR.
Other designations for registers are PC (for program counter), IR (for instruction register, and
R1 (for processor register).
The individual flip-flops in an n-bit register are numbered in sequence from 0 through n - 1,
starting from 0 in the rightmost position and increasing the numbers toward the left.
6
Register Transfer
Figure below shows the representation of registers in block diagram form.
7
Register Transfer
Registers Transfer:
Information transfer from one register to another is designated in symbolic form by means
of a replacement operator.
The statement
R2 ← R1
denotes a transfer of the content of register R1 into register R2. It designates a replacement
of the content of R2 by the content of R1 . By definition, the content of the source register R1
does not change after the transfer.
Normally, we want the transfer to occur only under a predetermined control condition. This
can be shown by means of an if-then statement
If (P=1) then (R2 ← R1)
where P is a control signal generated in the control section.
8
Register Transfer
Control Function:
It is sometimes convenient to separate the control variables from the register transfer
operation by specifying a control function. A control function is a Boolean variable that is
equal to 1 or 0. The control function is included in the statement as follows:
P: R2←R1
The control condition is terminated with a colon. It symbolizes the requirement that the
transfer operation be executed by the hardware only if P = 1 .
9
Register Transfer
Figure below shows the block diagram that depicts the transfer from R1 to R2.
11
Bus and Memory Transfers
Common Bus:
A typical digital computer has many registers, and paths must be provided to transfer
information from one register to another. The number of wires will be excessive if separate
lines are used between each register and all other registers in the system.
A more efficient scheme for transferring information between registers in a multiple-register
configuration is a common bus system.
A bus structure consists of a set of common lines, one for each bit of a register, through
which binary information is transferred one at a time. Control signals determine which
register is selected by the bus during each particular register transfer.
12
Bus and Memory Transfers
One way of constructing a common bus system is with multiplexers.
15
Bus and Memory Transfers
Memory Transfer
The transfer of information from a memory word to the outside environment is called a read
operation.
The transfer of new information to be stored into the memory is called a write operation.
A memory word will be symbolized by the letter M.
The particular memory word is selected by the memory address during the transfer.
Memory read: Consider a memory unit that receives the address from a register, called
the address register, symbolized by AR . The data are transferred to another register, called
the data register, symbolized by DR . The read operation can be stated as follows:
Read: DR ←M[AR]
This causes a transfer of information into DR from the memory word M selected by the
address in AR .
16
Bus and Memory Transfers
Memory write: The write operation transfers the content of a data register to a memory
word M selected by the address. Assume that the input data are in register R1 and the
address is in AR. The write operation can be stated symbolically as :
Write: M[AR]←R1
This causes a transfer of information from R1 into the memory word M selected by the
address in AR
17
Microoperations
The microoperations in digital computers are classified into four categories:
1. Register transfer microoperations
2. Arithmetic microoperations
3. Logic microoperations
4. Shift microoperations
18
Arithmetic Microoperations
In general, the Arithmetic Micro-operations deals with the operations performed on
numeric data stored in the registers.
Addition
Subtraction
Increment
Decrement
Shift
To implement the add microoperation with hardware, we need the registers that hold
the data and the digital component that performs the arithmetic addition.
The digital circuit that forms the arithmetic sum of two bits and a previous carry is called
a full-adder.
The digital circuit that generates the arithmetic sum of two binary numbers of any length
is called a binary adder.
The binary adder is constructed with full-adder circuits connected in cascade, with the
output carry from one full-adder connected to the input carry of the next full-adder.
21
Arithmetic Microoperations
Figure shows the interconnections of four full-adders (FA) to provide a 4-bit binary adder.
The augend bits of A and the addend bits of B are designated by subscript numbers from
right to left, with subscript 0 denoting the low-order bit. The carries are connected in a
chain through the full-adders.
The input carry to the binary adder is C0 and the output carry is C4. The S outputs of the
full-adders generate the required sum bits.
22
Arithmetic Microoperations
An n-bit binary adder requires n full-adders.
The n data bits for the A inputs come from one register (such as R1), and the n data bits for
the B inputs come from another register (such as R2). The sum can be transferred to a third
register or to one of the source registers (R1 or R2), replacing its previous content.
Binary Adder-Subtractor:
23
Arithmetic Microoperations
Binary Incrementor:
The increment microoperation adds one to a number in a register.
For example, if a 4-bit register has a binary value 0110, it will go to 0111 after it is
incremented.
The diagram of a 4-bit combinational circuit incrementer is shown in Figure below..
24
Arithmetic Microoperations
Arithmetic Circuit:
The arithmetic microoperations listed in Table 4-3 can be implemented in one composite
arithmetic circuit.
The diagram of a 4-bit arithmetic circuit is shown in figure below.
The input carry Cin goes to the carry input of the FA in the least significant position. The
other carries are connected from one stage to the next.
The output of the binary adder is calculated from the following arithmetic sum:
where A is the 4-bit binary number at the X inputs and Y is the 4-bit binary number at the
Y inputs of the binary adder. Cin is the input carry, which can be equal to 0 or 1.
25
Arithmetic Microoperations
26
Arithmetic Microoperations
27
Logic Microoperations
Logic microoperations specify binary operations for strings of bits stored in registers.
Logic microoperations are bit-wise operations, i.e., they work on the individual bits of data.
For example, the exclusive-OR microoperation with the contents of two registers R1 and R2
is symbolized by the statement
28
Logic Microoperations
29
Logic Microoperations
30
Logic Microoperations
Special symbols
Special symbols will be adopted for the logic microoperations OR, AND, and complement, to
distinguish them from the corresponding symbols used to express Boolean functions.
The symbol V will be used to denote an OR microoperation and
the symbol ꓥ will be used to denote an AND microoperation.
The complement microoperation is the same as the 1's complement and uses a bar on top
of the symbol that denotes the register name.
The main reason for using different symbols is to differentiate between a logic
microoperation and a control (or Boolean) function.
When the symbol + occurs in a microoperation, it will denote an arithmetic plus. When it
occurs in a control (or Boolean) function, it will denote an OR operation. We will never use it
to symbolize an OR microoperation.
31
Logic Microoperations
For example, in the statement
The + between P and Q is an OR operation between two binary variables of a control function.
The + between R2 and R3 specifies an add microoperation.
The OR microoperation is designated by the symbol V between registers R5 and R6.
32
Logic Microoperations
The 16 Boolean functions of two variables x and y are expressed in algebraic form in the first
column of Table 4-6.
The 16 logic microoperations are derived
from these functions by replacing variable
x by the binary content of register A and
variable y by the binary content of register
B.
33
Logic Microoperations
Hardware Implementation
In the hardware implementation of logic microoperations, logic gates are inserted for each bit
or pair of bits in the registers to perform the required logic function.
Although there are 16 logic microoperations, most computers use only four-AND, OR, XOR
(exclusive-OR), and complement from which all others can be derived.
Figure 4-10 shows one stage of a circuit that generates the four basic logic microoperations.
Each of the four logic operations is generated through a gate that performs the required logic.
The outputs of the gates are applied to the data inputs of the multiplexer.
The two selection inputs S1 and S0 choose one of the data inputs of the multiplexer and
direct its value to the output.
The diagram shows one typical stage with subscript i. For a logic circuit with n bits, the
diagram must be repeated n times for i = 0, 1, 2, . . . , n - 1. The selection variables are applied
to all stages.
The function table in Fig. 4-10(b) lists the logic microoperations obtained for each
combination of the selection variables.
34
Logic Microoperations
35
Logic Microoperations
Some Applications:
Logic microoperations are very useful for manipulating individual bits or a portion of a word
stored in a register.
They can be used to change bit values, delete a group of bits, or insert new bit values into a
register.
Selective-Set: The selective-set operation sets to 1 the bits in register A where there are
corresponding 1's in register B . It does not affect bit positions that have 0's in B.
Example:
36
Logic Microoperations
Selective-Complement: The selective-complement operation complements bits in A where
there are corresponding 1's in B .
Example:
Selective-Clear : The selective-clear operation clears to 0 the bits in A only where there are
corresponding 1's in B.
Example:
37
Logic Microoperations
Mask Operation: The mask operation is similar to the selective-clear operation except that
the bits of A are cleared only where there are corresponding 0's in B.
Example:
Example:
39
Shift Microoperations
Shift microoperations are used for serial transfer of data.
They are also used in conjunction with arithmetic, logic, and other data-processing
operations.
The contents of a register can be shifted to the left or the right.
At the same time that the bits are shifted, the first flip-flop receives its binary information
from the serial input.
During a shift-left operation the serial input transfers a bit into the rightmost position.
During a shift-right operation the serial input transfers a bit into the leftmost position.
There are three types of shifts: logical, circular, and arithmetic.
40
Shift Microoperations
Logical Shift:
• A logical shift is one that transfers 0 through the serial input.
• The symbols shl and shr are adopted for logical shift-left and shift-right microoperations.
• Example:
1-bit shift to the left
1-bit shift to the left
• The register symbol must be the same on both sides of the arrow.
• The bit transferred to the end position through the serial input is assumed to be 0 during
a logical shift.
41
Shift Microoperations
Circular Shift:
• The circular shift (also known as a rotate operation) circulates the bits of the register
around the two ends without loss of information.
• This is accomplished by connecting the serial output of the shift register to its serial
input.
• We will use the symbols cil and cir for the circular shift left and right, respectively.
• The symbolic notation for the shift
microoperations is shown in Table 4-7.
42
Shift Microoperations
Arithmetic Shift:
• An arithmetic shift is a microoperation that shifts a signed binary number to the left or
right.
• An arithmetic shift-left multiplies a signed binary number by 2.
• An arithmetic shift-right divides the number by 2.
• Arithmetic shifts must leave the sign bit unchanged because the sign of the number
remains the same when it is multiplied or divided by 2.
• The leftmost bit in a register holds the sign bit, and the remaining bits hold the number.
The sign bit is 0 for positive and 1 for negative. Negative numbers are in 2's complement
form.
43
Shift Microoperations
• Figure shows a typical register of n bits. Bit R n-1 in the leftmost position holds the sign bit.
R n-2 is the most significant bit of the number and R0 is the least significant bit.
• Arithmetic shift-right :
• The arithmetic shift-right leaves the sign bit unchanged and shifts the number
(including the sign bit) to the right.
• Thus R n-1 remains the same, R n-2 receives the bit from R n-1 and so on for the other
bits in the register.
• The bit in Ro is lost.
44
Shift Microoperations
• Arithmetic shift-left :
• The arithmetic shift-left inserts a 0 into R0 and shifts all other bits to the left.
• The initial bit of R n-1 is lost and replaced by the bit from R n-2 .
• A sign reversal occurs if the bit in R n-1 changes in value after the shift. This happens if
the multiplication by 2 causes an overflow.
• An overflow occurs after an arithmetic shift left if initially, before the shift, R n-1 is not
equal to R n-2 .
• An overflow flip-flop Vs can be used to detect an arithmetic shift-left overflow.
46
Shift Microoperations
• A combinational circuit shifter can be constructed with multiplexers as shown in Fig.
47
Control Memory
Control Unit: The function of the control unit in a digital computer is to initiate sequences
Of microoperations.
There are two ways to implement control unit:
1. Hardwired Control unit
2. Micro programmed Control Unit
Hardwired control unit: When the control signals are generated by hardware using
conventional logic design techniques, the control unit is said to be hardwired.
Microprogrammed control unit: A control unit whose binary control variables are stored
in memory is called a microprogrammed control unit.
48
Control Memory
Control Word:
• The control unit initiates a series of sequential steps of microoperations.
• During any given time, certain microoperations are to be initiated , while others
remain idle.
• The control variables at any given time can be represented by a string of 1's and 0's
called a control word.
• As such, control words can be programmed to perform various operations on the
components of the system.
Control Memory:
• A memory that is part of a control unit is referred to as a control memory.
• The control memory can be a read-only memory (ROM).
49
Control Memory
Microinstruction: Each word in control memory contains within it a microinstruction .
The microinstruction specifies one or more microoperations for the system.
Microprogram:
• A sequence of microinstructions constitutes a microprogram .
• The use of a microprogram involves placing all control variables in words of ROM for
use by the control unit through successive read operations.
• The content of the word in ROM at a given address specifies a microinstruction.
Microprogramming: The principle of microprogramming is an elegant and systematic
method for controlling the microoperation sequences in a digital computer.
50
Control Memory
A computer that employs a microprogrammed control unit will have two separate
memories:
• A main memory and
• A control memory.
Main memory:
• The main memory is available to the user for storing the programs.
• The contents of main memory may alter when the data are manipulated and every
time that the program is changed.
• The user's program in main memory consists of machine instructions and data.
51
Control Memory
Control memory:
• The control memory holds a fixed microprogram that cannot be altered by the
occasional user.
• The microprogram consists of microinstructions that specify various internal control
signals for execution of register microoperations.
• Each machine instruction initiates a series of microinstructions in control memory.
• These microinstructions generate the microoperations to fetch the instruction from
main memory; to evaluate the effective address, to execute the operation specified
by the instruction, and to return control to the fetch phase in order to repeat the
cycle for the next instruction.
52
Control Memory
The general configuration of a microprogrammed control unit is demonstrated in the
block diagram of Fig. 7-1 .
53
Control Memory
Sequencer:
• The next address generator is sometimes called a microprogram sequencer, as it
determines the address sequence that is read from control memory.
• Typical functions of a microprogram sequencer are incrementing the control address
register by one, loading an address from control memory into the control address
register, transferring an external address, or loading an initial address to start the
control operations.
Pipeline register:
• The data register is sometimes called a pipeline register.
• It allows the execution of the microoperations specified by the control word
simultaneously with the generation of the next microinstruction.
54
Control Memory
The main advantage of the microprogrammed control is the fact that once the hardware
configuration is established, there should be no need for further hardware or wiring
changes. If we want to establish a different control sequence for the system, all we need
to do is specify a different set of microinstructions for control memory.
55