Академический Документы
Профессиональный Документы
Культура Документы
• As you’re most likely aware, these first computers were huge, and would
quite often take up an entire room. Not only this, they were expensive to
run, used a lot of electricity, and were limited to what they could do they
certainly couldn’t multitask, that was for sure
Moreover, digital modules are best defined by the registers and the operations
that are performed on the data stored in them.The operations performed on the
data stored in registers are called Micro-operations.
In a computer system, data transfer takes place between processor registers and
memory and between processor registers and input-output systems. These data
transfer can be represented by standard notations given below:
Most of the standard notations used for specifying operations on various registers
are stated below.
1. R2 ← R1
o Typically, most of the users want the transfer to occur only in a
predetermined control condition. This can be shown by following if-then
statement:
If (P=1) then (R2 ← R1); Here P is a control signal generated in the control
section.
o It is more convenient to specify a control function (P) by separating the
control variables from the register transfer operation. For instance, the
following statement defines the data transfer operation under a specific
control function (P).
1. P: R2 ← R1
The following image shows the block diagram that depicts the transfer of data
from R1 to R2.
Here, the letter 'n' indicates the number of bits for the register. The 'n' outputs of
the register R1 are connected to the 'n' inputs of register R2.
A load input is activated by the control variable 'P' which is transferred to the
register R2.
A bus structure, on the other hand, is more efficient for transferring information
between registers in a multi-register configuration system.
A bus consists of a set of common lines, one for each bit of register, through
which binary information is transferred one at a time. Control signals determine
which register is selected by the bus during a particular register transfer.
The following block diagram shows a Bus system for four registers. It is
constructed with the help of four 4 * 1 Multiplexers each having four data inputs
(0 through 3) and two selection inputs (S1 and S2).
We have used labels to make it more convenient for you to understand the input-
output configuration of a Bus system for four registers. For instance, output 1 of
register A is connected to input 0 of MUX1.
The two selection lines S1 and S2 are connected to the selection inputs of all four
multiplexers. The selection lines choose the four bits of one register and transfer
them into the four-line common bus.
When both of the select lines are at low logic, i.e. S1S0 = 00, the 0 data inputs of
all four multiplexers are selected and applied to the outputs that forms the bus.
This, in turn, causes the bus lines to receive the content of register A since the
outputs of this register are connected to the 0 data inputs of the multiplexers.
Similarly, when S1S0 = 01, register B is selected, and the bus lines will receive the
content provided by register B.
The following function table shows the register that is selected by the bus for
each of the four possible binary values of the Selection lines.
Memory Transfer:
Most of the standard notations used for specifying operations on memory
transfer are stated below.
o The transfer of information from a memory unit to the user end is called
a Read operation.
o The transfer of new information to be stored in the memory is called
a Write operation.
o A memory word is designated by the letter M.
o We must specify the address of memory word while writing the memory
transfer operations.
o The address register is designated by AR and the data register by DR.
o Thus, a read operation can be stated as:
1. Read: DR ← M [AR]
o The Read statement causes a transfer of information into the data register
(DR) from the memory word (M) selected by the address register (AR).
o And the corresponding write operation can be stated as:
1. Write: M [AR] ← R1
o The Write statement causes a transfer of information from register R1 into
the memory word (M) selected by address register (AR).
Arithmetic Micro-operations :
1. Addition
2. Subtraction
3. Increment
4. Decrement
5. Shift
Symbolic Description
Representation
R3 ← R1 + R2 The contents of R1 plus R2
are transferred to R3.
The Add micro-operation requires registers that can hold the data and the digital components
that can perform the arithmetic addition.
A Binary Adder is a digital circuit that performs the arithmetic sum of two binary numbers
provided with any length.
A Binary Adder is constructed using full-adder circuits connected in series, with the output carry
from one full-adder connected to the input carry of the next full-adder.
The following block diagram shows the interconnections of four full-adder circuits to provide a
4-bit binary adder.
o The augend bits (A) and the addend bits (B) are designated by subscript numbers from
right to left, with subscript '0' denoting the low-order bit.
o The carry inputs starts from C0 to C3 connected in a chain through the full-adders. C4 is
the resultant output carry generated by the last full-adder circuit.
o The output carry from each full-adder is connected to the input carry of the next-high-
order full-adder.
o The sum outputs (S0 to S3) generates the required arithmetic sum of augend and
addend bits.
o The n data bits for the A and B inputs come from different source registers. For instance,
data bits for A input comes from source register R1 and data bits for B input comes from
source register R2.
o The arithmetic sum of the data inputs of A and B can be transferred to a third register or
to one of the source registers (R1 or R2).
Binary Adder-Subtractor :
The block diagram for a 4-bit adder-subtractor circuit can be represented as:
o
o When the mode input (M) is at a low logic, i.e. '0', the circuit act as an adder and when
the mode input is at a high logic, i.e. '1', the circuit act as a subtractor.
o The exclusive-OR gate connected in series receives input M and one of the inputs B.
o When M is at a low logic, we have B⊕ 0 = B.
The full-adders receive the value of B, the input carry is 0, and the circuit performs A
plus B.
o When M is at a high logic, we have B⊕ 1 = B' and C0 = 1.
The B inputs are complemented, and a 1 is added through the input carry. The circuit
performs the operation A plus the 2's complement of B.
Shift rnicrooperations 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. The information transferred through the serial input
determines the type of shift. There are three types of shifts: logical, circular, and arithmetic.
Logical shift: A logical shift is one that transfers 0 through the serial input. We will adopt the
symbols shl and shr for logical shift-left and shift-right rnicrooperations. For example:
R1 ← shl R1
R2 ← shr R2
are two rnicrooperations that specify a 1-bit shift to the left of the content of
register R 1 and a 1-bit shift to the right of the content of register R2. 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.
he 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 rnicrooperations is shown in Table 4-7
An arithmetic shift is a rnicrooperation 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. Figure 4-11 shows a typical register of n bits. Bit Rn- 1 in
the leftmost position holds the sign bit. Rn-2 is the most significant bit of the number and Ro is
the least significant bit. The arithmetic shift-right leaves the sign bit unchanged and shifts the
number (including the sign bit) to the right. Thus Rn-1 remains the same, Rn-2 receives the bit
from Rn-1 and so on for the other bits in the register. The bit in Ro is lost.
Each bit of the register is treated as a binary variable and the microoperation is performed on
the string of bits stored in the registers.
Hardware Implementation:
• Although there are 16 logic micro operations, most computers use only four-AND, OR,
XOR (exclusive-OR), and complement from which all others can be derived.
• It consists of four gates and a multiplexer. Each of the four logic operations is
generated through a gate that performs the required logic.
Some Applications:
Selective set : If bit in B is set to 1 then set the corresponding bit in A to 1
– 1010–A
– 1100–B
– 1 1 1 0 – RESULT
1010–A
1100–B
0 1 1 0 - RESULT
1 0 1 0 –A
1100–B
0 0 1 0 – RESULT
Mask Operation: if a bit in B is set to 0 then same portion in A get set to 0 corresponding A
values remain same .
1010-A
1100–B
1 0 0 0 – RESULT
• To perform a micro operation, the contents of specified registers are placed in the
inputs of the common ALU. The ALU performs an operation and the result of the
operation is then transferred to a destination register. The ALU is a
combinational circuit, so that the entire register transfer operation from the source
registers through the ALU and into the destination register can be performed during one
clock pulse period. The shift micro operations are often overall in a separate unit, but
sometimes the shift unit is made part of the overall ALU.
• The arithmetic, logic, and shift circuits can be combined into one ALU with common
selection variables. One stage of an arithmetic logic shift unit is shown in. The subscript i
designates a typical stage. Inputs A1 and B1 are applied to both the arithmetic and
logic units.
Instruction codes:
An instruction code is a group of bits that tells the computer to perform a specific operation
part.
Processor Register & instruction code with two parts. The first part specifies the operation to be
performed and second specifies an address. The memory address tells where the operand in
memory will be found.
An instruction code therefore specifies not only operations to be performed but also the
registers where the operands(data) will be found as well as the registers where the result has to
be stored Instructions are stored in one section of memory and data in another.
The operation code of an instruction is a group of bits that define operations such as add,
subtract, multiply, shift and compliment. The number of bits required for the operation code
depends upon the total number of operations available on the computer. The operation code
must consist of at least n bits for a given 2^n operations. The operation part of an instruction
code specifies the operation to be performed.
The simples way to organize a computer is to have one processor register and an instruction
code format with two parts
• The simplest design is to have one processor register(called the accumulator) and two fields
in the instruction, one for the opcode and one for the operand.
MEMORY = 4096 * 16
= 2 16 * 2 4
Computer Instructions:
Computer instructions are a set of machine language instructions that a particular processor
understands and executes. A computer performs tasks on the basis of the instruction provided.
An instruction comprises of groups called fields.
The Register-reference instructions are represented by the Opcode 111 with a 0 in the
leftmost bit (bit 15) of the instruction.
Note: The Operation code (Opcode) of an instruction refers to a group of bits that define
arithmetic and logic operations such as add, subtract, multiply, shift, and compliment.
Input-Output instruction :
Just like the Register-reference instruction, an Input-Output instruction does not need a
reference to memory and is recognized by the operation code 111 with a 1 in the leftmost bit of
the instruction. The remaining 12 bits are used to specify the type of the input-output
operation or test performed.
Direct operand - an operand stored in the register or in the memory location specified.
Indirect operand - an operand whose address is stored in the register or in the memory
location specified.
Immediate operand - an operand whose value is specified in the instruction
• At each clock pulse, the control unit sends control signals to control inputs of the bus,
the registers, and the ALU.
• Control unit design and implementation can be done by two general methods:
• A hardwired control unit : is designed from scratch using traditional digital logic design
techniques to produce a minimal, optimized circuit. In other words, the control unit is
like an ASIC (application-specific integrated circuit).
• A microprogrammed control unit : is built from some sort of ROM. The desired control
signals are simply stored in the ROM, and retrieved in sequence to drive the
microoperations needed by a particular instruction.
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). The instruction register
is divided into three parts: the I bit, the operation code, and bits 0 through 11. The operation
code in bits 12 through 14 are decoded with a 3 x 8 decoder. The eight outputs of the decoder
are designated by the symbols D0 through D7•
Fixed instruction format. Variable instruction format (16-64 bits per instruction).
Instruction cycle:
AND to AC :
This is an instaruction that perform the AND logic operation on pairs of bits in AC and the
memory word specified by the effective address. The result of
the operation is transferred to AC . The microoperations that execute this instruction are:
D0T4:DR<-M[AR]
D0T5:AC<-AC/\DR, SC<---0
The control function for this instruction uses the operation decoder D0 since this output of the
decoder is active when the instruction has an AND operation whose binary code value
000. Two timing signals are needed to execute the instaruction. The clock transition associared
with timing signal T4 transfers the operand from memory into DR . The clock transition
associated with the next timing signal T5 transfers to AC the result of the AND logic operation
between the contents of DR and AC. The same clock transition clears SC to 0, transferring
control to timing signal T0 to start a new instruction cycle.
Input-Output Configuration
The terminal sends and receives serial information. Each quantity of information has eight bits
of an alphanumeric code. The serial information from the keyboard is shifted into the input
register INPR. The serial information for the printer is stored in the output register OUTR.
These two registers communicate with a communication interface serially and with the AC in
parallel. The input-output configuration is shown in Fig. 5-12. The transmitter interface
receives serial information from the keyboard and transmits it to INPR. The receiver interface
receives information from OUTR and sends it to the printer serially. The operation of the serial
communication interface is explained in Sec. 11-3.
Input register:
The input register INPR consists of eight bits and holds an alpha numeric input information. The
1-bit input flag FGI is a control flip-flop. The flag bit is set to 1 when new information is available
in the input device and is cleared to 0 when the information is accepted by the computer. The
flag is needed to synchronize the timing rate difference between the input device and the
computer. The process of information transfer is as follows. Initially, the input flag FGI is cleared
to 0. When a key is struck in the keyboard, an 8-bit alphanumeric code is shifted into INPR and
the input flag FGI is set to 1. As long as the flag is set, the information in INPR cannot be
changed by striking another key. The computer checks the flag bit; if it is 1, the information
from INPR is transferred in parallel into AC and FGI is cleared to 0. Once the flag is cleared, new
information can be shifted into INPR by striking another key.
INPUT OUTPUT INSTRUCTIONS:
Interrupts:
In early years of computing processor has to wait for the signal for processing, so processor has
to check each and every hardware and software program in the system if it has any signal to
process. This method of checking the signal in the system for processing is called polling
method. In this method the problem processor has to waste number of clock cycles just for
checking the signal in the system, by this processor will become busy unnecessarily. If any signal
came for the process, processor will take some time to process the signal due to the polling
process in action. So system performance also will be degraded and response time of the
system will also decrease.
So to over come this problem engineers introduced a new mechanism, in this mechanism
processor will not check for any signal from hardware or software but instead
hardware/software will only send the signal to the processor for processing. The signal from
hardware or software should have highest priority because processor should leave the current
process and process the signal of hardware or software. This mechanism of processing the
signal is called interrupt of the system.
What is an Interrupt?
Interrupt is a signal which has highest priority from hardware or software which processor
1.Hardware Interrupts: If the signal for the processor is from external device or hardware is
called hardware interrupts.
Example: from keyboard we will press the key to do some action this pressing of key in
keyboard will generate a signal which is given to the processor to do action, such interrupts are
called hardware interrupts.
Hardware interrupts can be classified into two types ->
Maskable Interrupt: The hardware interrupts which can be delayed when a much highest
priority interrupt has occurred to the processor.
Non Maskable Interrupt: The hardware which cannot be delayed and should process by the
processor immediately.
2. Software Interrupts: Software interrupt can also divided in to two types they are ->
Normal Interrupts: the interrupts which are caused by the software instructions are called
software instructions.
Exception Interrupt: unplanned interrupts while executing a program is called Exception. For
example: while executing a program if we got a value which should be divided by zero is called
a exception.