SlideShare a Scribd company logo
1 of 66
Download to read offline
DESIGN AND IMPLEMENTATION OF 32-BIT ALU USING
VERILOG
A.Athihrii -12UEC001
M Stephen -12UEC016
Sanjay Kumar -12UEC020
(i)
DESIGN AND IMPLEMENTATION OF 32-BIT ALU USING
VERILOG
Report submitted to
National Institute of Technology Manipur
for the award of the degree
of
Bachelor of Technology in Electronics and communication Engineering
by
A.Athihrii (12UEC001)
M. Stephen (12UEC016)
Sanjay kumar(12UEC020)
Under the guidance of Shri MANOJ KUMAR
Assistant Professor, NIT Manipur
DEPARTMENT OF ELECTRONICS AND COMMUNICATION
ENGINEERING
NATIONAL INSTITUTE OF TECHNOLOGY MANIPUR
MAY 2016
© 2016, Athihrii, Stephen, Sanjay. All rights reserved
(ii)
DECLARATION
We certify that
a. the work contained in this report is original and has been done by me under the
guidance of my supervisor(s).
b. the work has not been submitted to any other Institute for any degree or diploma.
c. I have followed the guidelines provided by the Institute in preparing the report.
d. I have conformed to the norms and guidelines given in the Ethical Code of Conduct
of the Institute.
e. whenever I have used materials (data, theoretical analysis, figures, and text) from
other sources, I have given due credit to them by citing them in the text of the report
and giving their details in the references. Further, I have taken permission from the
copyright owners of the sources, whenever necessary. Signature of the Student
Signature of the Student
……………………………….
……………………………….
……………………………….
(v)
ACKNOWLEDGEMENT
It gives us immense pleasure to express our heartfelt gratitude and sincere thanks to our
project mentor Shri. Manoj Kumar (Assistant Professor, Electronics And Communication
Engineering) for his timeless and valuable contribution, suggestion and encouragement for
the completion of this project. His continuous guidance had led us to execute our project
titled “DESIGN AND IMPLEMENTATION OF 32-BIT ALU USING VERILOG”.
We are deeply indebted to you Sir.
A. ATHIHRII(12UEC001)
M. STEPHEN (12UEC016)
SANJAY KUMAR(12UEC020)
(vi)
ABSTRACT
In this fast growing booming technology, the need for high-tech and superfast technology is
on high demand. Hence through the use of FPGA (Field Programmable Gate Array) we can
design superfast technology especially in the field of embedded system.
Verilog standardized as IEEE 1364 is a hardware description language(HDL), a textual
format for describing electronics design and circuits. Applied to electronic design, verilog is
intended to used for verification through simulation, for timing analysis, for test analysis
(testability analysis and fault grading) and for logic synthesis.
An Arithmetic Logic Unit (ALU) is a digital electronic circuits that performs arithmetic and
bitwise logical operations on integer binary numbers. This is in contrast to FPU(Floating
point unit )which operates on floating point numbers. ALU is a fundamental building block of
many type of computing circuits including the central processing unit (CPU), FPU and GPU
(Graphics Processing Unit).A single CP, FPU and GPU may contain multiple ALUs.
(vii)
CONTENTS
TITLE Page NO.
Title page i
Certificate iii
Certificate iv
Declaration v
Acknowledgement vi
Abstract vii
Contents viii
List of Figures xi
List of table xii
CHAPTER-1 INTRODUCTION AND LITERATURE REVIEW 1 - 5
1.1 HDL (Hardware Description language) 1
1.2 Typical Design Flow 3
1.3 Literature review 4
CHAPTER-2 INTRODUCTION TO VERILOG AND XILINX 6 - 10
2.1 Verilog 6
2.2 Xilinx 8
2.2.1 Procedure to Operate Xilinx (ISE 14.7) 9
2.3 Tools and Enviroment Used 10
2.3.1 Minimum Hardware Requirement 10
2.3.2 Minimum Software Requirement 10
(viii)
CHAPTER-3 DESIGN OF ALU 11-19
3.1 Arithmetic Unit 11
3.2 Logic Unit 14
3.3 Shift unit 15
3.3.1 Left Shift 15
3.3.2 Right Shift 16
3.4 Arithmetic Logic Unit 17
CHAPTER-4 VERILOG CODING AND WAVEFORM 20 – 47
4.1 Selection MUX 4 to 1 (1 bit I/O) 20
4.2 Selection MUX 4 to 1 (32-bit I/O) 21
4.3 Selection MUX 2 to 1 (32-bit I/O) 21
4.4 Full adder 22
4.5 4-bit Adder 22
4.6 32-bit Adder 23
4.7 32-bit AND 23
4.8 32-bit OR 23
4.9 32-bit XOR 24
4.10 32-bit NOT 24
4.11 Right shift 24
4.12 Left shift 25
4.13 Shift unit 25
(ix)
4.14 Arithmetic unit 26
4.15 Logic unit 30
4.16 32-bit ALU 32
4.17 Test Bench for 32-bit ALU 40
CHAPTER-5 ADVANTAGE AND CONCLUSION 48 - 52
5.1 Importance of HDL 48
5.2 Advantage of Verilog HDL 48
5.3 Conclusion 49
5.4 Future scope of Verilog 50
5.4.1 Design process 50
5.4.2 System Level 51
5.4.3 Digital 51
5.4.4 Analog 51
5.4.5 Debugging 52
REFERENCES 53
(x)
LIST OF FIGURES
1.1 TYPICAL DESIGN FLOW 3
2.2 Xilinx ISE Interface 9
3.1 32-bit Arithmetic unit 13
3.2 32-bit Logic unit 14
3.3.1 (a) 32-bit before Left Shift 15
(b) 32-bit after Left Shift 16
3.3.2 (a) 32-bit before Right Shift 16
(b) 32-bit after Right 16
3.3.3 32-bit Shift unit 17
3.4 Arithmetic Logic Unit 19
4.1 RTL of 32-bit ALU 44
4.2 4 to 1 32-bit Waveform 45
4.3 32-bit Arithmetic Unit Waveform 45
4.4 32-bit Logic Unit waveform 46
4.5 32-bit Shift unit Waveform 46
4.6 32-bit Arithmetic Logic unit Waveform 47
5.4.1 Design process 50
(xi)
LIST OF TABLE
Table 1. Table of 32-bit Arithmetic unit 12
Table 2. Table of 32-bit Logic uni 15
Table 3. Table of 32-bit Shift unit 17
Table 4. Table of 32-bit Arithmetic Logic unit 19
(xii)
This is to certify that the dissertation entitled
“Design and Implementation of 32-bit ALU using Verilog”
to the National Institute of Technology Manipur, India, is a record of
bonafied project work carried out under my supervision and guidance and is
worthy of consideration for the award of the degree of Bachelor of
Technology in Electronics and Communication Engineering of the Institute.
Signature of Guide
(Shri.Manoj Kumar)
(iii)
Department of Electronics and Communication Engineering
Takyelpat, Imphal- 795001, Ph.:0385-2445812, email:
Ref no.: NITMN/ECE:4/B.TECH/ ...... Dated.........
This is to certify that the Dissertation Report entitled,
submitted by Mr.“A.Athihrii,
M. Stephen, Sanjay Kumar” to National Institute of Technology Manpur,
India, is a record of bonafide Project work carried out by them under the
supervision and guidance of Shri. Manoj Kumar (Assistant Professor, NIT
Manipur) and is worthy of consideration for the award of the degree of Bachelor
of Technology in Electronics and Communication Engineering of the Institute.
HOD, ECE Department
NIT MANIPUR
(iv)
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 1
Design and implementation of 32-bit ALU using Verilog 2016
Chapter 1
INTRODUCTION AND LITERATURE REVIEW
Digital circuit design has evolved rapidly, the earliest digital circuits were designed with
vacuum tubes and transistors. With the advent of VLSI (Very Large Scale Integration)
technology, designers could design single chip with more than 100,000 transistors.
Because of the complexity of these circuits, it was not possible to verify these circuits on
a breadboard. Computer aided techniques became critical for verification and design of
VLSI digital circuits. Computer programs to do automatic placement and routing of
circuit layout also became popular. The designers were now building gate level digital
circuits manually on graphic terminals. They would build small building blocks and then
derive higher level blocks from them. This process would continue until they had built
the top-level block. Logic simulator came into existence to verify the functionality of
these circuits before they were fabricated on chip.
1.1 HDL (Hardware Description Language)
Hardware Description Language [1] came into existence to replace programming
language such as FORTAN, Pascal and C as a standard language to describe digital
circuit. HDL is a specialized computer language used to describe the structure and
behaviour of electronic circuit, and most commonly digital logic circuit.
There are two types of HDL:
1. Verilog HDL
2. VHDL (VHSIC Hardware Description Language)
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 2
Design and implementation of 32-bit ALU using Verilog 2016
The advent of logic synthesis in the late 1980s changed the design methodology radically.
Digital circuit could be described at RTL (Register Transfer Level) by use of an HDL.
Thus, the designer had to specify how the data flow between register and how the design
processes the data. The detail of gates and their interconnections to implement the circuits
were automatically extracted by logic synthesis tools from RTL descriptions
HDL also began to use for system-level design. HDLs were used for simulation of system
boards; interconnect buses, FPGA (Field Programmable Gate Array) and PALs
(Programmable Array Logic). A common approach is to design each IC chip, using an
HDL, and then verify system functionality via simulation.
Verilog HDL originates in 1983 at Gateway Design Automation. Later, VHDL was
developed under contract from DARPA. Both Verilog and VHDL simulators to simulate
large digital circuit quickly gain acceptance from designers. Verilog is a Hardware
Description Language, a textual format for describing electronic circuits and systems.
Applied to electronic design, Verilog is intended to be used for verification through
simulation, for timing analysis, for test analysis (testability analysis and fault grading)
and for logic synthesis.
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 3
Design and implementation of 32-bit ALU using Verilog 2016
1.2 TYPICAL DESIGN FLOW
A typical design flow for designing VLSI IC circuits is shown in figure 1.1.Unshaded
blocks show the level of design representation [1] ;shaded blocks show processes in the
design flow;
Fig. 1.1 Typical Design Flow
Behavioural Description
RTL Description (HDL)
Functional Verification and
Testing
Logic synthesis
Gate-Level Netlist
Logical Verification and
Testing
Floor planning, Automatic
Place and Route
Physical Layout
Layout Verification
Implementation
Design specification
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 4
Design and implementation of 32-bit ALU using Verilog 2016
1.3 LITERATURE REVIEW
The general idea of this particular project is to compile 32–bits logic gates, shift gates and
arithmetic operation into one single MUX to carry out the desire operation successfully.
1. In ‗Verilog HDL, A guide to digital Design and Synthesis’ [1], the book
imparts the working knowledge of a broad variety of Verilog-based topics, thus
giving the reader a global understanding of Verilog HDL-based design. The book
leaves the in-depth coverage of each topic to the Verilog HDL language reference
manual and the reference manuals of the individual Verilog-based products.
2. In ‗The Verilog Hardware Description language‘ [2], it focus on tutorial
approach to presenting the language. It continues with a more complete discussion
of the language constructs. Numerous example are also provided to allow the
reader to make it more easy to learn through examples. The rest of the book could
be used in upper level logic design and architecture courses
3. In ‗A Verilog HDL Primer‘ [3][4], It is a practical and useful guide to Verilog
HDL register-transfer level synthesis. A large number of synthesizable Verilog
HDL examples are provided. Verilog HDL constructs that are supported for
synthesis are described in detail. Common causes of functional mismatches
between the design model and the synthesized netlist are described in detail and
recommendations are make on how to avoid this.
4. In ‗Verifiable RTL Design: A Functional Coding Style Supporting
Verification Processes in Verilog‘ [5] and ‗IEEE Std 1364-2001 : IEEE Standard
Hardware Description Language based on the Verilog Hardware Description
Language Published by the IEEE, Inc., http://www.ieee.org 345 East 47th Street,
New York, NY 10017, USA‘ [6], mostly introduce a verifiable subset of Verilog
and a simple RTL coding style. It enabled us to effectively incorporate these new
verification technologies into our design flow. To provide a framework for
discussion, it place emphasis on describing verification processes throughout the
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 5
Design and implementation of 32-bit ALU using Verilog 2016
text-as opposed to an in-depth discussion of the Verilog language. This book tells
how you can write Verilog to describe chip designs at the RT-level in a manner
that cooperates with verification processes. This cooperation can return an order
of magnitude improvement in performance and capacity from tools such as
simulation and equivalence checkers.
5. In the project ‗Design and Implementation of 32-Bit ALU on XILINX FPGA
using VHDL‘ [7] they are designing an 32-bit ALU using VHDL and
implementing on Xilinx FPGA.
6. In the project ‗Implementation of 32-bit Arithmetic Logic Unit on Xilinx using
VHDL‘ [8] the are implemeting the 32-bit ALU code on Xilinx.
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 6
Design and implementation of 32-bit ALU using Verilog 2016
Chapter 2
INTRODUCTION TO VERILOG AND XILINX
2.1 Verilog
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. Verilog HDL has become an
industry standard as a result of extensive used in the design of IC chips and digital
systems. Verilog came into being as a proprietary language supported by a simulation
environment that was the first to support by a simulation environment that was the first to
support mixed-level design representations comprising switches, gates, RTL and higher
levels of abstractions of digital circuits. The simulation environment provided a powerful
and uniform method to express digital designs as well as tests that were meant to verify
such designs.
There were three key factors that drove the acceptance and dominance of Verilog in the
marketplace. First, introduction of Programming Language Interface (PLI) permitted
users of Verilog to literally extend and customized the simulation environment. Since
then users have exploited the introduction of Verilog-based synthesis technology by
Synopsys. The combination of the simulation and synthesis technologies serve to make
Verilog the language of choice for PLI and their success at adapting Verilog to their
environments has been a real winner for Verilog. The Second key factor which drove
Verilog‘s dominance came from Gateways paying close attention to the needs of the
ASIC foundries and enhancing Verilog in close partnership with Motorola, National and
UTMC.The realisation that the vast majority of logic simulation was being done by
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 7
Design and implementation of 32-bit ALU using Verilog 2016
designers of ASIC chips drove this effort. The third key factor behind the success was the
the hardware designers.
Verilog also provide the concept of a module. A module is the basic building block in
verilog. A module can be an element or a collection of lower-level design block. A
module provides the necessary functionality to the higher level block through its port
interface (inputs and outputs), but hides the internal implementation. This allows the
designer to modify module internals without affecting the rest of the design.
Verilog is both a behavioural and structural language[1]. Internals of each module can be
defined at four level of abstraction. The levels are defined below.
i. Behavioural or algorithmic level
This is the highest level of abstraction provided by verilog HDL. A module can be
implemented in terms of the desired design algorithm without concern for the hardware
implementation details.
ii. Data flow
At this level the module is designed by specifying the data flow. The designer is aware
of how data flows between hardware registers and how the data is processed in the
design.
iii. Gate level
The module is implemented in terms of logic gates and interconnection between these
gates. Design at this level is similar to describing a design in terms of a gate level logic
diagram.
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 8
Design and implementation of 32-bit ALU using Verilog 2016
iv. Switch level
This is the lowest level of abstraction provided by verilog. A module can be implemneted
in terms of switches, storage nodes and the interconnection between them.
Verilog allows a designer to mix and match all four levels of abstraction in a design. In
the digital design community, the term Register Transfer Level (RTL) is frequently used
for a verilog description that uses a combination of behavioural and data flow constructs
and is acceptable to logic synthesis tools.
2.2 Xilinx
Xilinx is an American technology company, primarily a supplier of programmable logic
devices and the first semi-conductor company with a fabulous manufacturing model.
Founded in Silicon valley in 1984 and head quartered in San Jose, California, USA, the
company has cooperate offices throughout North America and Europe
Xilinx ISE (Integrated Software environment) is a software tool produced by xilinx for
synthesis and analysis of HDL designs, enabling the developer to synthesize their
designs, perform timing analysis, examine RTL diagrams, simulate a design‘s reaction to
different stimuli and configure the target device with a programmer.
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 9
Design and implementation of 32-bit ALU using Verilog 2016
2.2.1 Procedure to operate Xilinx. (ISE 14.7)
1. Open the Xilinx project Navigator
2. Following are the main areas of the Project Navigator, which are shown in the
following figure:
 Toolbar - provides convenient access to frequently used menu commands.
 Design panel - provides access to the following areas:
