0% found this document useful (0 votes)
10 views5 pages

LEC 2 ALU

Uploaded by

Daniel Lumasia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views5 pages

LEC 2 ALU

Uploaded by

Daniel Lumasia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

LECTURE 2: ALU (ARITHMETIC LOGIC UNIT)

ALU is responsible to perform the operation in the computer.


The basic operations are implemented in hardware level. ALU is having collection of two types of
operations:
- Arithmetic operations
- Logical operations
ALU consists of 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:
a) AND gate: The output is high if both the inputs are high.

b) OR gate: The output is high if any one of the input is high.

c) EX-OR gate: The output is high if either of the input is high


If we want to construct a circuit which will perform the AND operation on two 4-bit number, the
implementation of the 4-bit AND operation is:

4-bit AND operator.

Arithmetic Circuit

Binary Adder : Binary adder is used to add two binary numbers.


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 beloww

C: Carry Bit S: Sum Bit


The simplified sum of products expressions are

The circuit implementation is

This circuit cannot handle the carry input, so it is termed as half adder.
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.

The circuit diagram full adder is shown in the figure. 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.
Consider two binary numbers
A =1 0 0 1 B=0011
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.
The circuit of 4-bit adder shown in the figure.

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 added 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.
The operation thus performed becomes A, plus the 1's complement of B , plus 1. This is equal to A plus 2's
complement of B. With this principle, a single circuit can be used for both addition and subtraction.

If , then
If then then (A+1's complement of B+1

4-bit adder subtractor

Multiplication
Multiplication of two numbers in binary representation can be performed by a process of SHIFT and
ADD operations. Since the binary number system allows only 0 and 1's, the digit multiplication can be
replaced by SHIFT and ADD operation only, because multiplying by 1 gives the number itself and
multiplying by 0 produces 0 only.
For example.

The process consists of looking at successive bits of the multiplier, least significant bit first. If the
multiplier bit is a 1, the multiplicand is copied down, otherwise, zeros are copied down. The numbers
copied down in successive lines are shifted one position to the left from the previous number. Finally, the
numbers are added and their sum forms the product.

When multiplication is implemented in a digital computer, the process is changed slightly.


Instead of providing registers to store and add simultaneously as many binary numbers as there are bits in
the multiplier, it is convenient to provide an adder for the summation of only two binary numbers and
successively accumulate the partial products in a register. It will reduce the requirements of registers.
Instead of sifting the multiplicand to the left, the partial product is shifted to right.When the
corresponding bit of the multiplier is 0, there is no need to add all zeros to the partial product.
An algorithm to multiply two binary numbers. Consider that the ALU does not provide the multiplication
operation, but it is having the addition operation and shifting operation. Then we can write a micro
program for multiplication operation and provide the micro program code in memory. When a
multiplication operation is encountered, it will execute this micro code to perform the multiplication.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy