The main objective of project is to design and verify different operations of Arithmetic and Logical Unit (ALU). We have designed an 8 bit ALU which accepts two 8 bits numbers and the code corresponding to the operation which it has to perform from the user. The ALU performs the desired operation and generates the result accordingly. The different operations that we dealt with, are arithmetical, logical and relational. Arithmetic operations include arithmetic addition, subtraction, multiplication and division. Logical operations include AND, OR, NAND, XOR, NOT and NOR. These take two binary inputs and result in output logically operated. The operations like the greater than, less than, equal to, exponential etc are also included. To implement ALU, the coding was written in VHDL . The waveforms were obtained successfully. After the coding was done, the synthesis of the code was performed using Xilinx-ISE. Synthesis translates VHDL code into netlist (a textual description). Thereafter, the simulation was done to verify the synthesized code.
FPGA are a special form of Programmable logic devices(PLDs) with higher densities as compared to custom ICs and capable of implementing functionality in a short period of time using computer aided design (CAD) software....by mathewsubin3388@gmail.com
8 Bit ALU is a combinational circuit which accepts two 8-bit numbers gives result.It is designed using the Verilog HDL code which is more useful for bachelor as well as masters engineering students.
Designing of 8 BIT Arithmetic and Logical Unit and implementing on Xilinx Ver...Rahul Borthakur
The main objective of this project was to design and verify different operations of Arithmetic and Logical Unit (ALU). To implement ALU, the coding was written in VHDL (VHSIC Hardware Description Language) and verified in ModelSim. The device was configured and using FPGA (Field-programmable gate array) verification, debugging was done.
FPGA are a special form of Programmable logic devices(PLDs) with higher densities as compared to custom ICs and capable of implementing functionality in a short period of time using computer aided design (CAD) software....by mathewsubin3388@gmail.com
8 Bit ALU is a combinational circuit which accepts two 8-bit numbers gives result.It is designed using the Verilog HDL code which is more useful for bachelor as well as masters engineering students.
Designing of 8 BIT Arithmetic and Logical Unit and implementing on Xilinx Ver...Rahul Borthakur
The main objective of this project was to design and verify different operations of Arithmetic and Logical Unit (ALU). To implement ALU, the coding was written in VHDL (VHSIC Hardware Description Language) and verified in ModelSim. The device was configured and using FPGA (Field-programmable gate array) verification, debugging was done.
Minor Project Report: Automatic Door Control SystemSaban Kumar K.C.
This minor project is based on the automatic door control system used in a room or hall based on IR sensor. This project is applicable at such places where the people are busy and people are in large number.
The work is aimed at measurement of heartbeat and displays the information on an alphanumeric (or Graphical) LCD display. The heartbeat monitor uses LED and an LDR based sensor to determine the heartbeat.
8 Bit ALU design is a combinational circuit which adds two binary numbers of 8 bit lenth.Which is more useful for both bachelor as well as masters students.
A digital clock is a type of clock that displays the time digitally (i.e. in numerals or other symbols), as opposed to an analog clock, where the time is indicated by the positions of rotating hands.
It Defines what is Programmable Logic Array(PLA) also explains it in easy wording with syntax and Example...
It also cover what is Combinational & Sequential Logic Circuit and the Difference b/w these both. :)
Field-programmable gate array\
only for these students that are intrested in Field-programmable gate array
field-programmable gate array (FPGA) is an integrated circuit designed to be configured by a customer or a designer after manufacturing – hence "field-programmable". The FPGA configuration is generally specified using a hardware description language (HDL), similar to that used for an application-specific integrated circuit (ASIC). (Circuit diagrams were previously used to specify the configuration, as they were for ASICs
The FPGA industry sprouted from programmable read-only memory (PROM) and programmable logic devices (PLDs). PROMs and PLDs both had the option of being programmed in batches in a factory or in the field (field-programmable). However, programmable logic was hard-wired between logic gates.[6]
In the late 1980s, the Naval Surface Warfare Center funded an experiment proposed by Steve Casselman to develop a computer that would implement 600,000 reprogrammable gates. Casselman was successful and a patent related to the system was issued in 1992.[6]
Some of the industry's foundational concepts and technologies for programmable logic arrays, gates, and logic blocks are founded in patents awarded to David W. Page and LuVerne R. Peterson in 1985.
Minor Project Report: Automatic Door Control SystemSaban Kumar K.C.
This minor project is based on the automatic door control system used in a room or hall based on IR sensor. This project is applicable at such places where the people are busy and people are in large number.
The work is aimed at measurement of heartbeat and displays the information on an alphanumeric (or Graphical) LCD display. The heartbeat monitor uses LED and an LDR based sensor to determine the heartbeat.
8 Bit ALU design is a combinational circuit which adds two binary numbers of 8 bit lenth.Which is more useful for both bachelor as well as masters students.
A digital clock is a type of clock that displays the time digitally (i.e. in numerals or other symbols), as opposed to an analog clock, where the time is indicated by the positions of rotating hands.
It Defines what is Programmable Logic Array(PLA) also explains it in easy wording with syntax and Example...
It also cover what is Combinational & Sequential Logic Circuit and the Difference b/w these both. :)
Field-programmable gate array\
only for these students that are intrested in Field-programmable gate array
field-programmable gate array (FPGA) is an integrated circuit designed to be configured by a customer or a designer after manufacturing – hence "field-programmable". The FPGA configuration is generally specified using a hardware description language (HDL), similar to that used for an application-specific integrated circuit (ASIC). (Circuit diagrams were previously used to specify the configuration, as they were for ASICs
The FPGA industry sprouted from programmable read-only memory (PROM) and programmable logic devices (PLDs). PROMs and PLDs both had the option of being programmed in batches in a factory or in the field (field-programmable). However, programmable logic was hard-wired between logic gates.[6]
In the late 1980s, the Naval Surface Warfare Center funded an experiment proposed by Steve Casselman to develop a computer that would implement 600,000 reprogrammable gates. Casselman was successful and a patent related to the system was issued in 1992.[6]
Some of the industry's foundational concepts and technologies for programmable logic arrays, gates, and logic blocks are founded in patents awarded to David W. Page and LuVerne R. Peterson in 1985.
Design and Implementation of Speech Based Scientific CalculatorShantha Suresh M
In recent days speech recognition based systems are gaining more prominence and are used in a wide range of applications. Calculator has become an indispensable part of our lives, used at home, at local retail shops or at workplaces like banks, IT companies, medical laboratories etc. Speech recognized calculator is one of the speech recognition systems, in which the digits and operators spoken by the user with pauses in between are analyzed using various algorithms and finally one of the 10 digits (0 to 9) and one of the 5 operators(+, -, *, /, =) The objective of our paper is to design and implement the speech recognized calculator in MATLAB and Standalone Microcontroller. This designed system is able to take detect the digits and operators of the arithmetic expression whose result is to be calculated. In this paper we have used linear predictive method for recognizing the digit/operator in MATLAB and Analog Speech Recognition Chip.
Verilog code for design a specific processor to down sample a given image via a math-lab by using SPARTAN-6 FPGA. Math-lab code, results also included.
In computing, an arithmetic logic unit (ALU) is a digital circuit that performs arithmetic and logical operations. The ALU is a fundamental building block of the central processing unit (CPU) of a computer, and even the simplest microprocessors contain one for purposes such as maintaining timers. The processors found inside modern CPUs and graphics processing units (GPUs) accommodate very powerful and very complex ALUs; a single component may contain a number of ALUs.
Verilog codes and testbench codes for basic digital electronic circuits. shobhan pujari
Verilog codes and test bench codes for full adder,full adder using 2 half adders,Ripple carry adder,16x1 mux using 4x1 mux,decoder,mealy state machine,counter. These are more useful for bachelor students and masters students who are pursuing degree in electrical engineering .
Seminar on Digital Multiplier(Booth Multiplier) Using VHDLNaseer LoneRider
This is my Mini project. It is very clear and has lots of animation in it. If you like to know about booth algorithm and VHDL this the perfect presentation. Download it and see as SLIDE SHOW. You will enjoy more of my work, Give blessings.
1- Modeling Hierarchy
2- Creating Testbenches
Skills gained:
1- Reuse design units several times in a design hierarchy
2- Automate testing of design units
This is part of VHDL 360 course
Yaser Khalifa introduces you to VHDL (VHSIC Hardware Description Language), a hardware description language used in electronic design automation to describe digital and mixed-signal systems such as field-programmable gate arrays and integrated circuits.
Student information management system project report ii.pdfKamal Acharya
Our project explains about the student management. This project mainly explains the various actions related to student details. This project shows some ease in adding, editing and deleting the student details. It also provides a less time consuming process for viewing, adding, editing and deleting the marks of the students.
Cosmetic shop management system project report.pdfKamal Acharya
Buying new cosmetic products is difficult. It can even be scary for those who have sensitive skin and are prone to skin trouble. The information needed to alleviate this problem is on the back of each product, but it's thought to interpret those ingredient lists unless you have a background in chemistry.
Instead of buying and hoping for the best, we can use data science to help us predict which products may be good fits for us. It includes various function programs to do the above mentioned tasks.
Data file handling has been effectively used in the program.
The automated cosmetic shop management system should deal with the automation of general workflow and administration process of the shop. The main processes of the system focus on customer's request where the system is able to search the most appropriate products and deliver it to the customers. It should help the employees to quickly identify the list of cosmetic product that have reached the minimum quantity and also keep a track of expired date for each cosmetic product. It should help the employees to find the rack number in which the product is placed.It is also Faster and more efficient way.
Explore the innovative world of trenchless pipe repair with our comprehensive guide, "The Benefits and Techniques of Trenchless Pipe Repair." This document delves into the modern methods of repairing underground pipes without the need for extensive excavation, highlighting the numerous advantages and the latest techniques used in the industry.
Learn about the cost savings, reduced environmental impact, and minimal disruption associated with trenchless technology. Discover detailed explanations of popular techniques such as pipe bursting, cured-in-place pipe (CIPP) lining, and directional drilling. Understand how these methods can be applied to various types of infrastructure, from residential plumbing to large-scale municipal systems.
Ideal for homeowners, contractors, engineers, and anyone interested in modern plumbing solutions, this guide provides valuable insights into why trenchless pipe repair is becoming the preferred choice for pipe rehabilitation. Stay informed about the latest advancements and best practices in the field.
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxR&R Consult
CFD analysis is incredibly effective at solving mysteries and improving the performance of complex systems!
Here's a great example: At a large natural gas-fired power plant, where they use waste heat to generate steam and energy, they were puzzled that their boiler wasn't producing as much steam as expected.
R&R and Tetra Engineering Group Inc. were asked to solve the issue with reduced steam production.
An inspection had shown that a significant amount of hot flue gas was bypassing the boiler tubes, where the heat was supposed to be transferred.
R&R Consult conducted a CFD analysis, which revealed that 6.3% of the flue gas was bypassing the boiler tubes without transferring heat. The analysis also showed that the flue gas was instead being directed along the sides of the boiler and between the modules that were supposed to capture the heat. This was the cause of the reduced performance.
Based on our results, Tetra Engineering installed covering plates to reduce the bypass flow. This improved the boiler's performance and increased electricity production.
It is always satisfying when we can help solve complex challenges like this. Do your systems also need a check-up or optimization? Give us a call!
Work done in cooperation with James Malloy and David Moelling from Tetra Engineering.
More examples of our work https://www.r-r-consult.dk/en/cases-en/
About
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Technical Specifications
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
Key Features
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface
• Compatible with MAFI CCR system
• Copatiable with IDM8000 CCR
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
Application
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdffxintegritypublishin
Advancements in technology unveil a myriad of electrical and electronic breakthroughs geared towards efficiently harnessing limited resources to meet human energy demands. The optimization of hybrid solar PV panels and pumped hydro energy supply systems plays a pivotal role in utilizing natural resources effectively. This initiative not only benefits humanity but also fosters environmental sustainability. The study investigated the design optimization of these hybrid systems, focusing on understanding solar radiation patterns, identifying geographical influences on solar radiation, formulating a mathematical model for system optimization, and determining the optimal configuration of PV panels and pumped hydro storage. Through a comparative analysis approach and eight weeks of data collection, the study addressed key research questions related to solar radiation patterns and optimal system design. The findings highlighted regions with heightened solar radiation levels, showcasing substantial potential for power generation and emphasizing the system's efficiency. Optimizing system design significantly boosted power generation, promoted renewable energy utilization, and enhanced energy storage capacity. The study underscored the benefits of optimizing hybrid solar PV panels and pumped hydro energy supply systems for sustainable energy usage. Optimizing the design of solar PV panels and pumped hydro energy supply systems as examined across diverse climatic conditions in a developing country, not only enhances power generation but also improves the integration of renewable energy sources and boosts energy storage capacities, particularly beneficial for less economically prosperous regions. Additionally, the study provides valuable insights for advancing energy research in economically viable areas. Recommendations included conducting site-specific assessments, utilizing advanced modeling tools, implementing regular maintenance protocols, and enhancing communication among system components.
Overview of the fundamental roles in Hydropower generation and the components involved in wider Electrical Engineering.
This paper presents the design and construction of hydroelectric dams from the hydrologist’s survey of the valley before construction, all aspects and involved disciplines, fluid dynamics, structural engineering, generation and mains frequency regulation to the very transmission of power through the network in the United Kingdom.
Author: Robbie Edward Sayers
Collaborators and co editors: Charlie Sims and Connor Healey.
(C) 2024 Robbie E. Sayers
Water scarcity is the lack of fresh water resources to meet the standard water demand. There are two type of water scarcity. One is physical. The other is economic water scarcity.
Vhdl code and project report of arithmetic and logic unit
1. 1
PROJECT REPORT
ON
“DIGITAL CALCULATOR”
Or
“ARITHMETIC AND LOGIC UNIT”
In recognition to the partial fulfillment of DSD Practical [ENP301]
Submitted by
SARANG WANKHEDE[79]
V SEM,SEC A
NIKHIL SAHU [78]
V SEM,SEC A
KUNAL SAHA [81]
V SEM,SEC A
Under the guidance of
Prof. Pankaj Joshi
Dept. of Electronics Engineering, RCOEM
Shri Ramdeobaba College of Engineering and Management,Nagpur
(An autonomous College of Rashtrasant Tukadoji Maharaj Nagpur University)
Department of Electronics Engineering
Year 2014-2015
2. 2
Shri Ramdeobaba College of Engineering and Management,Nagpur
(An autonomous College of Rashtrasant Tukadoji Maharaj Nagpur University)
Department of Electronics Engineering
Certificate
This is to certify that the project titled
“DIGITAL CALCULATOR”
has been Successfully completed by the following students under the guidance of Prof.
PANKAJ JOSHI in recognition to the partial fulfillment of the requirements for the Digital
System Design ENP-301 course work of Bachelor of Electronics Engineering during
academic year 2014-2015.
Students Name Roll No. Section Name Signature
SARANG WANKHEDE 79 A
NIKHIL SAHU 78 A
KUNAL SAHA 81 A
Prof. PankajJoshi
(Project Guide)
3. 3
Shri Ramdeobaba College of Engineering and Management,Nagpur
(An autonomous College of Rashtrasant Tukadoji Maharaj Nagpur University)
Department of Electronics Engineering
DSD Practical [ ENP 301] Evaluation Sheet
Internal Examiner External Examiner
RollNo
Name
Concept
ArchitecturalDesign
Implementationandtesting
plan
ProjectReport
Delivery
Totaloutof25
79 SARANGWANKHEDE
78 NIKHIL SAHU
81 KUNAL SAHA
4. 4
ABSTRACT
This is the technical report for our ENP-301 Project —Digital Calculator.
This project is software implemented. We modeled the system in VHDL
(Very-high-speed integrated circuit Hardware Description Language).
DIGITAL CALULATOR is a basically a 8 bit-ALU which performs
various arithmetic and logical operations like addition, subtraction,
multiplication , division, AND , OR , NAND ,EX-OR, etc.
5. 5
ACKNOWLEDGEMENT
We feel great pleasure in submitting this report on the project “Digital
Calculator”. We would like to take this opportunity to express our gratitude to
our project guide, Prof.Pankaj Joshi for his support and constant
encouragement along with his expert guidance that helped us to complete the
project successfully. His everlasting patience and whole hearted inspiration
guided us on the right path to achieve what we have achieved today.
We are also thanking full to sub-ordinates staff that offered us their help and
stood by us.
In the end we would like to express our thanks to our friends and fellow who
helped us in many ways and encouraged us.
PROJECTEES:
SARANG WANKHEDE
NIKHIL SAHU
KUNAL SAHA
8. 8
CHAPTER 1
INTRODUCTION
The main objective of project is to design and verify different operations of
Arithmetic and Logical Unit (ALU). We have designed an 8 bit ALU which
accepts two 8 bits numbers and the codecorrespondingto the operation which it
has to perform from the user. The ALU performs the desired operation and
generates the result accordingly. The different operations that we dealt with, are
arithmetical, logical and relational. Arithmetic operations include arithmetic
addition, subtraction, multiplication and division. Logical operations include
AND, OR, NAND, XOR, NOT and NOR. These take two binary inputs and
result in output logically operated. The operations like the greater than, less
than, equal to, exponential etc are also included. To implement ALU, the
coding was written in VHDL . The waveforms were obtained successfully.
After the coding was done, the synthesis of the codewas performed using
Xilinx-ISE. Synthesis translates VHDL codeinto netlist (a textual description).
Thereafter, the simulation was done to verify the synthesized code.
10. 10
Chapter 2
Motivation
In this project, our motive was to design a digital calculator which is a
8-bit ALU. An arithmetic logic unit (ALU) is a digital circuit that
performs arithmetic and logical operations. The ALU is a fundamental
building block of the central processing unit (CPU) of a computer, and
even the simplest microprocessors contain one for purposes such as
maintaining timers
12. 12
Chapter 3
Working
ALU:
The arithmetic and logic unit simply performs operations on the data
given at input C & input D according to select input given by the user.
SR.NO SELECT INPUT OPERATIONS
1. 0000 SAME (Y<=C)
2. 0001
0010
ADD C,D
3. 0011
0100
SUB C,D
4. 0101
0110
MULTIPLY C,D
5. 0111
1000
DIVISION C,D
6. 1001 AND
7. 1010 OR
8. 1011 NOT C
9. 1100 EX-OR C,D
10 1101 EX-NOR C,D
11. 1110 NAND C,D
12. 1111 NOR C,D
15. 15
VHDL CODE
VHDL CODE FOR DIGITAL CALCULATOR
FULL ADDER
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
16. 16
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity full_adder is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
CINN : in STD_LOGIC;
SUM : out STD_LOGIC;
CARRY : out STD_LOGIC);
end full_adder;
architecture Behavioral of full_adder is
begin
SUM <= a xor b xor cINN;
carry <= (a and (b or cINN)) or (b and cINN);
end Behavioral;
FULL SUBTRACTOR
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity full_subtractor is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
c : in STD_LOGIC;
sum : out STD_LOGIC;
carry : out STD_LOGIC);
end full_subtractor;
architecture Behavioral of full_subtractor is
begin
sum<= a xor b xor c ;
carry<= ((not a) and b ) or ( b and c ) or ( (not a) and c) ;
end Behavioral;
SAME
17. 17
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity same is
Port ( x : in STD_LOGIC_VECTOR (7 downto 0);
z : out STD_LOGIC_VECTOR (7 downto 0));
end same;
architecture Behavioral of same is
begin
z <= x;
end Behavioral;
BYTE ADDER
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity adder is
Port ( a : in STD_LOGIC_VECTOR (07 downto 0);
b : in STD_LOGIC_VECTOR (07 downto 0);
cin : in STD_LOGIC;
s : out STD_LOGIC_VECTOR (07 downto 0);
cout : out STD_LOGIC_VECTOR (07 downto 0));
end adder;
architecture Behavioral of adder is
signal i : std_logic_vector(7 downto 0);
component full_adder is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
CINN : in STD_LOGIC;
SUM : out STD_LOGIC;
CARRY : out STD_LOGIC);
end component ;
begin
FA0 : full_adder port map (a(0), b(0), cin , s(0), i(0));
18. 18
FA1 : full_adder port map (a(1), b(1), i(0) , s(1), i(1));
FA2 : full_adder port map (a(2), b(2), i(1) , s(2), i(2));
FA3 : full_adder port map (a(3), b(3), i(2) , s(3), i(3));
FA4 : full_adder port map (a(4), b(4), i(3) , s(4), i(4));
FA5 : full_adder port map (a(5), b(5), i(4) , s(5), i(5));
FA6 : full_adder port map (a(6), b(6), i(5) , s(6), i(6));
FA7 : full_adder port map (a(7), b(7), i(6) , s(7), i(7));
cout(0)<= i(7) ;
cout(1)<= '0' ;
cout(2)<= '0' ;
cout(3)<= '0' ;
cout(4)<= '0' ;
cout(5)<= '0' ;
cout(6)<= '0' ;
cout(7)<= '0' ;
end Behavioral;
BYTE SUBTRACTOR
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity subtractor is
Port ( a : in STD_LOGIC_VECTOR (07 downto 0);
b : in STD_LOGIC_VECTOR (07 downto 0);
cin : in STD_LOGIC;
cout : out STD_LOGIC_VECTOR (07 downto 0);
s : out STD_LOGIC_VECTOR (07 downto 0));
end subtractor;
architecture Behavioral of subtractor is
signal i : std_logic_vector(7 downto 0);
component full_subtractor is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
c : in STD_LOGIC;
sum : out STD_LOGIC;
carry : out STD_LOGIC);
end component ;
begin
FA0 : full_subtractor port map (a(0), b(0), cin , s(0), i(0));
19. 19
FA1 : full_subtractor port map (a(1), b(1), i(0) , s(1), i(1));
FA2 : full_subtractor port map (a(2), b(2), i(1) , s(2), i(2));
FA3 : full_subtractor port map (a(3), b(3), i(2) , s(3), i(3));
FA4 : full_subtractor port map (a(4), b(4), i(3) , s(4), i(4));
FA5 : full_subtractor port map (a(5), b(5), i(4) , s(5), i(5));
FA6 : full_subtractor port map (a(6), b(6), i(5) , s(6), i(6));
FA7 : full_subtractor port map (a(7), b(7), i(6) , s(7), i(7));
cout(0)<= i(7) ;
cout(1)<= '0' ;
cout(2)<= '0' ;
cout(3)<= '0' ;
cout(4)<= '0' ;
cout(5)<= '0' ;
cout(6)<= '0' ;
cout(7)<= '0' ;
end Behavioral;
MULTIPLIER
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity multiplier8bit is
Port ( x : in STD_LOGIC_VECTOR (7 downto 0);
y : in STD_LOGIC_VECTOR (7 downto 0);
q : out STD_LOGIC_VECTOR (7 downto 0);
P : out STD_LOGIC_VECTOR (7 downto 0) );
end multiplier8bit;
architecture Behavioral of multiplier8bit is
type PRODUCT is array(0 to 7,0 to 7)of std_logic;
signal XY:PRODUCT;
signal
C10,C11,C12,C13,C20,C21,C22,C23,C30,C31,C32,C33,C34,C41,C42,C43,C44,C45,C51,C
52,C53,C54,C55,C56,C61,C62,C63,C64,C65,C66,C67,C71,C72,C73,C74,C75,C76,C77,C81
,C82,C83,C84,C85,C86,C87,C91,C92,C93,C94,C95,C101,C102,C103,C104,C111,C112,C1
13,C121,C122,C123:std_logic;
20. 20
signal
S11,S21,S22,S31,S32,S33,S41,S42,S43,S44,S51,S52,S53,S54,S55,S61,S62,S63,S64,S65,S6
6,S71,S72,S73,S74,S75,S76,S81,S82,S83,S84,S85,S91,S92,S93,S94,S101,S102,S103,S111,
S112,S121:std_logic;
component full_adder
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
CINN : in STD_LOGIC;
sum : out STD_LOGIC;
carry : out STD_LOGIC);
end component;
*
begin
GEN1: for i in 0 to 7 generate
GEN2: for j in 0 to 7 generate
GEN3: XY(i,j) <= X(i) and Y(j);
end generate;
end generate;
FA0 : full_adder port map(XY(1,0), '0', XY(0,1), P(1), C10);
FA1 : full_adder port map(XY(2,0),XY(1,1),'0',S11,C11);
FA2 : full_adder port map(XY(0,2),S11,C10,P(2),C12);
FA3 : full_adder port map(XY(3,0),XY(2,1),C12,S21,C21);
FA4 : full_adder port map(XY(1,2),XY(0,3),C11,S22,C22);
FA5 : full_adder port map(S21,S22,'0',P(3),C23);
FA6 : full_adder port map(XY(4,0),XY(3,1),C21,S31,C31);
FA7 : full_adder port map(XY(2,2),XY(1,3),C22,S32,C32);
FA8 : full_adder port map(S31,S32,C23,S33,C33);
FA9 : full_adder port map(XY(0,4),S33,'0',P(4),C34);
FA10 : full_adder port map(XY(5,0),XY(4,1),C31,S41,C41);
FA11: full_adder port map(XY(3,2),XY(2,3),C32,S42,C42);
FA12: full_adder port map(XY(1,4),XY(0,5),C33,S43,C43);
FA13: full_adder port map(S41,S42,C34,S44,C44);
FA14: full_adder port map(S43,S44,'0',P(5),C45);
FA15: full_adder port map(XY(6,0),XY(5,1),C41,S51,C51);
FA16: full_adder port map(XY(4,2),XY(3,3),C42,S52,C52);
FA17: full_adder port map(XY(2,4),XY(1,5),C43,S53,C53);
FA18: full_adder port map(XY(0,6),S51,C44,S54,C54);
FA19: full_adder port map(S52,S53,C45,S55,C55);
FA20: full_adder port map(S54,S55,'0',P(6),C56);
FA21: full_adder port map(XY(7,0),XY(6,1),C51,S61,C61);
FA22: full_adder port map(XY(5,2),XY(4,3),C52,S62,C62);
FA23: full_adder port map(XY(3,4),XY(2,5),C53,S63,C63);
FA24: full_adder port map(XY(1,6),XY(0,7),C54,S64,C64);
FA25: full_adder port map(S61,S62,C55,S65,C65);
FA26: full_adder port map(S63,S64,C56,S66,C66);
FA27: full_adder port map(S65,S66,'0',P(7),C67);
21. 21
FA28: full_adder port map(XY(7,1),XY(6,2),C61,S71,C71);
FA29: full_adder port map(XY(5,3),XY(4,4),C62,S72,C72);
FA30: full_adder port map(XY(3,5),XY(2,6),C63,S73,C73);
FA31 : full_adder port map(XY(1,7),S71,C64,S74,C74);
FA32: full_adder port map(S72,S73,C65,S75,C75);
FA33: full_adder port map(S74,S75,C66,S76,C76);
FA34: full_adder port map(S76,'0',C67,q(0),C77);
FA35: full_adder port map(XY(7,2),XY(6,3),C71,S81,C81);
FA36: full_adder port map(XY(5,4),XY(4,5),C72,S82,C82);
FA37: full_adder port map(XY(3,6),XY(2,7),C73,S83,C83);
FA38: full_adder port map(S81,C74,C75,S84,C84);
FA39: full_adder port map(S82,S83,C76,S85,C85);
FA40: full_adder port map(S84,S85,C77,q(1),C86);
FA41: full_adder port map(XY(7,3),XY(6,4),C81,S91,C91);
FA42: full_adder port map(XY(5,5),XY(4,6),C82,S92,C92);
FA43: full_adder port map(XY(3,7),S91,C83,S93,C93);
FA44: full_adder port map(S92,S93,C84,S94,C94);
FA45: full_adder port map(S94,C85,C86,q(2),C95);
FA46: full_adder port map(XY(7,4),XY(6,5),C91,S101,C101);
FA47: full_adder port map(XY(5,6),XY(4,7),C92,S102,C102);
FA48: full_adder port map(S101,C93,C94,S103,C103);
FA49: full_adder port map(S102,S103,C95,q(3),C104);
FA50: full_adder port map(XY(7,5),XY(6,6),C101,S111,C111);
FA51: full_adder port map(XY(5,7),S111,C102,S112,C112);
FA52: full_adder port map(S112,C103,C104,q(4),C113);
FA53: full_adder port map(XY(7,6),C111,C112,S121,C121);
FA54: full_adder port map(XY(6,7),S121,C113,q(5),C122);
FA55: full_adder port map(XY(7,7),C121,C122,q(6),q(7));
P(0) <= XY(0,0);
end Behavioral;
DIVIDER
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity divider8 is
Port ( Ain : in STD_LOGIC_VECTOR (07 downto 0);
Bin : in STD_LOGIC_VECTOR (07 downto 0);
Q : out STD_LOGIC_VECTOR (07 downto 0);
22. 22
R : out STD_LOGIC_VECTOR (07 downto 0));
end divider8;
architecture Behavioral of divider8 is
begin
proc1 : process(Ain , Bin)
variable Atemp : std_logic_vector (7 downto 0);
variable count : std_logic_vector (7 downto 0) ;
begin
if( Ain < Bin)then
count :="00000000";
Atemp := Ain ;
elsif ( Ain = Bin ) then
count :="00000001";
Atemp :="00000000";
elsif ( Ain > Bin )then
count := "00000001" ;
Atemp := Ain-Bin ;
--wait for 0 ns;
while (Atemp >= Bin) loop
if(Atemp >= Bin)then
Atemp := Atemp-Bin ;
count := count + 1 ;
end if;
end loop ;
end if ;
Q <= count ;
R <= Atemp ;
--wait on Ain, Bin ;
end process proc1;
end Behavioral;
AND GATE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity and_gate is
Port ( a : in STD_LOGIC_VECTOR (07 downto 0);
b : in STD_LOGIC_VECTOR (07 downto 0);
23. 23
y : out STD_LOGIC_VECTOR (07 downto 0));
end and_gate;
architecture Behavioral of and_gate is
begin
y <= a and b;
end Behavioral;
OR GATE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity or_gate is
Port ( a : in STD_LOGIC_VECTOR (07 downto 0);
b : in STD_LOGIC_VECTOR (07 downto 0);
y : out STD_LOGIC_VECTOR (07 downto 0));
end or_gate;
architecture Behavioral of or_gate is
begin
y <=a or b ;
end Behavioral;
NOT GATE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity not_gate is
Port ( y : in STD_LOGIC_VECTOR (07 downto 0);
z : out STD_LOGIC_VECTOR (07 downto 0));
end not_gate;
architecture Behavioral of not_gate is
begin
z <= not y;
24. 24
end Behavioral;
EX-OR GATE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity exor is
Port ( a : in STD_LOGIC_VECTOR (07 downto 0);
b : in STD_LOGIC_VECTOR (07 downto 0);
y : out STD_LOGIC_VECTOR (07 downto 0));
end exor;
architecture Behavioral of exor is
begin
y <= a xor b;
end Behavioral;
EX-NOR GATE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity exnor is
Port ( a : in STD_LOGIC_VECTOR (07 downto 0);
b : in STD_LOGIC_VECTOR (07 downto 0);
y : out STD_LOGIC_VECTOR (07 downto 0));
end exnor;
architecture Behavioral of exnor is
begin
y <= a xnor b;
end Behavioral;
NAND GATE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
25. 25
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity nand_gate is
Port ( a : in STD_LOGIC_VECTOR (07 downto 0);
b : in STD_LOGIC_VECTOR (07 downto 0);
y : out STD_LOGIC_VECTOR (07 downto 0));
end nand_gate;
architecture Behavioral of nand_gate is
begin
y <= a nand b;
end Behavioral;
NOR GATE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity nor_gate is
Port ( a : in STD_LOGIC_VECTOR (07 downto 0);
b : in STD_LOGIC_VECTOR (07 downto 0);
y : out STD_LOGIC_VECTOR (07 downto 0));
end nor_gate;
architecture Behavioral of nor_gate is
begin
y <= a nor b;
end Behavioral;
MUX 16: 1
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity mux is
Port ( a : in STD_LOGIC_VECTOR (7 downto 0);
b : in STD_LOGIC_VECTOR (7 downto 0);
e : in STD_LOGIC_VECTOR (7 downto 0);
f : in STD_LOGIC_VECTOR (7 downto 0);
26. 26
g : in STD_LOGIC_VECTOR (7 downto 0);
h : in STD_LOGIC_VECTOR (7 downto 0);
i : in STD_LOGIC_VECTOR (7 downto 0);
j : in STD_LOGIC_VECTOR (7 downto 0);
k : in STD_LOGIC_VECTOR (7 downto 0);
l : in STD_LOGIC_VECTOR (7 downto 0);
m : in STD_LOGIC_VECTOR (7 downto 0);
n : in STD_LOGIC_VECTOR (7 downto 0);
o : in STD_LOGIC_VECTOR (7 downto 0);
p : in STD_LOGIC_VECTOR (7 downto 0);
q : in STD_LOGIC_VECTOR (7 downto 0);
r : in STD_LOGIC_VECTOR (7 downto 0);
s : in STD_LOGIC_VECTOR (3 downto 0);
y : out STD_LOGIC_vector(7 downto 0));
end mux;
architecture Behavioral of mux is
begin
process (s)
begin
case s is
when "0000" => y <= a;
when "0001" => y <= b;
when "0010" => y <= e;
when "0011" => y <= f;
when "0100" => y <= g;
when "0101" => y <= h;
when "0110" => y <= i;
when "0111" => y <= j;
when "1000" => y <= k;
when "1001" => y <= l;
when "1010" => y <= m;
when "1011" => y <= n;
when "1100" => y <= o;
when "1101" => y <= p;
when "1110" => y <= q;
when others => y <= r;
end case;
end process;
end Behavioral;
MAIN PROGRAM
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
27. 27
entity DIGITAL_CALCULATOR is
Port ( c : in STD_LOGIC_VECTOR (07 downto 0);
d : in STD_LOGIC_VECTOR (07 downto 0);
cin : in STD_LOGIC;
sel : in STD_LOGIC_VECTOR (03 downto 0);
y : out STD_LOGIC_VECTOR (07 downto 0));
end DIGITAL_CALCULATOR;
architecture Behavioral of DIGITAL_CALCULATOR is
component same is
Port ( x : in STD_LOGIC_VECTOR (7 downto 0);
z : out STD_LOGIC_VECTOR (7 downto 0));
end component;
component adder is
Port ( a : in STD_LOGIC_VECTOR (07 downto 0);
b : in STD_LOGIC_VECTOR (07 downto 0);
cin : in STD_LOGIC;
cout : out STD_LOGIC_VECTOR (07 downto 0);
s : out STD_LOGIC_VECTOR (07 downto 0));
end component ;
component subtractor is
Port ( a : in STD_LOGIC_VECTOR (07 downto 0);
b : in STD_LOGIC_VECTOR (07 downto 0);
cin : in STD_LOGIC;
cout : out STD_LOGIC_VECTOR (07 downto 0);
s : out STD_LOGIC_VECTOR (07 downto 0));
end component ;
component not_gate is
Port ( y : in STD_LOGIC_VECTOR (07 downto 0);
z : out STD_LOGIC_VECTOR (07 downto 0));
end component;
component and_gate is
Port ( a : in STD_LOGIC_VECTOR (07 downto 0);
b : in STD_LOGIC_VECTOR (07 downto 0);
y : out STD_LOGIC_VECTOR (07 downto 0));
end component;
component or_gate is
Port ( a : in STD_LOGIC_VECTOR (07 downto 0);
b : in STD_LOGIC_VECTOR (07 downto 0);
28. 28
y : out STD_LOGIC_VECTOR (07 downto 0));
end component;
component nand_gate is
Port ( a : in STD_LOGIC_VECTOR (07 downto 0);
b : in STD_LOGIC_VECTOR (07 downto 0);
y : out STD_LOGIC_VECTOR (07 downto 0));
end component;
component divider8 is
Port ( Ain : in STD_LOGIC_VECTOR (07 downto 0);
Bin : in STD_LOGIC_VECTOR (07 downto 0);
Q : out STD_LOGIC_VECTOR (07 downto 0);
R : out STD_LOGIC_VECTOR (07 downto 0));
end component;
component multiplier8bit is
Port ( x : in STD_LOGIC_VECTOR (07 downto 0);
y : in STD_LOGIC_VECTOR (07 downto 0);
q : out STD_LOGIC_VECTOR (07 downto 0);
P : out STD_LOGIC_VECTOR (07 downto 0));
end component;
component nor_gate is
Port ( a : in STD_LOGIC_VECTOR (07 downto 0);
b : in STD_LOGIC_VECTOR (07 downto 0);
y : out STD_LOGIC_VECTOR (07 downto 0));
end component;
component exor is
Port ( a : in STD_LOGIC_VECTOR (07 downto 0);
b : in STD_LOGIC_VECTOR (07 downto 0);
y : out STD_LOGIC_VECTOR (07 downto 0));
end component;
component exnor is
Port ( a : in STD_LOGIC_VECTOR (07 downto 0);
b : in STD_LOGIC_VECTOR (07 downto 0);
y : out STD_LOGIC_VECTOR (07 downto 0));
end component;
component mux is
Port ( a : in STD_LOGIC_VECTOR (7 downto 0);
b : in STD_LOGIC_VECTOR (7 downto 0);
e : in STD_LOGIC_VECTOR (7 downto 0);
29. 29
f : in STD_LOGIC_VECTOR (7 downto 0);
g : in STD_LOGIC_VECTOR (7 downto 0);
h : in STD_LOGIC_VECTOR (7 downto 0);
i : in STD_LOGIC_VECTOR (7 downto 0);
j : in STD_LOGIC_VECTOR (7 downto 0);
k : in STD_LOGIC_VECTOR (7 downto 0);
l : in STD_LOGIC_VECTOR (7 downto 0);
m : in STD_LOGIC_VECTOR (7 downto 0);
n : in STD_LOGIC_VECTOR (7 downto 0);
o : in STD_LOGIC_VECTOR (7 downto 0);
p : in STD_LOGIC_VECTOR (7 downto 0);
q : in STD_LOGIC_VECTOR (7 downto 0);
r : in STD_LOGIC_VECTOR (7 downto 0);
s : in STD_LOGIC_VECTOR (3 downto 0);
--x : in STD_LOGIC_VECTOR (7 downto 0);
y : out STD_LOGIC_vector(7 downto 0));
end component;
signal a1: STD_LOGIC_VECTOR (7 downto 0);
signal b1 : STD_LOGIC_VECTOR (7 downto 0);
signal e1 : STD_LOGIC_VECTOR (7 downto 0);
signal f1 : STD_LOGIC_VECTOR (7 downto 0);
signal g1 : STD_LOGIC_VECTOR (7 downto 0);
signal h1 : STD_LOGIC_VECTOR (7 downto 0);
signal i1 : STD_LOGIC_VECTOR (7 downto 0);
signal j1 : STD_LOGIC_VECTOR (7 downto 0);
signal k1 : STD_LOGIC_VECTOR (7 downto 0);
signal l1 : STD_LOGIC_VECTOR (7 downto 0);
signal m1 : STD_LOGIC_VECTOR (7 downto 0);
signal n1 : STD_LOGIC_VECTOR (7 downto 0);
signal o1 : STD_LOGIC_VECTOR (7 downto 0);
signal p1 : STD_LOGIC_VECTOR (7 downto 0);
signal q1 : STD_LOGIC_VECTOR (7 downto 0);
30. 30
signal r1 : STD_LOGIC_VECTOR (7 downto 0);
--signal x1 : STD_LOGIC_VECTOR (7 downto 0);
begin
z1: same port map(c,a1);
a2: adder port map(c,d,cin,b1,e1);
a3: subtractor port map(c,d,cin,f1,g1);
a4: multiplier8bit port map(c,d,h1,i1);
a5: divider8 port map(c,d,j1,k1);
a6: and_gate port map(c,d,l1);
a7: or_gate port map(c,d,m1);
a8: not_gate port map(c,n1);
a10: exor port map(c,d,o1);
a11: exnor port map(c,d,p1);
a12: nand_gate port map(c,d,q1);
a13: nor_gate port map(c,d,r1);
a14: mux port map(a1,b1,e1,f1,g1,h1,i1,j1,k1,l1,m1,n1,o1,p1,q1,r1,sel,y);
end Behavioral;
TEST BENCH
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_unsigned.all;
USE ieee.numeric_std.ALL;
ENTITY alu_tb11_vhd IS
END alu_tb11_vhd;
ARCHITECTURE behavior OF alu_tb11_vhd IS
-- Component Declaration for the Unit Under Test (UUT)
COMPONENT DIGITAL_CALCULATOR
PORT(
c : IN std_logic_vector(7 downto 0);
d : IN std_logic_vector(7 downto 0);
cin : IN std_logic;
sel : IN std_logic_vector(3 downto 0);
y : OUT std_logic_vector(7 downto 0)
);
END COMPONENT;
--Inputs
SIGNAL cin : std_logic := '0';
SIGNAL c : std_logic_vector(7 downto 0) := (others=>'0');
SIGNAL d : std_logic_vector(7 downto 0) := (others=>'0');
SIGNAL sel : std_logic_vector(3 downto 0) := (others=>'0');
31. 31
--Outputs
SIGNAL y : std_logic_vector(7 downto 0);
BEGIN
-- Instantiate the Unit Under Test (UUT)
uut: DIGITAL_CALCULATOR PORT MAP(
c => c,
d => d,
cin => cin,
sel => sel,
y => y
);
tb : PROCESS
BEGIN
--wait for 20 ns;
c<="11111111";
d<="11111111";
cin<='0';
-- wait for 01 ns;
sel<="0000";
wait for 20 ns;
sel<="0001";
wait for 40 ns;
sel<="0010";
wait for 40 ns;
sel<="0011";
wait for 40 ns;
sel<="0100";
wait for 40 ns;
sel<="0101";
wait for 40 ns;
sel<="0110";
wait for 40 ns;
sel<="0111";
wait for 40 ns;
sel<="1000";
wait for 40 ns;
sel<="1001";
wait for 40 ns;
sel<="1010";
wait for 40 ns;
sel<="1011";
wait for 40 ns;
sel<="1100";
32. 32
wait for 40 ns;
sel<="1101";
wait for 40 ns;
sel<="1110";
wait for 40 ns;
sel<="1111";
wait for 40 ns;
sel<="0000";
wait for 40 ns;
--wait; -- will wait forever
END PROCESS;
SEND ;
40. 40
ALU is used digital electronics .
ALU is used to perform arithmetic and logical operations.
ALU is fundamental building block of the central processing unit .
ALU is also used in Microprocessors and Microcontroller .
ALU is also used in Calculators.
42. 42
In this project, we obtained more experience with designing a
code using VHDL and how to program a FPGA. Moreover, we
learn more fundamental principles of designing digital systems.
In summary, this project is a good software hardware co-design
practice.
44. 44
Books:
Text Books
1. Fundamentals of Digital Logic with VHDL design ; Stephen Brown,
Zvonko Vranesic ;TMH.
2. VHDL Primer ; J Bhasker ; Pearson Education.
3. VHDL-a Design Oriented Approach; S. S. Limaye;
1. Digital System Design Using VHDL ; Charles H. Roth; Thomson.
2. VHDL Synthesis Primer; J Bhasker; Prentice Hall.
3. VHDL Modular Design and Synthesis of Cores and System ;
Zainalabedin Navabi; McGraw Hill Professional.
Websites :
http://www.xilinx.com
http://www.wikipedia.org