o Design View - allows you to select a design phase from the ―Sources for‖
area, which controls the sources files displayed in the Hierarchy pane.
o Hierarchy pane - allows you to view and manage design source files.
o Processes pane - allows you to run processes, which move the design
from design creation through programming the device. In addition, you
can run processes that allow you to analyze and improve your design.
 Workspace - allows you to view and edit your design using various tools, and
provides access to reports in the Design Summary.
 Transcript window - allows you to view output log, messages, errors, and
warning information as it is generated.
Fig2.2 Xilinx ISE Interface
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 10
Design and implementation of 32-bit ALU using Verilog 2016
2.3 Tools and Environment Used
2.3.1 Minimum Hardware Requirement:
1. Computer : IBM or Compatible
2. Hard disk : 20 GB or higher
3. Processor : PENTIUM– IV 2 GHz or above
4. Ram : 512 Mb and above
5. VDU : VGA
2.3.2 Minimum Software Requirement:
1. Operating System : Windows XP
2. Development Software : Xilinx ISE 8.2i
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 11
Design and implementation of 32-bit ALU using Verilog 2016
Chapter 3
DESIGN OF ALU
Designing of the ALU will follow the principle "Divide and Conquer" in order to use a
modular design that consists of smaller, more manageable blocks, some of which can be
re-used.
An ALU consists of 3 units:
1. Arithmetic unit: Consists of addition, subtraction, addition with carry
subtraction with borrow, increment, decrement and transfer.
2. Logic Unit: Consists of AND gate, OR gate, NOT gate and XOR gate.
3. Shift Unit: Consists of left shift, right shift.
3.1 Arithmetic unit
An Arithmetic unit does the following task: Addition, Addition with carry, Subtraction,
Subtraction with borrow, Decrement, Increment and Transfer function. As the input is
given in 32-bit, we get 32-bit output. The arithmetic will show only one output at a time ,
so a selector is necessary to select one of the operator.
In this case, we use 8:1 multiplexer where s2, s1,s0 are selector lines, A and B is the
input to be given and Y is the output. Function Table for Arithmetic is shown in table 1.
When s2s1s0= 000:
then Y = A+B i.e. Addition.
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 12
Design and implementation of 32-bit ALU using Verilog 2016
When s2s1s0= 001:
then RESULT= A-B i.e. Subtraction.
When s2s1s0= 010:
then RESULT= A+B+1 i.e. Addition with carry
When s2s1s0= 011:
then RESULT= A+(~B) i.e. Subtraction with borrow.
When s2s1s0= 100:
then RESULT= A+1 i.e. Increment.
When s2s1s0= 101:
then RESULT= A-1 i.e. decrement.
When s2s1s0= 110:
then RESULT= A i.e. Transfer.
Table 1. Table of 32-bit Arithmetic Unit
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 13
Design and implementation of 32-bit ALU using Verilog 2016
Fig 3.1. 32-bit Arithmetic unit
Subtraction with borrow
Increment
Decrement
Transfer
Addition with carry
Subtraction
Addition
8:1 MUX
Y
S2 S1 S0
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 14
Design and implementation of 32-bit ALU using Verilog 2016
3.2 Logic Unit
A Logic unit does the following task: Logical AND, Logical OR, Logical XOR and
Logical NOT operation. We will design a logic unit that can perform the four basic logic
Micro operations: OR, AND, XOR and Complement, because from these four micro-
operations, all other logic micro-operations can be derived. A one-stage logic unit for
these four basic micro-operations is shown in the Fig.3.2
Fig. 3.2 32-bit Logic Unit
The logic unit consists of four gates and a 4:1 multiplexer. The outputs of the gates are
applied to the data inputs of the multiplexer. Using to selection lines S0 and S1 one of the
data inputs of the multiplexer is selected as the output. For a logic unit of 32bit, the
output will be of 33-bit with 33th bit to be High-impedance.
The common selection lines are applied to all the stages.
When S1 S0= 00: RESULT= A∙B i.e. AND.
When S1 S0= 01: RESULT= A+B i.e. OR.
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 15
Design and implementation of 32-bit ALU using Verilog 2016
When S1 S0= 10: RESULT= A⨁B i.e. XOR.
When S1 S0= 10: RESULT= A i.e. NOT
Table 2 .Table of 32-bit Logic Unit
3.3 Shift Unit
A Shift register is a storage device that used for storage or the transfer of data in the form
of binary numbers. Considering two types of register:
i. Left shift
ii. Right shift
3.3.1 Left Shift
Data is shifted in the left hand direction one bit at a time with each transition of the
clock signal. The data enters the shift register serially from the right hand side and after
32 clock transition the 32-bit register has 32-bit of data . The data is shifted out serially
one bit at a time from the left hand side of the register if clock signal are continuously
applied. The operation of left shit is shown on the figure 3.3.1 (a) and (b)..
(a)
D31 D30 D0. . . . . . . . . . . . . . . D1 C_in
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 16
Design and implementation of 32-bit ALU using Verilog 2016
(b)
Fig. 3.3.1 (a)32-bit before left shift. (b)32-bit after left shift.
3.3.2 Right Shift
The data is shifted in the right hand direction one bit at a time with each transition of the
clock signal. The data enter the shift register serially from the left hand side and after 32
clock transition the 32- bit register has 32-bit of data. The data is shifted out serially one
bit at a time from the right hand side of the register if clock signal are commonly applied
.The operation of right shift is shown on the figure 3.3.2 (a) and (b).
(a)
The contents of a register that has to be shifted first placed onto common bus. The
D30 D29 . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . .. . . . . D0 C_in
D31
. . . . . . .C_in D31 D30 D0D1. .. . . .. . . . . . . . . . . . . . . . . . . . . . . . .. . . .. . . . . .. .C_in
-in D0C_in D31 D30 D1D2. . . . .. . . . . . . . . . . . . . . . . . .
(b)
Fig 3.3.2 (a) 32-bit before right shift .(b) 32- bit after right shift
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 17
Design and implementation of 32-bit ALU using Verilog 2016
circuit uses no clock pulse. When the shifting unit is activated, the register is shifted left
or right according to the selection unit. It used only one selector line i,e s1.
For a shift unit of 32- bit, the output will be of 33-bit with 33th bit to be the outgoing bit.
The circuit of shift unit is shown in figure 3.3
Fig 3.3. 32-bit Shift Unit
Table 3. Table of 32-bit Shift Unit
3.4 Arithmetic Logic Unit
The technique used in these is to split ALU into three modules, Arithmetic, Logic and
shift module. Here the arithmetic, logic and shift that define earlier are combined into
ALU with common selection line. The shift micro-operation are often perform in seperate
unit, but sometime the shifter unit made part of overall ALU.
For 32-bit ALU a 33 bit 4:1 MUX is needed. A particular arithmetic or logic or shift
operation is selected according to the selection inputs S4 ,S5,S6 and S7. The final output
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 18
Design and implementation of 32-bit ALU using Verilog 2016
of the ALU is determined by the set of multiplexers with selection lines S2 and S3 for
logic and S1 for shift.. The function table for the ALU is shown in the Table. 4. The table
lists 13 micro-operations: 7 for arithmetic, 4 for logic and 2 for shifter unit. For shifter
unit, the selection line S1 is used to select either left or right shift micro-operation.
Table 4. Table of 32-bit Arithmetic Logic Unit
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 19
Design and implementation of 32-bit ALU using Verilog 2016
Fig.3.4 Arithmetic Logic Unit
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 20
Design and implementation of 32-bit ALU using Verilog 2016
Chapter 4
VERILOG CODING AND WAVEFORM
4.1 Selection MUX 4 to1(1-bit I/O)
module mux4(i0,i1,i2,i3,s0,s1,clk,y);
input i0,i1,i2,i3,s0,s1,clk;
output reg y;
always @(posedge clk)
case({i0,i1,i2,i3,s0,s1})
2'b00:y=i0;
2'b01:y=i1;
2'b10:y=i2;
2'b11:y=i3;
default y=1'bz;
endcase
endmodule
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 21
Design and implementation of 32-bit ALU using Verilog 2016
4.2 Selection MUX 4 to1(32-bit I/O)
module mux4l (out, i0, i1, i2, i3, s1, S0);
input[31:0] i0, i1, i2, i3;
input s1, S0;
output[31:0] out;
reg[31:0] out;
always @(s1 or S0 or i0 or i1 or i2 or i3)
case ({s1, S0})
2'b00 : out = i0;
2'b01 : out = i1;
2'b10 : out = i2;
2'b11 : out = i3;
default: $display("Invalid control signals");
endcase
endmodule
4.3 Selection MUX 2 to1(32-bit I/O)
module mux2l (out, i0, i1, S0);
input[31:0] i0, i1;
input S0;
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 22
Design and implementation of 32-bit ALU using Verilog 2016
output[31:0] out;
reg[31:0] out;
always @( S0 or i0 or i1 )
case ({ S0})
1‘b0 : out = i0;
1‘b1 : out = i1;
default: $display("Invalid control signals");
endcase
endmodule
4.4 Full Adder
module fadd1(a,b,s,c,carry);
input a,b,c;
output s,carry;
assign s=a^b^c;
assign carry=a&b+b&c+c&a;
endmodule
4.5 4-Bit Adder
module add(a,b,y);
input [3:0]a,b;
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 23
Design and implementation of 32-bit ALU using Verilog 2016
output[3:0] y;
assign y=a+b;
endmodule
4.6 32-Bit Adder
module ader32bit(a,b,y);
input[31:0]a,b;
output [31:0]y;
assign y=a+b;
endmodule
4.7 32-Bit AND
module and32(a,b,y);
input [31:0]a;
input [31:0]b;
output [31:0]y;
assign y=a&b;
endmodule
4.8 32-Bit OR
module or1(a,b,y);
input[31:0]a,b;
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 24
Design and implementation of 32-bit ALU using Verilog 2016
output[31:0]y;
assign y=a|b;
endmodule
4.9 32-Bit XOR
module xor32(a,b,y);
input [31:0]a;
input [31:0]b;
output [31:0]y;
assign y=a^b;
endmodule
4.10 32-Bit NOT
module not32(a,y);
input [31:0]a;
output [31:0]y;
assign y=~a;
endmodule
4.11 Right Shift
module rshift(a,b);
input[31:0]a;
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 25
Design and implementation of 32-bit ALU using Verilog 2016
output[31:0]b;
assign b=a>>1;
endmodule
4.12 Left Shift
module shift32a(a,b);
input[31:0]a;
output[31:0]b;
assign b=a<<1;
endmodule
4.13 Shift Unit
module shift1(s1,a,cin,result);
input [31:0]a;
input s1,cin;
output reg[31:0]result ;
wire[31:0] w1,w2;
rshift r1(a,w1);
lshift r2(a,w2);
always @(a,s1,cin,w1,w2)
case({s1})
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 26
Design and implementation of 32-bit ALU using Verilog 2016
1'b0:result<=w1;
1'b1:result<=w2;
default:result<=1'b0;
endcase
endmodule
module rshift(a,b);
input[31:0] a;
output[31:0] b;
assign b=a>>1;
endmodule
module lshift(a,b);
input [31:0]a;
output [31:0] b;
assign b=a<<1;
endmodule
4.14 Arithmetic Unit
module arith1(a,b,cin,s0,s1,s2, result);
input[31:0] a,b;
input cin;
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 27
Design and implementation of 32-bit ALU using Verilog 2016
input s0,s1,s2;
output[31:0] result;
reg[31:0] result;
wire[31:0]w0,w1,w2,w3,w4,w5,w6;
add r1(a,b,w0);
sub r2(a,b,w1);
addwc r3(a,b,cin,w2);
subwb r4(a,b,cin,w3);
inc r5(a,w4);
dec r6(a,w5);
tra r7(a,w6);
always@(a,b,cin,s0,s1,s2,w0,w1,w2,w3,w4,w5,w6)
case ({s2,s1,s0})
3'b000: result<=w0; //addition//
3'b001: result<=w1; //subtraction//
3'b010: result<=w2; //addition with carry//
3'b011: result<=w3; //subtraction with borrow//
3'b100: result<=w4; // increment//
3'b101: result<=w5; //decrement//
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 28
Design and implementation of 32-bit ALU using Verilog 2016
3'b110: result<=w6; //transfer//
3'b111: result<=1'bx; //no need //
endcase
endmodule
//add//
module add(a,b,y);
input [31:0]a,b;
output[31:0] y;
assign y=a+b;
endmodule
//sub//
module sub(a,b,y);
input [31:0]a,b;
output[31:0] y;
assign y=a-b;
endmodule
//additiion with carry//
module addwc(a,b,cin,y);
input [31:0]a,b;
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 29
Design and implementation of 32-bit ALU using Verilog 2016
input cin;
output [31:0]y;
assign y=a+b+cin;
endmodule
//sub with borrow//
module subwb(a,b,cin,y);
input [31:0]a,b;
input cin;
output [31:0]y;
//output br;
assign y=a+(~b)+cin;
endmodule
//increment//
module inc(a,y);
input[31:0] a;
output[31:0] y;
assign y=a+1;
endmodule
//deredment//
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 30
Design and implementation of 32-bit ALU using Verilog 2016
module dec(a,y);
input [31:0]a;
output [31:0]y;
assign y=a-1;
endmodule
//transfer//
module tra(a,y);
input[31:0]a;
output[31:0]y;
assign y=a;
endmodule
4.15 Logic Unit
module logicunit32bit(a,b,s1,s0,result );
input[31:0] a,b;
input s1,s0;
output reg [31:0]result;
wire [31:0]w1,w2,w3,w4;
and1 a1 (a,b,w1);
or1 a2 (a,b,w2);
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 31
Design and implementation of 32-bit ALU using Verilog 2016
not1 a3(a,w3);
exor1 a4(a,b,w4);
always @(a,b,s1,s0,w1,w2,w3,w4)
begin
case({s1,s0})
2'b00:result<= w1;
2'b01:result<=w2;
2'b10:result<=w3;
2'b11:result<=w4;
default:result<=1'b0;
endcase
end
endmodule
module and1(c,d,j);
input[31:0] c,d;
output [31:0]j;
assign j=c&d;
endmodule
module or1(c,d,j);
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 32
Design and implementation of 32-bit ALU using Verilog 2016
input[31:0] c,d;
output[31:0] j;
assign j=c|d;
endmodule
module not1(c,d);
input[31:0] c;
output [31:0]d;
assign d= ~c;
endmodule
module exor1(c,d,j);
input [31:0]c,d;
output [31:0]j;
assign j=c^d;
endmodule
4.16 32- bit ALU
module alu2(a,b,s2,s3,s1,s0,s4,s5,s6,s7,cin,result );
input[31:0] a,b;
input s2,s3,s1,s0,s4,s5,s6,s7,cin;
output reg[31:0] result;
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 33
Design and implementation of 32-bit ALU using Verilog 2016
wire [31:0]w1,w2;
wire[31:0] w3;
wire [31:0]w4,w5,w6,w7,w8,w9,w10;
shift a1(s1,a,cin,w1);
logicunit32bit a2 (a,b,s2,s3,w3);
addcarry a3(a,b,cin,w4,s4,s5,s6,s7);
add a4 (a,b,cin,w5,s4,s5,s6,s7);
sub a5 (a,b,cin,w6,s4,s5,s6,s7 );
subcarry a6 (a,b,cin,w7,s4,s5,s6,s7 );
incremen22 a7 (a,cin,w8,s4,s5,s6,s7);
decremen22 a8 (a,cin,w9,s4,s5,s6,s7);
trd a9 (w10,a,cin,s4,s5,s6,s7);
always @(a,b,w3,s1,s0,cin,s4,w1,w4,w5,w6,w7,w8,w9,w10,s5,s2,s6,s7,s3)
begin
case({s4,s5,s6,s7})
4'b0000:result<= w3;
4'b0001:result<=w1;
4'b0010:result<=w4;
4'b0011:result<=w5;
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 34
Design and implementation of 32-bit ALU using Verilog 2016
4'b0100:result<=w6;
4'b0101:result<=w7;
4'b0110:result<=w8;
4'b0111:result<=w9;
4'b1000:result<=w10;
4'b1001:result<=1'bx;
4'b1010:result<=1'bx;
4'b1011:result<=1'bx;
4'b1100:result<=1'bx;
4'b1101:result<=1'bx;
4'b1110:result<=1'bx;
4'b1111:result<=1'bx;
default:result<=1‘b0;
endcase
end
endmodule
module shift(s1,a,cin,res);
input[31:0] a;
input s1,cin;
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 35
Design and implementation of 32-bit ALU using Verilog 2016
output reg [31:0]res ;
wire [31:0]w1,w2;
rshift r1(a,w1);
lshift r2(a,w2);
always @(a,s1,w1,w2)
case({s1})
1'b0:res<=w1;
1'b1:res<=w2;
endcase
endmodule
module rshift(a,b);
input[31:0] a;
output[31:0] b;
assign b=a>>1;
endmodule
module lshift(a,b);
input[31:0] a;
output [31:0] b;
assign b=a<<1;
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 36
Design and implementation of 32-bit ALU using Verilog 2016
endmodule
module logicunit32bit(a11,b11,s11,s00,res );
input[31:0] a11,b11;
input s11,s00;
output reg[31:0] res;
wire[31:0] w31,w41,w51,w61;
and1 a1 (a11,b11,w31);
or1 a2 (a11,b11,w41);
not11 a3(a11,w51);
exor1 a4(a11,b11,w61);
always @(a11,b11,s11,s00,w31,w41,w51,w61)
begin
case({s11,s00})
2'b00:res<= w31;
2'b01:res<=w41;
2'b10:res<=w51;
2'b11:res<=w61;
default:res<=1‘b0;
endcase
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 37
Design and implementation of 32-bit ALU using Verilog 2016
end
endmodule
module and1(c,d,j);
input[31:0] c,d;
output[31:0] j;
assign j=c&d;
endmodule
module or1(c1,d1,j1);
input [31:0]c1,d1;
output [31:0] j1;
assign j1=c1|d1;
endmodule
module not11(c2,d2);
input [31:0]c2;
output [31:0]d2;
assign d2= ~c2;
endmodule
module exor1(c3,d3,j3);
input [31:0]c3,d3;
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 38
Design and implementation of 32-bit ALU using Verilog 2016
output[31:0] j3;
assign j3=c3^d3;
endmodule
module add(a,b,cin,y,s4,s5,s6,s7);
input [31:0]a,b;
input cin;
input s4,s5,s6,s7;
output[31:0] y;
assign y=a+b;
endmodule
module addcarry(a,b,cin,y,s4,s5,s6,s7 );
input [31:0]a,b;
input cin;
input s4,s5,s6,s7;
output [31:0]y;
assign y=a+b+cin;
endmodule
module sub(a,b,cin,y,s4,s5,s6,s7 );
input [31:0]a,b;
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 39
Design and implementation of 32-bit ALU using Verilog 2016
input s4,s5,s6,s7;
output [31:0]y;
//output br;
input cin;
assign y=a+(~b)+cin;
//assign br=(~a)&b;
endmodule
module subcarry(a,b,cin,y,s4,s5,s6,s7 );
input [31:0]a,b;
input cin;
input s4,s5,s6,s7;
output [31:0]y;
assign y=a+~b+cin;
endmodule
module incremen22(a,cin,y,s4,s5,s6,s7);
input[31:0] a;
input cin;
input s4,s5,s6,s7;
output[31:0] y;
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 40
Design and implementation of 32-bit ALU using Verilog 2016
assign y=a+1+cin;
endmodule
module decremen22(a,cin,y,s4,s5,s6,s7);
input [31:0]a;
input cin;
input s4,s5,s6,s7;
output [31:0]y;
assign y=a-1+cin;
endmodule
module trd(y,a ,cin,s4,s5,s6,s7);
input [31:0]a;
input s4,s5,s6,s7;
output [31:0]y;
input cin;
assign y=a+cin;
endmodule
4.17 Test Bench for 32-bit ALU
module test1;
// Inputs
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 41
Design and implementation of 32-bit ALU using Verilog 2016
reg [31:0] a;
reg [31:0] b;
reg s2;
reg s3;
reg s1;
reg s0;
reg s4;
reg s5;
reg s6;
reg s7;
reg cin;
// Outputs
wire [31:0] result;
// Instantiate the Unit Under Test (UUT)
alu2 uut (
.a(a),
.b(b),
.s2(s2),
.s3(s3),
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 42
Design and implementation of 32-bit ALU using Verilog 2016
.s1(s1),
.s0(s0),
.s4(s4),
.s5(s5),
.s6(s6),
.s7(s7),
.cin(cin),
.result(result)
);
initial begin
// Initialize Inputs
a = 0;
b = 0;
s2 = 0;
s3 = 0;
s1 = 0;
s0 = 0;
s4 = 0;
s5 = 0;
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 43
Design and implementation of 32-bit ALU using Verilog 2016
s6 = 0;
s7 = 0;
cin = 0;
// Wait 100 ns for global reset to finish
#100;
// Add stimulus here
#10 s2=0;s3=0;s1=1'bx;s4=0;s5=0;s6=0;s7=0;cin=1'bx;a=7;b=5;
#10 s4=0;s5=0;s6=0;s7=1;s1=1;s2=1'bx;s3=1'bx;cin=1'bx;a=9;b=1'bx;
#10 s1=1'bx;s4=0;s5=0;s6=0;s7=0;cin=1'bx;a=15;b=1'bx;s2=1;s3=0;
#10 s4=0;s5=1;s6=1;s7=0;a=13;cin=1;b=1'bx;s1=1;s0=1;s3=0;
#10 s4=0;s5=1;s6=1;s7=1;a=14;b=1'bx;cin=0;s1=1;s0=0;s2=0;s3=0;
#10 s4=1;s5=0;s6=0;s7=0;a=10;b=1'bx;cin=0;s1=1;s0=0;s2=0;s3=0;
#10 s4=0;s5=0;s6=0;s7=0;s2=1;s3=1;s1=1;s0=0;a=12;b=6;cin=1'bx;
#10 s4=0;s5=0;s6=0;s7=0;s3=0;s2=1;s1=1;s0=1;cin=1'bx;a=99;b=1'bx;
#10 s2=0;s3=1;s1=1'bx;s4=0;s5=0;s6=0;s7=0;cin=1'bx;a=7;b=5;
#10 s4=0;s5=0;s6=1;s7=1;cin=0;s0=0;s1=0;s2=0;s3=0;a=9;b=6;
#10 s4=0;s5=0;s6=1;s7=0;cin=1;s0=0;s1=0;s2=0;s3=0;a=3;b=5;
#10 s4=0;s5=1;s6=0;s7=0;cin=1;s0=1;s1=0;s2=0;s3=0;a=9;b=5;
#10 s4=0;s5=1;s6=0;s7=1;cin=0;s0=1;s1=0;s2=0;s3=0;a=9;b=5;
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 44
Design and implementation of 32-bit ALU using Verilog 2016
#10 s4=0;s5=0;s6=0;s7=1;s3=1;s2=0;s1=0;s0=1'bx;cin=1'bx;a=8;b=1'bx;
end
endmodule
Fig.4.1 RTL of 32-bit ALU
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 45
Design and implementation of 32-bit ALU using Verilog 2016
Waveform
Fig 4.2. 4:1 MUX 32-bit Waveform
Fig 4.3. 32-bit Arithmetic unit
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 46
Design and implementation of 32-bit ALU using Verilog 2016
Fig 4.4. 32-bit Logic unit
Fig 4.5. 32-bit Shift Unit
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 47
Design and implementation of 32-bit ALU using Verilog 2016
Fig 4.6. 32-bit Arithmetic Logic Unit
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 48
Design and implementation of 32-bit ALU using Verilog 2016
Chapter 5
ADVANTAGE AND CONCLUSION
5.1 Importance of HDL
HDLs have many advantages compare to traditional schematic-based design.[1]
 Designs can be described at a very abstract level by use of HDLs. Designers can
