Arithmetic Logical Unit ALU: By-:Akshat Singh Section - : E1113 Roll Number-: B-50 Registration No-: 11004367
Arithmetic Logical Unit ALU: By-:Akshat Singh Section - : E1113 Roll Number-: B-50 Registration No-: 11004367
ON
ARITHMETIC LOGICAL UNIT
ALU
By-:Akshat Singh
Section -: E1113
Roll Number-: B-50
Registration no-: 11004367
VERILOG INTRODUCTION
Verilog was one of the first modern hardware description language to be
invented. It was created by Prabhu Goel and Phil Moorby during the
winter of 1983/1984. The wording for this process was "Automated
Integrated Design Systems" (later renamed to Gateway Design
Automation in 1985) as a hardware modeling language.
Gateway Design Automation was purchased by Cadence Design Systems in
1990. Cadence now has full proprietary rights to Gateway's Verilog and the
Verilog-XL, the HDL-simulator that would become the de facto standard
(of Verilog logic simulators) for the next decade.
Originally, Verilog was intended to describe and allow simulation; only
afterwards was support for synthesis added.
Verilog, standardized as IEEE 1364, is a hardware description
language (HDL) used to model electronic systems. It is most commonly
used in the design and verification of digital circuits at the register-transfer
level of abstraction. It is also used in the verification of analog
circuits and mixed-signal circuits
ALU INTRODUCTION
An arithmetic logic unit (ALU) is a digital circuit used to perform
arithmetic, logic operations and shift opreations.
It represents the fundamental building block of the central
processing unit (CPU) of a computer.
Modern CPUs contain very powerful and complex ALUs. In addition
to ALUs, modern CPUs contain acontrol unit (CU).
Most of the operations of a CPU are performed by one or more
ALUs, which load data from input registers.
A register is a small amount of storage available as part of a CPU.
The control unit tells the ALU what operation to perform on that
data and the ALU stores the result in an output register.
The control unit moves the data between these registers, the ALU
and memory.
IMPLIMENTATION DETAILS
We have implemented our design on Xilinx ISE
software which is a software tool produced by Xilinx for
synthesis and analysis of HDL designs, enabling the
developer to synthesize ("compile") their designs,
perform timing analysis, examine RTL diagrams,
simulate a design's reaction to different stimuli, and
configure the target device with the programmer.
We used behavioral modeling for development of
program and used different instances for Arithmetic,
Logical and Shift operations.
SUBMODULES DISCRIPTION
Arithmetic Unit
This unit of ALU performs all the mathematical operations
of system like addition, subtraction, multiplication etc.
Logical Unit
It performs the logical operations of the system which are
produced by logic gates like NOT, OR, NOR, AND, NAND,
XOR, XNOR.
Shift Unit
It performs all shift functions using shift register of the
system like left shift, right shift, rotation etc.
ARITHMETIC OPERATIONS
Addition
Addition is the basic operation of arithmetic. In its simplest form, addition combines two numbers, the addends or
terms, into a single number, the sum of the numbers. Adding more than two numbers can be viewed as repeated
addition; this procedure is known as summation and includes ways to add infinitely many numbers in an infinite
series; repeated addition of the number one is the most basic form of counting
0101 (decimal 5) + 0011 (decimal 3) = 0100 (decimal 8)
Subtraction
Subtraction is one of the four basic arithmetic operations; it is the inverse of addition, meaning that if we start
with any number and add any number and then subtract the same number we added, we return to the number
we started with. Subtraction is denoted by a minus sign in infix notation.
Multiplication
Multiplication is the second basic operation of arithmetic. Multiplication also combines two numbers into a single
number, the product. The two original numbers are called the multiplier and the multiplicand, sometimes both
simply called factors.
Remainder
The binary % operator is said to yield the remainder of its operands from an implied division; the left-hand
operand is the dividend and the right-hand operand is the divisor. 5%3 produces 2 (note that 5/3 produces 1) 5
%(-3) produces 2 (note that 5/(-3) produces -1)18
ARITHMETIC OPREATIONS(CONTD.)
Division
Division is essentially the opposite of multiplication. Division finds the quotient of two numbers,
the dividend divided by the divisor. Any dividend divided by zero is undefined. For positive
numbers, if the dividend is larger than the divisor, the quotient is greater than one, otherwise it is
less than one (a similar rule applies for negative numbers). The quotient multiplied by the divisor
always yields the dividend.
Modulus
In computing, the modulo operation, sometimes also called "remainder" or "rest", gives the
remainder from a division. It finds the remainder of division of one number by another. Given two
numbers, a (the dividend) and n (the divisor), a modulo n abbreviated as a mod n) is the remainder,
on division of a by n. For example, if you divide 7 by 3, 3 goes in 7 two times. But there is a
remainder of 1, and that is the result of the modulo operation.
LOGICAL OPERATIONS
AND Gate
A bitwise AND takes two binary representations of equal length and performs the logical AND
operation on each pair of corresponding bits. In each pair, the result is 1 if the first bit is 1 AND the
second bit is 1. Otherwise, the result is 0. For example:
0101 (decimal 5) AND 0011 (decimal 3) = 0001 (decimal 1)
OR Gate
A bitwise OR takes two bit patterns of equal length, and produces another one of the same length
by matching up corresponding bits (the first of each; the second of each; and so on) and performing
the logical inclusive OR operation on each pair of corresponding bits. In each pair, the result is 1 if
the first bit is 1 OR the second bit is 1 OR both bits are 1, and otherwise the result is 0. For example:
0101 (decimal 5) OR 0011 (decimal 3) = 0111 (decimal 7)
NOT Gate
The bitwise NOT, or complement, is a unary operation that performs logical negation on each bit,
forming the ones' complement of the given binary value. Digits which were 0 become 1, and vice
versa. For example: NOT 0111 (decimal 7) = 1000 (decimal 8)\ 20
LOGICAL OPERATIONS(CONTD.)
NOR Gate
A bitwise NOR takes two bit patterns of equal length, and produces another one of the same length
by matching up corresponding bits (the first of each; the second of each; and so on) and performing
the logical inclusive OR operation on each pair of corresponding bits. In each pair, the result is 1 if
the both bits are zero otherwise the result is 0. For example:
0101 (decimal 5) OR 0011 (decimal 3) = 1000 (decimal 8)
XOR Gate
A bitwise exclusive or takes two bit patterns of equal length and performs the logical XOR operation
on each pair of corresponding bits. The result in each position is 1 if the two bits are different, and
0 if they are the same. For example:
0101 (decimal 5) XOR 0011 (decimal 3) = 0110 (decimal 6)
XNOR Gate
The XNOR gate is a digital logic gate whose function is the inverse of the exclusive OR (XOR) gate.
The two-input version implements logical equality, behaving according to the truth table to the
right. A HIGH output (1) results if both of the inputs to the gate are the same. If one but not both
inputs are HIGH (1), a LOW output (0) results.
LOGICAL OPERATIONS(CONTD.)
NAND Gate
A bitwise NAND takes two binary
representations of equal length and performs
the logical NAND operation on each pair of
corresponding bits. In each pair, the result is 0
if the first bit is 1 AND the second bit is 1.
Otherwise, the result is 1. For example:
0101 (decimal 5) AND 0011 (decimal 3) = 1110
(decimal 14)
SHIFT OPREATIONS
Shift Left
The left-shift operator
causes the bits in shiftexpression to be shifted to
the left by the number of
positions specified
by additive-expression. The
bit positions that have been
vacated by the shift
operation are zero-filled. A
left shift is a logical shift
(the bits that are shifted off
the end are discarded,
including the sign bit).
SHIFT OPREATIONS(CONTD.)
Shift Right
The right-shift operator causes
the bit pattern in shiftexpression to be shifted to the
right by the number of
positions specified by additiveexpression. For unsigned
numbers, the bit positions that
have been vacated by the shift
operation are zero-filled. For
signed numbers, the sign bit is
used to fill the vacated bit
positions. In other words, if
the number is positive, 0 is
used, and if the number is
negative, 1 is used.
SHIFT OPREATIONS(CONTD.)
Rotate Left and Rotate Right
Another form of shift is
the circular shift or bit
rotation. In this operation, the
bits are "rotated" as if the left
and right ends of the register
were joined. The value that is
shifted in on the right during a
left-shift is whatever value was
shifted out on the left, and
vice versa. This operation is
useful if it is necessary to
retain all the existing bits, and
is frequently used in
digital cryptography.
RTL SCHEMETICS
Inputs and outputs flow along an electronic path that is called a bus. The input
consists of an instruction word (sometimes called a machine instruction word) that
contains an operation code (sometimes called an "op code"), one or more
operands, and sometimes a format code. The operation code tells the ALU what
operation to perform and the operands are used in the operation.
In general, the ALU includes storage places for input operands, operands that are
being added, the accumulated result (stored in an accumulator), and shifted
results. The flow of bits and the operations performed on them in the subunits of
the ALU is controlled by gated circuits. The gates in these circuits are controlled by
a sequence logic unit that uses a particular algorithm or sequence for each
operation code. In the arithmetic unit, multiplication and division are done by a
series of adding or subtracting and shifting operations.
APPLICATIONS
The ALU is responsible for complex mathematical
calculations, such as floating point math. It does not
have any specific additional use as related to
databases, except to say that the database, as any
other software, uses the ALU to perform sums,
averages, and so on during queries.
An ALU is an integrated circuit within
a CPU or GPU that performs arithmetic and logic
operations. It is the most important part of
microprocessors.
It is used in calculators, computers, microprocessors,
microcontrollers etc.
THANK YOU