MODULE 2 - 1 Computer System Architecture
MODULE 2 - 1 Computer System Architecture
The basic operations are implemented in hardware level. ALU is having collection of two types of
operations:
Arithmetic operations
Logical operations
To identify any one of these four logical operations or four arithmetic operations, two control lines are
needed. Also to identify the any one of these two groups- arithmetic or logical, another control line is
needed. So, with the help of three control lines, any one of these eight operations can be identified.
Consider an ALU is having four arithmetic operations. Addition, subtraction, multiplication and
division. Also consider that the ALU is having four logical operations: OR, AND, NOT & EX-OR.
We need three control lines to identify any one of these operations. The input combination of these
control lines are shown below:
Control lines and are used to identify any one of the four operations in a group. One possible
combination is given here.
A decode is used to decode the instruction. The block diagram of the ALU is shown in figure
2.1.
Figure 2.1: Block Diagram of the ALU
The ALU has got two input registers named as A and B and one output storage register, named
as C. It performs the operation as:
C = A op B
The input data are stored in A and B, and according to the operation specified in the control lines,
theALU perform the operation and put the result in register C.
As for example, if the contents of controls lines are, 000, then the decoder enables the addition
operation and it activates the adder circuit and the addition operation is performed on the data that
are available in storage register A and B . After the completion of the operation, the result is stored in
register C.
We should have some hardware implementations for basic operations. These basic operations can
be used to implement some complicated operations which are not feasible to implement directly in
hardware.
There are several logic gates exists in digital logic circuit. These logic gates can be used to
implement the logical operation. Some of the common logic gates are mentioned here.
AND gate: The output is high if both the inputs are high. The AND gate and its truth table is shown
in Figure 2.2.
Figure 2.2: AND gate and its truth table.
OR gate: The output is high if any one of the input is high. The OR gate and its truth table is shown
in Figure 2.3.
EX-OR gate: The output is high if either of the input is high. The EX-OR gate and its truth table is
given in Figure 2.4.
Arithmetic Circuit
Binary Adder :
In general, the adder circuit needs two binary inputs and two binary outputs. The input variables
designate the augends and addend bits; The output variables produce the sum and carry.
The binary addition operation of single bit is shown in the truth table
C: Carry Bit
S: Sum Bit
This circuit can not handle the carry input, so it is termed as half adder.The circuit diagram and block
diagram of Half Adder is shown in Figure 2.6.
Full Adder:
A full adder is a combinational circuit that forms the arithmetic sum of three bits. It consists of three
inputs and two outputs.
Two of the input variables, denoted by x and y, represent the two bits to be added. The third input Z,
represents the carry from the previous lower position.
The two outputs are designated by the symbols S for sum and C for carry.
̅̅ ̅ ̅ ̅ ̅ ( )
C= ̅ ̅ ̅ ( )
The circuit diagram full adder is shown in the figure.
The circuit diagram and block diagram of a Full Adder is shown in the Figure 2.7. n-such single bit
full adder blocks are used to make n-bit full adder.
To demonstrate the binary addition of four bit numbers, let us consider a specific example.
A =1 0 0 1 B= 0 0 1 1
To get the four bit adder, we have to use 4 full adder block. The carry output the lower bit is used as
a carry input to the next higher bit.
Binary Subtractor :
The subtraction operation can be implemented with the help of binary adder circuit, because
We know that 2's complement representation of a number is treated as a negative number of the
given number.
We can get the 2's complements of a given number by complementing each bit and adding 1 to it.
The circuit for subtracting A-B consist of an adder with inverter placed between each data
input B and the corresponding input of the full adder. The input carry must be equal to 1 when
performing subtraction.
With this principle, a single circuit can be used for both addition and subtraction. The 4 bit adder
subtractor circuit is shown in the figure. It has got one mode ( M ) selection input line, which will
determine the operation,
If , then
If then
Figure 2.9: 4-bit adder subtractor
The circuit diagram of a 4-bit adder substractoris shown in the Figure 2.9.
if
if