write their RTL description without choosing a specific fabrication technology.
 By describing designs in HDLs, functional verification of the design can be done
early in the design cycle. Since designers work at RTL level, they can optimize
and modify the RTL description until it meet the desired functionality. Most
design bugs are eliminated at this point.
 Designing with HDLs is analogous to computer programming. A textual
description with comments is an easier way to develop and debug circuits. This
also provides a concise representation of the design, compare to gate level
schematics. Gate level schematics are almost incomprehensible for very complex
designs.
5.2 Advantages of Verilog HDL
 Verilog HDL is a general-purpose hardware description language that is easy to
learn and easy to use. It is similar in syntax to the C programing language.
Designers with C programing experience will find it easy to learn Verilog HDL.
 Verilog HDL allow different level of abstraction to mixed in the same model.
Thus , a designer can define a hardware model in terms of switches, gates, RTL,
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 49
Design and implementation of 32-bit ALU using Verilog 2016
or behavioural codes. Also, a designer needs to learn only one language for
stimulus and hierarchical design.
 Most popular logic synthesis tools support Verilog HDL. This makes it the
language of choice for designers .
 All fabrication vendors provide Verilog HDL libraries for post logic synthesis
simulation. Thus, designing a chip in Verilog HDL allows the widest choice of
vendors.
 The programming language interface (PLI) is a powerful feature that allow s the
user to write custom C code to interact with the internal data structures of Verilog.
Designers can customized a Verilog HDL simulator to their needs with the PLI.
5.3 Conclusion
In our project ―Design and Implementation of a 32-bit ALU using Verilog‖ we have
designed and implemented a 32 bit ALU. Arithmetic Logic Unit is the part of a computer
that performs all arithmetic computations such as addition, subtraction, addition with
carry, subtraction with borrow, increment and decrement ,shifting such as right shift and
left shift and all basic logical operations like AND, OR,NOT and XOR. ALU represents
the fundamental building block of the central processing unit (CPU) of a computer
We have compare the number of MUX with [7],[8] which result in less number of MUX
that we used.
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 50
Design and implementation of 32-bit ALU using Verilog 2016
5.4 Future scope of Verilog
Verilog can be used at different levels of abstraction as we have already seen [9]. But
how useful are these different levels of abstraction when it comes to using Verilog?
5.4.1 Design process
The diagram below shows a very simplified view of the electronic system design process
incorporating Verilog. The central portion of the diagram shows the parts of the design
process which will be impacted by Verilog.
System analysis and partitioning
Physical spec H/W spec S/W spec
Analog spec Digital function spec
Verilog
Algorithm
RTL
Gates
Timing analysis
fault simulation
Mixed signal simulation
Layout
Fig.5.4.1 Design Process
Sign off
simulation
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 51
Design and implementation of 32-bit ALU using Verilog 2016
5.4.2 System Level
Verilog is not ideally suited for abstract system-level simulation, prior to the hardware-
software split. This is to some extent add ressed by SystemVerilog. Unlike VHDL, which
has support for user-defined types and overloaded operators which allow the designer to
abstract his work into the domain of the problem, Verilog restricts the designer to
working with pre-defined system functions and tasks for stochastic simulation and can be
used for modelling performance, throughput and queueing but only in so far as those
built-in language features allow. Designers occasionally use the stochastic level of
abstraction for this phase of the design process.
5.4.3 Digital
Verilog is suitable for use today in the digital hardware design process, from functional
simulation, manual design and logic synthesis down to gate-level simulation. Verilog
tools provide an integrated design environment in this area.
Verilog is also suited for specialized implementation-level design verification tools such
as fault simulation, switch level simulation and worst case timing simulation. Verilog can
be used to simulate gate level fanout loading effects and routing delays through the
import of SDF files.
The RTL level of abstraction is used for functional simulation prior to synthesis. The gate
level of abstraction exists post-synthesis but this level of abstraction is not often created
by the designer, it is a level of abstraction adopted by the EDA tools (synthesis and
timing analysis, for example).
5.4.4 Analog
Because of Verilog's flexibility as a programming language, it has been stretched to
handle analog simulation in limited cases. There is a draft standard – Verilog-AMS – that
addresses analog and mixed signal simulation.
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 52
Design and implementation of 32-bit ALU using Verilog 2016
5.4.5 Debugging
Accuracy and time is essential—especially when it comes to your development
simulation and debugging. Our Verilog simulator and compiler will change the way you
can simulate, debug, and manage your development process.
VeriLogger Extreme is a high-performance compiled-code Verilog 2001 simulator with
automatic test bench generation that significantly reduces simulation debug time.
VeriLogger Extreme offers fast simulation of both RTL and gate-level simulations with
SDF timing information. VeriLogger Extreme supports design libraries and design flows
for all major ASIC and FPGA vendors, including Actel/MicroSemi, Altera, Atmel, LSI
Logic, Quick Logic, and Xilinx.
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 53
Design and implementation of 32-bit ALU using Verilog 2016
References
[1]. Samir Palnitkar, Verilog HDL, A Guide to digital design and Synthesis.
Published by Prentice Hall PTR, 1996 ISBN 10: 0134516753 / ISBN 13:
9780134516752.
[2]. Donald E. Thomas and Philip R. Moorby, The Verilog Hardware Description
language . Published by Springer; 5th ed. 2002 edition (27 October 2008).
ISBN-10: 0387849300,ISBN-13: 978-0387849300
[3]. J Bhasker, A Verilog HDL Primer . Published by Bs Publications/bsp
Books(2008).
ISBN-10: 817800142X, ISBN-13: 978-8178001425
[4]. Lionel Benning and Harry Foster, Verifiable RTL Design: A Functional Coding Style
Supporting Verification Processes in Verilog. Published by Springer; 2nd ed. 2001
edition (31 May 2001). ISBN-10: 0792373685, ISBN-13: 978-0792373681.
[5]. IEEE Std 1364-2001 : IEEE Standard Hardware Description Language based on the
Verilog Hardware Description Language Published by the IEEE, Inc.,
http://www.ieee.org 345 East 47th Street, New York, NY 10017, USA.
[6]. Douglas J Smith, FPGAs using VHDL or Verilog . Published by Doone Publications.
[7]. Anushka Pakrashi, Arindam Bose, Kausik Bhattacharya, Monigingir Pal, Tanaya
Bose. Design and Implementation of 32-Bit ALU on XILINX FPGA using
VHDL.Institute: FUTURE INSTITUTE OF ENGINEERING AND
MANAGEMENT (2008-2012).
Department of Electronics and Communication Engineering
©Athihrii, Stephen, Sanjay 2016 Page 54
Design and implementation of 32-bit ALU using Verilog 2016
[8]. Anadi Anant Jain, Ankush Bhushan, Bhavyai Gupta, Faizan Ayubi. Implementation
of 32-Bit arithmetic Logic Unit on Xilinx using VHDL. Institute : DELHI
TECHNOLOGICAL UNIVERSITY.
[9]. https://www.doulos.com/knowhow/verilog_designers_guide/scope_of_verilog/

More Related Content

What's hot

What's hot (20)

Verilog lab manual (ECAD and VLSI Lab)
Verilog lab manual (ECAD and VLSI Lab)Verilog lab manual (ECAD and VLSI Lab)
Verilog lab manual (ECAD and VLSI Lab)
 
PLDs
PLDsPLDs
PLDs
 
Verilog tutorial
Verilog tutorialVerilog tutorial
Verilog tutorial
 
Verilog VHDL code Decoder and Encoder
Verilog VHDL code Decoder and EncoderVerilog VHDL code Decoder and Encoder
Verilog VHDL code Decoder and Encoder
 
Fpga(field programmable gate array)
Fpga(field programmable gate array) Fpga(field programmable gate array)
Fpga(field programmable gate array)
 
CMOS LOGIC STRUCTURES
CMOS LOGIC STRUCTURESCMOS LOGIC STRUCTURES
CMOS LOGIC STRUCTURES
 
Vlsi lab viva question with answers
Vlsi lab viva question with answersVlsi lab viva question with answers
Vlsi lab viva question with answers
 
Overview of digital design with Verilog HDL
Overview of digital design with Verilog HDLOverview of digital design with Verilog HDL
Overview of digital design with Verilog HDL
 
FPGA
FPGAFPGA
FPGA
 
Asynchronous Sequential Circuit-Unit 4 ppt
Asynchronous Sequential Circuit-Unit 4 pptAsynchronous Sequential Circuit-Unit 4 ppt
Asynchronous Sequential Circuit-Unit 4 ppt
 
Pass Transistor Logic
Pass Transistor LogicPass Transistor Logic
Pass Transistor Logic
 
Rc delay modelling in vlsi
Rc delay modelling in vlsiRc delay modelling in vlsi
Rc delay modelling in vlsi
 
Synchronous and asynchronous clock
Synchronous and asynchronous clockSynchronous and asynchronous clock
Synchronous and asynchronous clock
 
Ripple Carry Adder
Ripple Carry AdderRipple Carry Adder
Ripple Carry Adder
 
Actel fpga
Actel fpgaActel fpga
Actel fpga
 
flag register of 8086
flag register of 8086flag register of 8086
flag register of 8086
 
vlsi design flow
vlsi design flowvlsi design flow
vlsi design flow
 
Dynamic logic circuits
Dynamic logic circuitsDynamic logic circuits
Dynamic logic circuits
 
Xilinx 4000 series
Xilinx 4000 seriesXilinx 4000 series
Xilinx 4000 series
 
Wallace tree multiplier.pptx1
Wallace tree multiplier.pptx1Wallace tree multiplier.pptx1
Wallace tree multiplier.pptx1
 

Viewers also liked

Alu design-project
Alu design-projectAlu design-project
Alu design-projectalphankg1
 
32 bit ALU Chip Design using IBM 130nm process technology
32 bit ALU Chip Design using IBM 130nm process technology32 bit ALU Chip Design using IBM 130nm process technology
32 bit ALU Chip Design using IBM 130nm process technologyBharat Biyani
 
implementation and design of 32-bit adder
implementation and design of 32-bit adderimplementation and design of 32-bit adder
implementation and design of 32-bit adderveereshwararao
 
VLSI Design Final Project - 32 bit ALU
VLSI Design Final Project - 32 bit ALUVLSI Design Final Project - 32 bit ALU
VLSI Design Final Project - 32 bit ALUSachin Kumar Asokan
 
Floating point ALU using VHDL implemented on FPGA
Floating point ALU using VHDL implemented on FPGAFloating point ALU using VHDL implemented on FPGA
Floating point ALU using VHDL implemented on FPGAAzhar Syed
 
8 bit single cycle processor
8 bit single cycle processor8 bit single cycle processor
8 bit single cycle processorDhaval Kaneria
 
Quick tutorial on IEEE 754 FLOATING POINT representation
Quick tutorial on IEEE 754 FLOATING POINT representationQuick tutorial on IEEE 754 FLOATING POINT representation
Quick tutorial on IEEE 754 FLOATING POINT representationRitu Ranjan Shrivastwa
 
vlsi projects using verilog code 2014-2015
vlsi projects using verilog code 2014-2015vlsi projects using verilog code 2014-2015
vlsi projects using verilog code 2014-2015E2MATRIX
 
Controller Implementation in Verilog
Controller Implementation in VerilogController Implementation in Verilog
Controller Implementation in VerilogAnees Akhtar
 
Verilog 語法教學
Verilog 語法教學 Verilog 語法教學
Verilog 語法教學 艾鍗科技
 
DESIGN AND SIMULATION OF DIFFERENT 8-BIT MULTIPLIERS USING VERILOG CODE BY SA...
DESIGN AND SIMULATION OF DIFFERENT 8-BIT MULTIPLIERS USING VERILOG CODE BY SA...DESIGN AND SIMULATION OF DIFFERENT 8-BIT MULTIPLIERS USING VERILOG CODE BY SA...
DESIGN AND SIMULATION OF DIFFERENT 8-BIT MULTIPLIERS USING VERILOG CODE BY SA...Saikiran Panjala
 
Design of Elevator Controller using Verilog HDL
Design of Elevator Controller using Verilog HDLDesign of Elevator Controller using Verilog HDL
Design of Elevator Controller using Verilog HDLVishesh Thakur
 
Bit Serial multiplier using Verilog
Bit Serial multiplier using VerilogBit Serial multiplier using Verilog
Bit Serial multiplier using VerilogBhargavKatkam
 
All VLSI programs
All VLSI programsAll VLSI programs
All VLSI programsGouthaman V
 

Viewers also liked (20)

VERILOG CODE
VERILOG CODEVERILOG CODE
VERILOG CODE
 
Alu design-project
Alu design-projectAlu design-project
Alu design-project
 
32 bit ALU Chip Design using IBM 130nm process technology
32 bit ALU Chip Design using IBM 130nm process technology32 bit ALU Chip Design using IBM 130nm process technology
32 bit ALU Chip Design using IBM 130nm process technology
 
8 bit alu design
8 bit alu design8 bit alu design
8 bit alu design
 
implementation and design of 32-bit adder
implementation and design of 32-bit adderimplementation and design of 32-bit adder
implementation and design of 32-bit adder
 
VLSI Design Final Project - 32 bit ALU
VLSI Design Final Project - 32 bit ALUVLSI Design Final Project - 32 bit ALU
VLSI Design Final Project - 32 bit ALU
 
Floating point ALU using VHDL implemented on FPGA
Floating point ALU using VHDL implemented on FPGAFloating point ALU using VHDL implemented on FPGA
Floating point ALU using VHDL implemented on FPGA
 
ALU
ALUALU
ALU
 
8 bit alu design
8 bit alu design8 bit alu design
8 bit alu design
 
8 Bit A L U
8 Bit  A L U8 Bit  A L U
8 Bit A L U
 
8 bit single cycle processor
8 bit single cycle processor8 bit single cycle processor
8 bit single cycle processor
 
Quick tutorial on IEEE 754 FLOATING POINT representation
Quick tutorial on IEEE 754 FLOATING POINT representationQuick tutorial on IEEE 754 FLOATING POINT representation
Quick tutorial on IEEE 754 FLOATING POINT representation
 
vlsi projects using verilog code 2014-2015
vlsi projects using verilog code 2014-2015vlsi projects using verilog code 2014-2015
vlsi projects using verilog code 2014-2015
 
Verilog HDL
Verilog HDLVerilog HDL
Verilog HDL
 
Controller Implementation in Verilog
Controller Implementation in VerilogController Implementation in Verilog
Controller Implementation in Verilog
 
Verilog 語法教學
Verilog 語法教學 Verilog 語法教學
Verilog 語法教學
 
DESIGN AND SIMULATION OF DIFFERENT 8-BIT MULTIPLIERS USING VERILOG CODE BY SA...
DESIGN AND SIMULATION OF DIFFERENT 8-BIT MULTIPLIERS USING VERILOG CODE BY SA...DESIGN AND SIMULATION OF DIFFERENT 8-BIT MULTIPLIERS USING VERILOG CODE BY SA...
DESIGN AND SIMULATION OF DIFFERENT 8-BIT MULTIPLIERS USING VERILOG CODE BY SA...
 
Design of Elevator Controller using Verilog HDL
Design of Elevator Controller using Verilog HDLDesign of Elevator Controller using Verilog HDL
Design of Elevator Controller using Verilog HDL
 
Bit Serial multiplier using Verilog
Bit Serial multiplier using VerilogBit Serial multiplier using Verilog
Bit Serial multiplier using Verilog
 
All VLSI programs
All VLSI programsAll VLSI programs
All VLSI programs
 

Similar to Design and Implementation of a 32-bit ALU in Verilog

Auto Metro Train to Shuttle Between Stations
Auto Metro Train to Shuttle Between StationsAuto Metro Train to Shuttle Between Stations
Auto Metro Train to Shuttle Between StationsMadhav Reddy Chintapalli
 
Major project report
Major project reportMajor project report
Major project reportPraveen Singh
 
The Principle Of Ultrasound Imaging System
The Principle Of Ultrasound Imaging SystemThe Principle Of Ultrasound Imaging System
The Principle Of Ultrasound Imaging SystemMelissa Luster
 
Noor’s Algorithmic Flow of Electronics and Communication Engineering
Noor’s Algorithmic Flow of Electronics and Communication EngineeringNoor’s Algorithmic Flow of Electronics and Communication Engineering
Noor’s Algorithmic Flow of Electronics and Communication EngineeringIRJET Journal
 
Engineering Portfolio of Isaac Bettendorf
Engineering Portfolio of Isaac BettendorfEngineering Portfolio of Isaac Bettendorf
Engineering Portfolio of Isaac BettendorfIsaac Bettendorf
 
design of FPGA based traffic light controller system
design of FPGA based traffic light controller systemdesign of FPGA based traffic light controller system
design of FPGA based traffic light controller systemVinny Chweety
 
Resume for Embedded Engineer_1
Resume for Embedded Engineer_1Resume for Embedded Engineer_1
Resume for Embedded Engineer_1gajendra parmar
 
Arduino Based Collision Prevention Warning System
Arduino Based Collision Prevention Warning SystemArduino Based Collision Prevention Warning System
Arduino Based Collision Prevention Warning SystemMadhav Reddy Chintapalli
 
Embedded system for traffic light control
Embedded system for traffic light controlEmbedded system for traffic light control
Embedded system for traffic light controlMadhu Prasad
 
On-chip debugging for microprocessor design
On-chip debugging for microprocessor designOn-chip debugging for microprocessor design
On-chip debugging for microprocessor designTELKOMNIKA JOURNAL
 
Digital VLSI Design and FPGA Implementation
Digital VLSI Design and FPGA ImplementationDigital VLSI Design and FPGA Implementation
Digital VLSI Design and FPGA ImplementationAmber Bhaumik
 
1451synopsis 599 f-good nist
1451synopsis 599 f-good nist1451synopsis 599 f-good nist
1451synopsis 599 f-good nistriyapd10
 
Software Based calculations of Electrical Machine Design
Software Based calculations of Electrical Machine DesignSoftware Based calculations of Electrical Machine Design
Software Based calculations of Electrical Machine Designvivatechijri
 
Netlist Optimization for CMOS Place and Route in MICROWIND
Netlist Optimization for CMOS Place and Route in MICROWINDNetlist Optimization for CMOS Place and Route in MICROWIND
Netlist Optimization for CMOS Place and Route in MICROWINDIRJET Journal
 

Similar to Design and Implementation of a 32-bit ALU in Verilog (20)

Gourp 12 Report.pptx
Gourp 12 Report.pptxGourp 12 Report.pptx
Gourp 12 Report.pptx
 
Auto Metro Train to Shuttle Between Stations
Auto Metro Train to Shuttle Between StationsAuto Metro Train to Shuttle Between Stations
Auto Metro Train to Shuttle Between Stations
 
Major project report
Major project reportMajor project report
Major project report
 
The Principle Of Ultrasound Imaging System
The Principle Of Ultrasound Imaging SystemThe Principle Of Ultrasound Imaging System
The Principle Of Ultrasound Imaging System
 
report.pdf
report.pdfreport.pdf
report.pdf
 
Noor’s Algorithmic Flow of Electronics and Communication Engineering
Noor’s Algorithmic Flow of Electronics and Communication EngineeringNoor’s Algorithmic Flow of Electronics and Communication Engineering
Noor’s Algorithmic Flow of Electronics and Communication Engineering
 
cd-2-Batch id-33
cd-2-Batch id-33cd-2-Batch id-33
cd-2-Batch id-33
 
Engineering Portfolio of Isaac Bettendorf
Engineering Portfolio of Isaac BettendorfEngineering Portfolio of Isaac Bettendorf
Engineering Portfolio of Isaac Bettendorf
 
design of FPGA based traffic light controller system
design of FPGA based traffic light controller systemdesign of FPGA based traffic light controller system
design of FPGA based traffic light controller system
 
Resume for Embedded Engineer_1
Resume for Embedded Engineer_1Resume for Embedded Engineer_1
Resume for Embedded Engineer_1
 
Arduino Based Collision Prevention Warning System
Arduino Based Collision Prevention Warning SystemArduino Based Collision Prevention Warning System
Arduino Based Collision Prevention Warning System
 
Embedded system
Embedded systemEmbedded system
Embedded system
 
Embedded system for traffic light control
Embedded system for traffic light controlEmbedded system for traffic light control
Embedded system for traffic light control
 
On-chip debugging for microprocessor design
On-chip debugging for microprocessor designOn-chip debugging for microprocessor design
On-chip debugging for microprocessor design
 
Poster_example
Poster_examplePoster_example
Poster_example
 
Digital VLSI Design and FPGA Implementation
Digital VLSI Design and FPGA ImplementationDigital VLSI Design and FPGA Implementation
Digital VLSI Design and FPGA Implementation
 
bds project final documentation
bds project final documentation bds project final documentation
bds project final documentation
 
1451synopsis 599 f-good nist
1451synopsis 599 f-good nist1451synopsis 599 f-good nist
1451synopsis 599 f-good nist
 
Software Based calculations of Electrical Machine Design
Software Based calculations of Electrical Machine DesignSoftware Based calculations of Electrical Machine Design
Software Based calculations of Electrical Machine Design
 
Netlist Optimization for CMOS Place and Route in MICROWIND
Netlist Optimization for CMOS Place and Route in MICROWINDNetlist Optimization for CMOS Place and Route in MICROWIND
Netlist Optimization for CMOS Place and Route in MICROWIND
 

Recently uploaded

(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 

Recently uploaded (20)

(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 

Design and Implementation of a 32-bit ALU in Verilog

  • 1. DESIGN AND IMPLEMENTATION OF 32-BIT ALU USING VERILOG A.Athihrii -12UEC001 M Stephen -12UEC016 Sanjay Kumar -12UEC020 (i)
  • 2. DESIGN AND IMPLEMENTATION OF 32-BIT ALU USING VERILOG Report submitted to National Institute of Technology Manipur for the award of the degree of Bachelor of Technology in Electronics and communication Engineering by A.Athihrii (12UEC001) M. Stephen (12UEC016) Sanjay kumar(12UEC020) Under the guidance of Shri MANOJ KUMAR Assistant Professor, NIT Manipur DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING NATIONAL INSTITUTE OF TECHNOLOGY MANIPUR MAY 2016 © 2016, Athihrii, Stephen, Sanjay. All rights reserved (ii)
  • 3. DECLARATION We certify that a. the work contained in this report is original and has been done by me under the guidance of my supervisor(s). b. the work has not been submitted to any other Institute for any degree or diploma. c. I have followed the guidelines provided by the Institute in preparing the report. d. I have conformed to the norms and guidelines given in the Ethical Code of Conduct of the Institute. e. whenever I have used materials (data, theoretical analysis, figures, and text) from other sources, I have given due credit to them by citing them in the text of the report and giving their details in the references. Further, I have taken permission from the copyright owners of the sources, whenever necessary. Signature of the Student Signature of the Student ………………………………. ………………………………. ………………………………. (v)
  • 4. ACKNOWLEDGEMENT It gives us immense pleasure to express our heartfelt gratitude and sincere thanks to our project mentor Shri. Manoj Kumar (Assistant Professor, Electronics And Communication Engineering) for his timeless and valuable contribution, suggestion and encouragement for the completion of this project. His continuous guidance had led us to execute our project titled “DESIGN AND IMPLEMENTATION OF 32-BIT ALU USING VERILOG”. We are deeply indebted to you Sir. A. ATHIHRII(12UEC001) M. STEPHEN (12UEC016) SANJAY KUMAR(12UEC020) (vi)
  • 5. ABSTRACT In this fast growing booming technology, the need for high-tech and superfast technology is on high demand. Hence through the use of FPGA (Field Programmable Gate Array) we can design superfast technology especially in the field of embedded system. Verilog standardized as IEEE 1364 is a hardware description language(HDL), a textual format for describing electronics design and circuits. Applied to electronic design, verilog is intended to used for verification through simulation, for timing analysis, for test analysis (testability analysis and fault grading) and for logic synthesis. An Arithmetic Logic Unit (ALU) is a digital electronic circuits that performs arithmetic and bitwise logical operations on integer binary numbers. This is in contrast to FPU(Floating point unit )which operates on floating point numbers. ALU is a fundamental building block of many type of computing circuits including the central processing unit (CPU), FPU and GPU (Graphics Processing Unit).A single CP, FPU and GPU may contain multiple ALUs. (vii)
  • 6. CONTENTS TITLE Page NO. Title page i Certificate iii Certificate iv Declaration v Acknowledgement vi Abstract vii Contents viii List of Figures xi List of table xii CHAPTER-1 INTRODUCTION AND LITERATURE REVIEW 1 - 5 1.1 HDL (Hardware Description language) 1 1.2 Typical Design Flow 3 1.3 Literature review 4 CHAPTER-2 INTRODUCTION TO VERILOG AND XILINX 6 - 10 2.1 Verilog 6 2.2 Xilinx 8 2.2.1 Procedure to Operate Xilinx (ISE 14.7) 9 2.3 Tools and Enviroment Used 10 2.3.1 Minimum Hardware Requirement 10 2.3.2 Minimum Software Requirement 10 (viii)
  • 7. CHAPTER-3 DESIGN OF ALU 11-19 3.1 Arithmetic Unit 11 3.2 Logic Unit 14 3.3 Shift unit 15 3.3.1 Left Shift 15 3.3.2 Right Shift 16 3.4 Arithmetic Logic Unit 17 CHAPTER-4 VERILOG CODING AND WAVEFORM 20 – 47 4.1 Selection MUX 4 to 1 (1 bit I/O) 20 4.2 Selection MUX 4 to 1 (32-bit I/O) 21 4.3 Selection MUX 2 to 1 (32-bit I/O) 21 4.4 Full adder 22 4.5 4-bit Adder 22 4.6 32-bit Adder 23 4.7 32-bit AND 23 4.8 32-bit OR 23 4.9 32-bit XOR 24 4.10 32-bit NOT 24 4.11 Right shift 24 4.12 Left shift 25 4.13 Shift unit 25 (ix)
  • 8. 4.14 Arithmetic unit 26 4.15 Logic unit 30 4.16 32-bit ALU 32 4.17 Test Bench for 32-bit ALU 40 CHAPTER-5 ADVANTAGE AND CONCLUSION 48 - 52 5.1 Importance of HDL 48 5.2 Advantage of Verilog HDL 48 5.3 Conclusion 49 5.4 Future scope of Verilog 50 5.4.1 Design process 50 5.4.2 System Level 51 5.4.3 Digital 51 5.4.4 Analog 51 5.4.5 Debugging 52 REFERENCES 53 (x)
  • 9. LIST OF FIGURES 1.1 TYPICAL DESIGN FLOW 3 2.2 Xilinx ISE Interface 9 3.1 32-bit Arithmetic unit 13 3.2 32-bit Logic unit 14 3.3.1 (a) 32-bit before Left Shift 15 (b) 32-bit after Left Shift 16 3.3.2 (a) 32-bit before Right Shift 16 (b) 32-bit after Right 16 3.3.3 32-bit Shift unit 17 3.4 Arithmetic Logic Unit 19 4.1 RTL of 32-bit ALU 44 4.2 4 to 1 32-bit Waveform 45 4.3 32-bit Arithmetic Unit Waveform 45 4.4 32-bit Logic Unit waveform 46 4.5 32-bit Shift unit Waveform 46 4.6 32-bit Arithmetic Logic unit Waveform 47 5.4.1 Design process 50 (xi)
  • 10. LIST OF TABLE Table 1. Table of 32-bit Arithmetic unit 12 Table 2. Table of 32-bit Logic uni 15 Table 3. Table of 32-bit Shift unit 17 Table 4. Table of 32-bit Arithmetic Logic unit 19 (xii)
  • 11. This is to certify that the dissertation entitled “Design and Implementation of 32-bit ALU using Verilog” to the National Institute of Technology Manipur, India, is a record of bonafied project work carried out under my supervision and guidance and is worthy of consideration for the award of the degree of Bachelor of Technology in Electronics and Communication Engineering of the Institute. Signature of Guide (Shri.Manoj Kumar) (iii)
  • 12. Department of Electronics and Communication Engineering Takyelpat, Imphal- 795001, Ph.:0385-2445812, email: Ref no.: NITMN/ECE:4/B.TECH/ ...... Dated......... This is to certify that the Dissertation Report entitled, submitted by Mr.“A.Athihrii, M. Stephen, Sanjay Kumar” to National Institute of Technology Manpur, India, is a record of bonafide Project work carried out by them under the supervision and guidance of Shri. Manoj Kumar (Assistant Professor, NIT Manipur) and is worthy of consideration for the award of the degree of Bachelor of Technology in Electronics and Communication Engineering of the Institute. HOD, ECE Department NIT MANIPUR (iv)
  • 13. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 1 Design and implementation of 32-bit ALU using Verilog 2016 Chapter 1 INTRODUCTION AND LITERATURE REVIEW Digital circuit design has evolved rapidly, the earliest digital circuits were designed with vacuum tubes and transistors. With the advent of VLSI (Very Large Scale Integration) technology, designers could design single chip with more than 100,000 transistors. Because of the complexity of these circuits, it was not possible to verify these circuits on a breadboard. Computer aided techniques became critical for verification and design of VLSI digital circuits. Computer programs to do automatic placement and routing of circuit layout also became popular. The designers were now building gate level digital circuits manually on graphic terminals. They would build small building blocks and then derive higher level blocks from them. This process would continue until they had built the top-level block. Logic simulator came into existence to verify the functionality of these circuits before they were fabricated on chip. 1.1 HDL (Hardware Description Language) Hardware Description Language [1] came into existence to replace programming language such as FORTAN, Pascal and C as a standard language to describe digital circuit. HDL is a specialized computer language used to describe the structure and behaviour of electronic circuit, and most commonly digital logic circuit. There are two types of HDL: 1. Verilog HDL 2. VHDL (VHSIC Hardware Description Language)
  • 14. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 2 Design and implementation of 32-bit ALU using Verilog 2016 The advent of logic synthesis in the late 1980s changed the design methodology radically. Digital circuit could be described at RTL (Register Transfer Level) by use of an HDL. Thus, the designer had to specify how the data flow between register and how the design processes the data. The detail of gates and their interconnections to implement the circuits were automatically extracted by logic synthesis tools from RTL descriptions HDL also began to use for system-level design. HDLs were used for simulation of system boards; interconnect buses, FPGA (Field Programmable Gate Array) and PALs (Programmable Array Logic). A common approach is to design each IC chip, using an HDL, and then verify system functionality via simulation. Verilog HDL originates in 1983 at Gateway Design Automation. Later, VHDL was developed under contract from DARPA. Both Verilog and VHDL simulators to simulate large digital circuit quickly gain acceptance from designers. Verilog is a Hardware Description Language, a textual format for describing electronic circuits and systems. Applied to electronic design, Verilog is intended to be used for verification through simulation, for timing analysis, for test analysis (testability analysis and fault grading) and for logic synthesis.
  • 15. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 3 Design and implementation of 32-bit ALU using Verilog 2016 1.2 TYPICAL DESIGN FLOW A typical design flow for designing VLSI IC circuits is shown in figure 1.1.Unshaded blocks show the level of design representation [1] ;shaded blocks show processes in the design flow; Fig. 1.1 Typical Design Flow Behavioural Description RTL Description (HDL) Functional Verification and Testing Logic synthesis Gate-Level Netlist Logical Verification and Testing Floor planning, Automatic Place and Route Physical Layout Layout Verification Implementation Design specification
  • 16. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 4 Design and implementation of 32-bit ALU using Verilog 2016 1.3 LITERATURE REVIEW The general idea of this particular project is to compile 32–bits logic gates, shift gates and arithmetic operation into one single MUX to carry out the desire operation successfully. 1. In ‗Verilog HDL, A guide to digital Design and Synthesis’ [1], the book imparts the working knowledge of a broad variety of Verilog-based topics, thus giving the reader a global understanding of Verilog HDL-based design. The book leaves the in-depth coverage of each topic to the Verilog HDL language reference manual and the reference manuals of the individual Verilog-based products. 2. In ‗The Verilog Hardware Description language‘ [2], it focus on tutorial approach to presenting the language. It continues with a more complete discussion of the language constructs. Numerous example are also provided to allow the reader to make it more easy to learn through examples. The rest of the book could be used in upper level logic design and architecture courses 3. In ‗A Verilog HDL Primer‘ [3][4], It is a practical and useful guide to Verilog HDL register-transfer level synthesis. A large number of synthesizable Verilog HDL examples are provided. Verilog HDL constructs that are supported for synthesis are described in detail. Common causes of functional mismatches between the design model and the synthesized netlist are described in detail and recommendations are make on how to avoid this. 4. In ‗Verifiable RTL Design: A Functional Coding Style Supporting Verification Processes in Verilog‘ [5] and ‗IEEE Std 1364-2001 : IEEE Standard Hardware Description Language based on the Verilog Hardware Description Language Published by the IEEE, Inc., http://www.ieee.org 345 East 47th Street, New York, NY 10017, USA‘ [6], mostly introduce a verifiable subset of Verilog and a simple RTL coding style. It enabled us to effectively incorporate these new verification technologies into our design flow. To provide a framework for discussion, it place emphasis on describing verification processes throughout the
  • 17. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 5 Design and implementation of 32-bit ALU using Verilog 2016 text-as opposed to an in-depth discussion of the Verilog language. This book tells how you can write Verilog to describe chip designs at the RT-level in a manner that cooperates with verification processes. This cooperation can return an order of magnitude improvement in performance and capacity from tools such as simulation and equivalence checkers. 5. In the project ‗Design and Implementation of 32-Bit ALU on XILINX FPGA using VHDL‘ [7] they are designing an 32-bit ALU using VHDL and implementing on Xilinx FPGA. 6. In the project ‗Implementation of 32-bit Arithmetic Logic Unit on Xilinx using VHDL‘ [8] the are implemeting the 32-bit ALU code on Xilinx.
  • 18. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 6 Design and implementation of 32-bit ALU using Verilog 2016 Chapter 2 INTRODUCTION TO VERILOG AND XILINX 2.1 Verilog 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. Verilog HDL has become an industry standard as a result of extensive used in the design of IC chips and digital systems. Verilog came into being as a proprietary language supported by a simulation environment that was the first to support by a simulation environment that was the first to support mixed-level design representations comprising switches, gates, RTL and higher levels of abstractions of digital circuits. The simulation environment provided a powerful and uniform method to express digital designs as well as tests that were meant to verify such designs. There were three key factors that drove the acceptance and dominance of Verilog in the marketplace. First, introduction of Programming Language Interface (PLI) permitted users of Verilog to literally extend and customized the simulation environment. Since then users have exploited the introduction of Verilog-based synthesis technology by Synopsys. The combination of the simulation and synthesis technologies serve to make Verilog the language of choice for PLI and their success at adapting Verilog to their environments has been a real winner for Verilog. The Second key factor which drove Verilog‘s dominance came from Gateways paying close attention to the needs of the ASIC foundries and enhancing Verilog in close partnership with Motorola, National and UTMC.The realisation that the vast majority of logic simulation was being done by
  • 19. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 7 Design and implementation of 32-bit ALU using Verilog 2016 designers of ASIC chips drove this effort. The third key factor behind the success was the the hardware designers. Verilog also provide the concept of a module. A module is the basic building block in verilog. A module can be an element or a collection of lower-level design block. A module provides the necessary functionality to the higher level block through its port interface (inputs and outputs), but hides the internal implementation. This allows the designer to modify module internals without affecting the rest of the design. Verilog is both a behavioural and structural language[1]. Internals of each module can be defined at four level of abstraction. The levels are defined below. i. Behavioural or algorithmic level This is the highest level of abstraction provided by verilog HDL. A module can be implemented in terms of the desired design algorithm without concern for the hardware implementation details. ii. Data flow At this level the module is designed by specifying the data flow. The designer is aware of how data flows between hardware registers and how the data is processed in the design. iii. Gate level The module is implemented in terms of logic gates and interconnection between these gates. Design at this level is similar to describing a design in terms of a gate level logic diagram.
  • 20. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 8 Design and implementation of 32-bit ALU using Verilog 2016 iv. Switch level This is the lowest level of abstraction provided by verilog. A module can be implemneted in terms of switches, storage nodes and the interconnection between them. Verilog allows a designer to mix and match all four levels of abstraction in a design. In the digital design community, the term Register Transfer Level (RTL) is frequently used for a verilog description that uses a combination of behavioural and data flow constructs and is acceptable to logic synthesis tools. 2.2 Xilinx Xilinx is an American technology company, primarily a supplier of programmable logic devices and the first semi-conductor company with a fabulous manufacturing model. Founded in Silicon valley in 1984 and head quartered in San Jose, California, USA, the company has cooperate offices throughout North America and Europe Xilinx ISE (Integrated Software environment) is a software tool produced by xilinx for synthesis and analysis of HDL designs, enabling the developer to synthesize their designs, perform timing analysis, examine RTL diagrams, simulate a design‘s reaction to different stimuli and configure the target device with a programmer.
  • 21. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 9 Design and implementation of 32-bit ALU using Verilog 2016 2.2.1 Procedure to operate Xilinx. (ISE 14.7) 1. Open the Xilinx project Navigator 2. Following are the main areas of the Project Navigator, which are shown in the following figure:  Toolbar - provides convenient access to frequently used menu commands.  Design panel - provides access to the following areas: o Design View - allows you to select a design phase from the ―Sources for‖ area, which controls the sources files displayed in the Hierarchy pane. o Hierarchy pane - allows you to view and manage design source files. o Processes pane - allows you to run processes, which move the design from design creation through programming the device. In addition, you can run processes that allow you to analyze and improve your design.  Workspace - allows you to view and edit your design using various tools, and provides access to reports in the Design Summary.  Transcript window - allows you to view output log, messages, errors, and warning information as it is generated. Fig2.2 Xilinx ISE Interface
  • 22. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 10 Design and implementation of 32-bit ALU using Verilog 2016 2.3 Tools and Environment Used 2.3.1 Minimum Hardware Requirement: 1. Computer : IBM or Compatible 2. Hard disk : 20 GB or higher 3. Processor : PENTIUM– IV 2 GHz or above 4. Ram : 512 Mb and above 5. VDU : VGA 2.3.2 Minimum Software Requirement: 1. Operating System : Windows XP 2. Development Software : Xilinx ISE 8.2i
  • 23. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 11 Design and implementation of 32-bit ALU using Verilog 2016 Chapter 3 DESIGN OF ALU Designing of the ALU will follow the principle "Divide and Conquer" in order to use a modular design that consists of smaller, more manageable blocks, some of which can be re-used. An ALU consists of 3 units: 1. Arithmetic unit: Consists of addition, subtraction, addition with carry subtraction with borrow, increment, decrement and transfer. 2. Logic Unit: Consists of AND gate, OR gate, NOT gate and XOR gate. 3. Shift Unit: Consists of left shift, right shift. 3.1 Arithmetic unit An Arithmetic unit does the following task: Addition, Addition with carry, Subtraction, Subtraction with borrow, Decrement, Increment and Transfer function. As the input is given in 32-bit, we get 32-bit output. The arithmetic will show only one output at a time , so a selector is necessary to select one of the operator. In this case, we use 8:1 multiplexer where s2, s1,s0 are selector lines, A and B is the input to be given and Y is the output. Function Table for Arithmetic is shown in table 1. When s2s1s0= 000: then Y = A+B i.e. Addition.
  • 24. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 12 Design and implementation of 32-bit ALU using Verilog 2016 When s2s1s0= 001: then RESULT= A-B i.e. Subtraction. When s2s1s0= 010: then RESULT= A+B+1 i.e. Addition with carry When s2s1s0= 011: then RESULT= A+(~B) i.e. Subtraction with borrow. When s2s1s0= 100: then RESULT= A+1 i.e. Increment. When s2s1s0= 101: then RESULT= A-1 i.e. decrement. When s2s1s0= 110: then RESULT= A i.e. Transfer. Table 1. Table of 32-bit Arithmetic Unit
  • 25. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 13 Design and implementation of 32-bit ALU using Verilog 2016 Fig 3.1. 32-bit Arithmetic unit Subtraction with borrow Increment Decrement Transfer Addition with carry Subtraction Addition 8:1 MUX Y S2 S1 S0
  • 26. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 14 Design and implementation of 32-bit ALU using Verilog 2016 3.2 Logic Unit A Logic unit does the following task: Logical AND, Logical OR, Logical XOR and Logical NOT operation. We will design a logic unit that can perform the four basic logic Micro operations: OR, AND, XOR and Complement, because from these four micro- operations, all other logic micro-operations can be derived. A one-stage logic unit for these four basic micro-operations is shown in the Fig.3.2 Fig. 3.2 32-bit Logic Unit The logic unit consists of four gates and a 4:1 multiplexer. The outputs of the gates are applied to the data inputs of the multiplexer. Using to selection lines S0 and S1 one of the data inputs of the multiplexer is selected as the output. For a logic unit of 32bit, the output will be of 33-bit with 33th bit to be High-impedance. The common selection lines are applied to all the stages. When S1 S0= 00: RESULT= A∙B i.e. AND. When S1 S0= 01: RESULT= A+B i.e. OR.
  • 27. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 15 Design and implementation of 32-bit ALU using Verilog 2016 When S1 S0= 10: RESULT= A⨁B i.e. XOR. When S1 S0= 10: RESULT= A i.e. NOT Table 2 .Table of 32-bit Logic Unit 3.3 Shift Unit A Shift register is a storage device that used for storage or the transfer of data in the form of binary numbers. Considering two types of register: i. Left shift ii. Right shift 3.3.1 Left Shift Data is shifted in the left hand direction one bit at a time with each transition of the clock signal. The data enters the shift register serially from the right hand side and after 32 clock transition the 32-bit register has 32-bit of data . The data is shifted out serially one bit at a time from the left hand side of the register if clock signal are continuously applied. The operation of left shit is shown on the figure 3.3.1 (a) and (b).. (a) D31 D30 D0. . . . . . . . . . . . . . . D1 C_in
  • 28. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 16 Design and implementation of 32-bit ALU using Verilog 2016 (b) Fig. 3.3.1 (a)32-bit before left shift. (b)32-bit after left shift. 3.3.2 Right Shift The data is shifted in the right hand direction one bit at a time with each transition of the clock signal. The data enter the shift register serially from the left hand side and after 32 clock transition the 32- bit register has 32-bit of data. The data is shifted out serially one bit at a time from the right hand side of the register if clock signal are commonly applied .The operation of right shift is shown on the figure 3.3.2 (a) and (b). (a) The contents of a register that has to be shifted first placed onto common bus. The D30 D29 . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . .. . . . . D0 C_in D31 . . . . . . .C_in D31 D30 D0D1. .. . . .. . . . . . . . . . . . . . . . . . . . . . . . .. . . .. . . . . .. .C_in -in D0C_in D31 D30 D1D2. . . . .. . . . . . . . . . . . . . . . . . . (b) Fig 3.3.2 (a) 32-bit before right shift .(b) 32- bit after right shift
  • 29. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 17 Design and implementation of 32-bit ALU using Verilog 2016 circuit uses no clock pulse. When the shifting unit is activated, the register is shifted left or right according to the selection unit. It used only one selector line i,e s1. For a shift unit of 32- bit, the output will be of 33-bit with 33th bit to be the outgoing bit. The circuit of shift unit is shown in figure 3.3 Fig 3.3. 32-bit Shift Unit Table 3. Table of 32-bit Shift Unit 3.4 Arithmetic Logic Unit The technique used in these is to split ALU into three modules, Arithmetic, Logic and shift module. Here the arithmetic, logic and shift that define earlier are combined into ALU with common selection line. The shift micro-operation are often perform in seperate unit, but sometime the shifter unit made part of overall ALU. For 32-bit ALU a 33 bit 4:1 MUX is needed. A particular arithmetic or logic or shift operation is selected according to the selection inputs S4 ,S5,S6 and S7. The final output
  • 30. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 18 Design and implementation of 32-bit ALU using Verilog 2016 of the ALU is determined by the set of multiplexers with selection lines S2 and S3 for logic and S1 for shift.. The function table for the ALU is shown in the Table. 4. The table lists 13 micro-operations: 7 for arithmetic, 4 for logic and 2 for shifter unit. For shifter unit, the selection line S1 is used to select either left or right shift micro-operation. Table 4. Table of 32-bit Arithmetic Logic Unit
  • 31. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 19 Design and implementation of 32-bit ALU using Verilog 2016 Fig.3.4 Arithmetic Logic Unit
  • 32. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 20 Design and implementation of 32-bit ALU using Verilog 2016 Chapter 4 VERILOG CODING AND WAVEFORM 4.1 Selection MUX 4 to1(1-bit I/O) module mux4(i0,i1,i2,i3,s0,s1,clk,y); input i0,i1,i2,i3,s0,s1,clk; output reg y; always @(posedge clk) case({i0,i1,i2,i3,s0,s1}) 2'b00:y=i0; 2'b01:y=i1; 2'b10:y=i2; 2'b11:y=i3; default y=1'bz; endcase endmodule
  • 33. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 21 Design and implementation of 32-bit ALU using Verilog 2016 4.2 Selection MUX 4 to1(32-bit I/O) module mux4l (out, i0, i1, i2, i3, s1, S0); input[31:0] i0, i1, i2, i3; input s1, S0; output[31:0] out; reg[31:0] out; always @(s1 or S0 or i0 or i1 or i2 or i3) case ({s1, S0}) 2'b00 : out = i0; 2'b01 : out = i1; 2'b10 : out = i2; 2'b11 : out = i3; default: $display("Invalid control signals"); endcase endmodule 4.3 Selection MUX 2 to1(32-bit I/O) module mux2l (out, i0, i1, S0); input[31:0] i0, i1; input S0;
  • 34. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 22 Design and implementation of 32-bit ALU using Verilog 2016 output[31:0] out; reg[31:0] out; always @( S0 or i0 or i1 ) case ({ S0}) 1‘b0 : out = i0; 1‘b1 : out = i1; default: $display("Invalid control signals"); endcase endmodule 4.4 Full Adder module fadd1(a,b,s,c,carry); input a,b,c; output s,carry; assign s=a^b^c; assign carry=a&b+b&c+c&a; endmodule 4.5 4-Bit Adder module add(a,b,y); input [3:0]a,b;
  • 35. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 23 Design and implementation of 32-bit ALU using Verilog 2016 output[3:0] y; assign y=a+b; endmodule 4.6 32-Bit Adder module ader32bit(a,b,y); input[31:0]a,b; output [31:0]y; assign y=a+b; endmodule 4.7 32-Bit AND module and32(a,b,y); input [31:0]a; input [31:0]b; output [31:0]y; assign y=a&b; endmodule 4.8 32-Bit OR module or1(a,b,y); input[31:0]a,b;
  • 36. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 24 Design and implementation of 32-bit ALU using Verilog 2016 output[31:0]y; assign y=a|b; endmodule 4.9 32-Bit XOR module xor32(a,b,y); input [31:0]a; input [31:0]b; output [31:0]y; assign y=a^b; endmodule 4.10 32-Bit NOT module not32(a,y); input [31:0]a; output [31:0]y; assign y=~a; endmodule 4.11 Right Shift module rshift(a,b); input[31:0]a;
  • 37. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 25 Design and implementation of 32-bit ALU using Verilog 2016 output[31:0]b; assign b=a>>1; endmodule 4.12 Left Shift module shift32a(a,b); input[31:0]a; output[31:0]b; assign b=a<<1; endmodule 4.13 Shift Unit module shift1(s1,a,cin,result); input [31:0]a; input s1,cin; output reg[31:0]result ; wire[31:0] w1,w2; rshift r1(a,w1); lshift r2(a,w2); always @(a,s1,cin,w1,w2) case({s1})
  • 38. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 26 Design and implementation of 32-bit ALU using Verilog 2016 1'b0:result<=w1; 1'b1:result<=w2; default:result<=1'b0; endcase endmodule module rshift(a,b); input[31:0] a; output[31:0] b; assign b=a>>1; endmodule module lshift(a,b); input [31:0]a; output [31:0] b; assign b=a<<1; endmodule 4.14 Arithmetic Unit module arith1(a,b,cin,s0,s1,s2, result); input[31:0] a,b; input cin;
  • 39. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 27 Design and implementation of 32-bit ALU using Verilog 2016 input s0,s1,s2; output[31:0] result; reg[31:0] result; wire[31:0]w0,w1,w2,w3,w4,w5,w6; add r1(a,b,w0); sub r2(a,b,w1); addwc r3(a,b,cin,w2); subwb r4(a,b,cin,w3); inc r5(a,w4); dec r6(a,w5); tra r7(a,w6); always@(a,b,cin,s0,s1,s2,w0,w1,w2,w3,w4,w5,w6) case ({s2,s1,s0}) 3'b000: result<=w0; //addition// 3'b001: result<=w1; //subtraction// 3'b010: result<=w2; //addition with carry// 3'b011: result<=w3; //subtraction with borrow// 3'b100: result<=w4; // increment// 3'b101: result<=w5; //decrement//
  • 40. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 28 Design and implementation of 32-bit ALU using Verilog 2016 3'b110: result<=w6; //transfer// 3'b111: result<=1'bx; //no need // endcase endmodule //add// module add(a,b,y); input [31:0]a,b; output[31:0] y; assign y=a+b; endmodule //sub// module sub(a,b,y); input [31:0]a,b; output[31:0] y; assign y=a-b; endmodule //additiion with carry// module addwc(a,b,cin,y); input [31:0]a,b;
  • 41. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 29 Design and implementation of 32-bit ALU using Verilog 2016 input cin; output [31:0]y; assign y=a+b+cin; endmodule //sub with borrow// module subwb(a,b,cin,y); input [31:0]a,b; input cin; output [31:0]y; //output br; assign y=a+(~b)+cin; endmodule //increment// module inc(a,y); input[31:0] a; output[31:0] y; assign y=a+1; endmodule //deredment//
  • 42. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 30 Design and implementation of 32-bit ALU using Verilog 2016 module dec(a,y); input [31:0]a; output [31:0]y; assign y=a-1; endmodule //transfer// module tra(a,y); input[31:0]a; output[31:0]y; assign y=a; endmodule 4.15 Logic Unit module logicunit32bit(a,b,s1,s0,result ); input[31:0] a,b; input s1,s0; output reg [31:0]result; wire [31:0]w1,w2,w3,w4; and1 a1 (a,b,w1); or1 a2 (a,b,w2);
  • 43. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 31 Design and implementation of 32-bit ALU using Verilog 2016 not1 a3(a,w3); exor1 a4(a,b,w4); always @(a,b,s1,s0,w1,w2,w3,w4) begin case({s1,s0}) 2'b00:result<= w1; 2'b01:result<=w2; 2'b10:result<=w3; 2'b11:result<=w4; default:result<=1'b0; endcase end endmodule module and1(c,d,j); input[31:0] c,d; output [31:0]j; assign j=c&d; endmodule module or1(c,d,j);
  • 44. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 32 Design and implementation of 32-bit ALU using Verilog 2016 input[31:0] c,d; output[31:0] j; assign j=c|d; endmodule module not1(c,d); input[31:0] c; output [31:0]d; assign d= ~c; endmodule module exor1(c,d,j); input [31:0]c,d; output [31:0]j; assign j=c^d; endmodule 4.16 32- bit ALU module alu2(a,b,s2,s3,s1,s0,s4,s5,s6,s7,cin,result ); input[31:0] a,b; input s2,s3,s1,s0,s4,s5,s6,s7,cin; output reg[31:0] result;
  • 45. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 33 Design and implementation of 32-bit ALU using Verilog 2016 wire [31:0]w1,w2; wire[31:0] w3; wire [31:0]w4,w5,w6,w7,w8,w9,w10; shift a1(s1,a,cin,w1); logicunit32bit a2 (a,b,s2,s3,w3); addcarry a3(a,b,cin,w4,s4,s5,s6,s7); add a4 (a,b,cin,w5,s4,s5,s6,s7); sub a5 (a,b,cin,w6,s4,s5,s6,s7 ); subcarry a6 (a,b,cin,w7,s4,s5,s6,s7 ); incremen22 a7 (a,cin,w8,s4,s5,s6,s7); decremen22 a8 (a,cin,w9,s4,s5,s6,s7); trd a9 (w10,a,cin,s4,s5,s6,s7); always @(a,b,w3,s1,s0,cin,s4,w1,w4,w5,w6,w7,w8,w9,w10,s5,s2,s6,s7,s3) begin case({s4,s5,s6,s7}) 4'b0000:result<= w3; 4'b0001:result<=w1; 4'b0010:result<=w4; 4'b0011:result<=w5;
  • 46. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 34 Design and implementation of 32-bit ALU using Verilog 2016 4'b0100:result<=w6; 4'b0101:result<=w7; 4'b0110:result<=w8; 4'b0111:result<=w9; 4'b1000:result<=w10; 4'b1001:result<=1'bx; 4'b1010:result<=1'bx; 4'b1011:result<=1'bx; 4'b1100:result<=1'bx; 4'b1101:result<=1'bx; 4'b1110:result<=1'bx; 4'b1111:result<=1'bx; default:result<=1‘b0; endcase end endmodule module shift(s1,a,cin,res); input[31:0] a; input s1,cin;
  • 47. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 35 Design and implementation of 32-bit ALU using Verilog 2016 output reg [31:0]res ; wire [31:0]w1,w2; rshift r1(a,w1); lshift r2(a,w2); always @(a,s1,w1,w2) case({s1}) 1'b0:res<=w1; 1'b1:res<=w2; endcase endmodule module rshift(a,b); input[31:0] a; output[31:0] b; assign b=a>>1; endmodule module lshift(a,b); input[31:0] a; output [31:0] b; assign b=a<<1;
  • 48. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 36 Design and implementation of 32-bit ALU using Verilog 2016 endmodule module logicunit32bit(a11,b11,s11,s00,res ); input[31:0] a11,b11; input s11,s00; output reg[31:0] res; wire[31:0] w31,w41,w51,w61; and1 a1 (a11,b11,w31); or1 a2 (a11,b11,w41); not11 a3(a11,w51); exor1 a4(a11,b11,w61); always @(a11,b11,s11,s00,w31,w41,w51,w61) begin case({s11,s00}) 2'b00:res<= w31; 2'b01:res<=w41; 2'b10:res<=w51; 2'b11:res<=w61; default:res<=1‘b0; endcase
  • 49. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 37 Design and implementation of 32-bit ALU using Verilog 2016 end endmodule module and1(c,d,j); input[31:0] c,d; output[31:0] j; assign j=c&d; endmodule module or1(c1,d1,j1); input [31:0]c1,d1; output [31:0] j1; assign j1=c1|d1; endmodule module not11(c2,d2); input [31:0]c2; output [31:0]d2; assign d2= ~c2; endmodule module exor1(c3,d3,j3); input [31:0]c3,d3;
  • 50. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 38 Design and implementation of 32-bit ALU using Verilog 2016 output[31:0] j3; assign j3=c3^d3; endmodule module add(a,b,cin,y,s4,s5,s6,s7); input [31:0]a,b; input cin; input s4,s5,s6,s7; output[31:0] y; assign y=a+b; endmodule module addcarry(a,b,cin,y,s4,s5,s6,s7 ); input [31:0]a,b; input cin; input s4,s5,s6,s7; output [31:0]y; assign y=a+b+cin; endmodule module sub(a,b,cin,y,s4,s5,s6,s7 ); input [31:0]a,b;
  • 51. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 39 Design and implementation of 32-bit ALU using Verilog 2016 input s4,s5,s6,s7; output [31:0]y; //output br; input cin; assign y=a+(~b)+cin; //assign br=(~a)&b; endmodule module subcarry(a,b,cin,y,s4,s5,s6,s7 ); input [31:0]a,b; input cin; input s4,s5,s6,s7; output [31:0]y; assign y=a+~b+cin; endmodule module incremen22(a,cin,y,s4,s5,s6,s7); input[31:0] a; input cin; input s4,s5,s6,s7; output[31:0] y;
  • 52. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 40 Design and implementation of 32-bit ALU using Verilog 2016 assign y=a+1+cin; endmodule module decremen22(a,cin,y,s4,s5,s6,s7); input [31:0]a; input cin; input s4,s5,s6,s7; output [31:0]y; assign y=a-1+cin; endmodule module trd(y,a ,cin,s4,s5,s6,s7); input [31:0]a; input s4,s5,s6,s7; output [31:0]y; input cin; assign y=a+cin; endmodule 4.17 Test Bench for 32-bit ALU module test1; // Inputs
  • 53. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 41 Design and implementation of 32-bit ALU using Verilog 2016 reg [31:0] a; reg [31:0] b; reg s2; reg s3; reg s1; reg s0; reg s4; reg s5; reg s6; reg s7; reg cin; // Outputs wire [31:0] result; // Instantiate the Unit Under Test (UUT) alu2 uut ( .a(a), .b(b), .s2(s2), .s3(s3),
  • 54. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 42 Design and implementation of 32-bit ALU using Verilog 2016 .s1(s1), .s0(s0), .s4(s4), .s5(s5), .s6(s6), .s7(s7), .cin(cin), .result(result) ); initial begin // Initialize Inputs a = 0; b = 0; s2 = 0; s3 = 0; s1 = 0; s0 = 0; s4 = 0; s5 = 0;
  • 55. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 43 Design and implementation of 32-bit ALU using Verilog 2016 s6 = 0; s7 = 0; cin = 0; // Wait 100 ns for global reset to finish #100; // Add stimulus here #10 s2=0;s3=0;s1=1'bx;s4=0;s5=0;s6=0;s7=0;cin=1'bx;a=7;b=5; #10 s4=0;s5=0;s6=0;s7=1;s1=1;s2=1'bx;s3=1'bx;cin=1'bx;a=9;b=1'bx; #10 s1=1'bx;s4=0;s5=0;s6=0;s7=0;cin=1'bx;a=15;b=1'bx;s2=1;s3=0; #10 s4=0;s5=1;s6=1;s7=0;a=13;cin=1;b=1'bx;s1=1;s0=1;s3=0; #10 s4=0;s5=1;s6=1;s7=1;a=14;b=1'bx;cin=0;s1=1;s0=0;s2=0;s3=0; #10 s4=1;s5=0;s6=0;s7=0;a=10;b=1'bx;cin=0;s1=1;s0=0;s2=0;s3=0; #10 s4=0;s5=0;s6=0;s7=0;s2=1;s3=1;s1=1;s0=0;a=12;b=6;cin=1'bx; #10 s4=0;s5=0;s6=0;s7=0;s3=0;s2=1;s1=1;s0=1;cin=1'bx;a=99;b=1'bx; #10 s2=0;s3=1;s1=1'bx;s4=0;s5=0;s6=0;s7=0;cin=1'bx;a=7;b=5; #10 s4=0;s5=0;s6=1;s7=1;cin=0;s0=0;s1=0;s2=0;s3=0;a=9;b=6; #10 s4=0;s5=0;s6=1;s7=0;cin=1;s0=0;s1=0;s2=0;s3=0;a=3;b=5; #10 s4=0;s5=1;s6=0;s7=0;cin=1;s0=1;s1=0;s2=0;s3=0;a=9;b=5; #10 s4=0;s5=1;s6=0;s7=1;cin=0;s0=1;s1=0;s2=0;s3=0;a=9;b=5;
  • 56. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 44 Design and implementation of 32-bit ALU using Verilog 2016 #10 s4=0;s5=0;s6=0;s7=1;s3=1;s2=0;s1=0;s0=1'bx;cin=1'bx;a=8;b=1'bx; end endmodule Fig.4.1 RTL of 32-bit ALU
  • 57. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 45 Design and implementation of 32-bit ALU using Verilog 2016 Waveform Fig 4.2. 4:1 MUX 32-bit Waveform Fig 4.3. 32-bit Arithmetic unit
  • 58. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 46 Design and implementation of 32-bit ALU using Verilog 2016 Fig 4.4. 32-bit Logic unit Fig 4.5. 32-bit Shift Unit
  • 59. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 47 Design and implementation of 32-bit ALU using Verilog 2016 Fig 4.6. 32-bit Arithmetic Logic Unit
  • 60. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 48 Design and implementation of 32-bit ALU using Verilog 2016 Chapter 5 ADVANTAGE AND CONCLUSION 5.1 Importance of HDL HDLs have many advantages compare to traditional schematic-based design.[1]  Designs can be described at a very abstract level by use of HDLs. Designers can write their RTL description without choosing a specific fabrication technology.  By describing designs in HDLs, functional verification of the design can be done early in the design cycle. Since designers work at RTL level, they can optimize and modify the RTL description until it meet the desired functionality. Most design bugs are eliminated at this point.  Designing with HDLs is analogous to computer programming. A textual description with comments is an easier way to develop and debug circuits. This also provides a concise representation of the design, compare to gate level schematics. Gate level schematics are almost incomprehensible for very complex designs. 5.2 Advantages of Verilog HDL  Verilog HDL is a general-purpose hardware description language that is easy to learn and easy to use. It is similar in syntax to the C programing language. Designers with C programing experience will find it easy to learn Verilog HDL.  Verilog HDL allow different level of abstraction to mixed in the same model. Thus , a designer can define a hardware model in terms of switches, gates, RTL,
  • 61. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 49 Design and implementation of 32-bit ALU using Verilog 2016 or behavioural codes. Also, a designer needs to learn only one language for stimulus and hierarchical design.  Most popular logic synthesis tools support Verilog HDL. This makes it the language of choice for designers .  All fabrication vendors provide Verilog HDL libraries for post logic synthesis simulation. Thus, designing a chip in Verilog HDL allows the widest choice of vendors.  The programming language interface (PLI) is a powerful feature that allow s the user to write custom C code to interact with the internal data structures of Verilog. Designers can customized a Verilog HDL simulator to their needs with the PLI. 5.3 Conclusion In our project ―Design and Implementation of a 32-bit ALU using Verilog‖ we have designed and implemented a 32 bit ALU. Arithmetic Logic Unit is the part of a computer that performs all arithmetic computations such as addition, subtraction, addition with carry, subtraction with borrow, increment and decrement ,shifting such as right shift and left shift and all basic logical operations like AND, OR,NOT and XOR. ALU represents the fundamental building block of the central processing unit (CPU) of a computer We have compare the number of MUX with [7],[8] which result in less number of MUX that we used.
  • 62. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 50 Design and implementation of 32-bit ALU using Verilog 2016 5.4 Future scope of Verilog Verilog can be used at different levels of abstraction as we have already seen [9]. But how useful are these different levels of abstraction when it comes to using Verilog? 5.4.1 Design process The diagram below shows a very simplified view of the electronic system design process incorporating Verilog. The central portion of the diagram shows the parts of the design process which will be impacted by Verilog. System analysis and partitioning Physical spec H/W spec S/W spec Analog spec Digital function spec Verilog Algorithm RTL Gates Timing analysis fault simulation Mixed signal simulation Layout Fig.5.4.1 Design Process Sign off simulation
  • 63. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 51 Design and implementation of 32-bit ALU using Verilog 2016 5.4.2 System Level Verilog is not ideally suited for abstract system-level simulation, prior to the hardware- software split. This is to some extent add ressed by SystemVerilog. Unlike VHDL, which has support for user-defined types and overloaded operators which allow the designer to abstract his work into the domain of the problem, Verilog restricts the designer to working with pre-defined system functions and tasks for stochastic simulation and can be used for modelling performance, throughput and queueing but only in so far as those built-in language features allow. Designers occasionally use the stochastic level of abstraction for this phase of the design process. 5.4.3 Digital Verilog is suitable for use today in the digital hardware design process, from functional simulation, manual design and logic synthesis down to gate-level simulation. Verilog tools provide an integrated design environment in this area. Verilog is also suited for specialized implementation-level design verification tools such as fault simulation, switch level simulation and worst case timing simulation. Verilog can be used to simulate gate level fanout loading effects and routing delays through the import of SDF files. The RTL level of abstraction is used for functional simulation prior to synthesis. The gate level of abstraction exists post-synthesis but this level of abstraction is not often created by the designer, it is a level of abstraction adopted by the EDA tools (synthesis and timing analysis, for example). 5.4.4 Analog Because of Verilog's flexibility as a programming language, it has been stretched to handle analog simulation in limited cases. There is a draft standard – Verilog-AMS – that addresses analog and mixed signal simulation.
  • 64. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 52 Design and implementation of 32-bit ALU using Verilog 2016 5.4.5 Debugging Accuracy and time is essential—especially when it comes to your development simulation and debugging. Our Verilog simulator and compiler will change the way you can simulate, debug, and manage your development process. VeriLogger Extreme is a high-performance compiled-code Verilog 2001 simulator with automatic test bench generation that significantly reduces simulation debug time. VeriLogger Extreme offers fast simulation of both RTL and gate-level simulations with SDF timing information. VeriLogger Extreme supports design libraries and design flows for all major ASIC and FPGA vendors, including Actel/MicroSemi, Altera, Atmel, LSI Logic, Quick Logic, and Xilinx.
  • 65. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 53 Design and implementation of 32-bit ALU using Verilog 2016 References [1]. Samir Palnitkar, Verilog HDL, A Guide to digital design and Synthesis. Published by Prentice Hall PTR, 1996 ISBN 10: 0134516753 / ISBN 13: 9780134516752. [2]. Donald E. Thomas and Philip R. Moorby, The Verilog Hardware Description language . Published by Springer; 5th ed. 2002 edition (27 October 2008). ISBN-10: 0387849300,ISBN-13: 978-0387849300 [3]. J Bhasker, A Verilog HDL Primer . Published by Bs Publications/bsp Books(2008). ISBN-10: 817800142X, ISBN-13: 978-8178001425 [4]. Lionel Benning and Harry Foster, Verifiable RTL Design: A Functional Coding Style Supporting Verification Processes in Verilog. Published by Springer; 2nd ed. 2001 edition (31 May 2001). ISBN-10: 0792373685, ISBN-13: 978-0792373681. [5]. IEEE Std 1364-2001 : IEEE Standard Hardware Description Language based on the Verilog Hardware Description Language Published by the IEEE, Inc., http://www.ieee.org 345 East 47th Street, New York, NY 10017, USA. [6]. Douglas J Smith, FPGAs using VHDL or Verilog . Published by Doone Publications. [7]. Anushka Pakrashi, Arindam Bose, Kausik Bhattacharya, Monigingir Pal, Tanaya Bose. Design and Implementation of 32-Bit ALU on XILINX FPGA using VHDL.Institute: FUTURE INSTITUTE OF ENGINEERING AND MANAGEMENT (2008-2012).
  • 66. Department of Electronics and Communication Engineering ©Athihrii, Stephen, Sanjay 2016 Page 54 Design and implementation of 32-bit ALU using Verilog 2016 [8]. Anadi Anant Jain, Ankush Bhushan, Bhavyai Gupta, Faizan Ayubi. Implementation of 32-Bit arithmetic Logic Unit on Xilinx using VHDL. Institute : DELHI TECHNOLOGICAL UNIVERSITY. [9]. https://www.doulos.com/knowhow/verilog_designers_guide/scope_of_verilog/