SlideShare uma empresa Scribd logo
1 de 11
Implementation of ALU in
Verilog
Design an 8-bit ALU in Verilog which performs following
operations.
AND
OR
XOR
NOT
NAND
NOR
A+B
A-B
Logical shift left
Logical shift right
Comparison (A>B, A<B, A=B)
Also write its Test Fixture.
You have to submit project report in proper format. Your report
includes description of ALU and all operations, Verilog module
code, Verilog Test Fixture code, Synthesize report and figures of
Test Fixture waveform. Last date for report submission and viva
is 17th
May 2013.
Good Luck 
Verilog module code
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 23:18:01 05/12/2013
// Design Name:
// Module Name: Eight_bit_alu
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module Eight_bit_alu(A,B,operation,out,flag_greater,flag_less,flag_equal);
output [7:0]out;
input[7:0]A,B;
input[3:0]operation;
output flag_greater,flag_less,flag_equal;
reg flag_greater,flag_less,flag_equal;
reg [7:0] out;
always @(operation or A or B)
begin
if(operation==4'b0000)
out=A+B;
else if(operation==4'b0001)
out=A-B;
else if(operation==4'b0010)
out=A&B;
else if(operation==4'b0011)
out=A|B;
else if(operation==4'b0100)
out=A^B;
else if(operation==4'b0101)
out=~A;
else if(operation==4'b0110)
out=~(A&B);
else if(operation==4'b0111)
out=~(A|B);
else if(operation==4'b1000)
out=A>>B;
else if(operation==4'b1001)
out=A<<B;
if(A==B)
flag_equal=1;
else
flag_equal=0;
if(A<B)
flag_less=1;
else
flag_less=0;
if(A>B)
flag_greater=1;
else
flag_greater=0;
end
endmodule
Text fixture code:
` `timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 02:03:52 05/16/2013
// Design Name: Eight_bit_alu
// Module Name: D:/ayeen/Eight_bit.v
// Project Name: ayeen
// Target Device:
// Tool versions:
// Description:
//
// Verilog Test Fixture created by ISE for module: Eight_bit_alu
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
////////////////////////////////////////////////////////////////////////////////
module Eight_bit;
// Inputs
reg [7:0] A;
reg [7:0] B;
reg [3:0] operation;
// Outputs
wire [7:0] out;
wire flag_greater;
wire flag_less;
wire flag_equal;
// Instantiate the Unit Under Test (UUT)
Eight_bit_alu uut (
.A(A),
.B(B),
.operation(operation),
.out(out),
.flag_greater(flag_greater),
.flag_less(flag_less),
.flag_equal(flag_equal)
);
initial begin
// Initialize Inputs
A = 1;
B = 0;
operation = 0;
// Wait 100 ns for global reset to finish
#100;
A = 1;
B = 0;
operation = 1;
// Wait 100 ns for global reset to finish
#100;
A = 1;
B = 0;
operation = 2;
// Wait 100 ns for global reset to finish
#100;
A = 1;
B = 0;
operation = 3;
// Wait 100 ns for global reset to finish
#100;
A = 1;
B = 0;
operation = 4;
// Wait 100 ns for global reset to finish
#100;
// Add stimulus here
A = 1;
B = 0;
operation = 5;
// Wait 100 ns for global reset to finish
#100;
A = 1;
B = 0;
operation = 6;
// Wait 100 ns for global reset to finish
#100;
A = 1;
B = 0;
operation = 6;
// Wait 100 ns for global reset to finish
#100;
A = 1;
B = 0;
operation = 7;
// Wait 100 ns for global reset to finish
#100;
A = 1;
B = 0;
operation = 8;
// Wait 100 ns for global reset to finish
#100;
A = 1;
B = 0;
operation = 9;
// Wait 100 ns for global reset to finish
#100;
end
endmodule
simulation

Mais conteúdo relacionado

Mais procurados

Embedded system design psoc lab report
Embedded system design psoc lab reportEmbedded system design psoc lab report
Embedded system design psoc lab reportRamesh Naik Bhukya
 
Digital system design practical file
Digital system design practical fileDigital system design practical file
Digital system design practical fileArchita Misra
 
All VLSI programs
All VLSI programsAll VLSI programs
All VLSI programsGouthaman V
 
Vlsilab13
Vlsilab13Vlsilab13
Vlsilab13Krish s
 
Sequential Logic Circuits
Sequential Logic CircuitsSequential Logic Circuits
Sequential Logic CircuitsDilum Bandara
 
Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9
Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9
Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9Irfan Qadoos
 
Experiment write-vhdl-code-for-realize-all-logic-gates
Experiment write-vhdl-code-for-realize-all-logic-gatesExperiment write-vhdl-code-for-realize-all-logic-gates
Experiment write-vhdl-code-for-realize-all-logic-gatesRicardo Castro
 
Functions for Nano 5 Card
Functions for Nano 5 CardFunctions for Nano 5 Card
Functions for Nano 5 CardOmar Sanchez
 
Temperature sensor with a led matrix display (arduino controlled)
Temperature sensor with a led matrix display (arduino controlled)Temperature sensor with a led matrix display (arduino controlled)
Temperature sensor with a led matrix display (arduino controlled)TechLeap
 
Verilog full adder in dataflow & gate level modelling style.
Verilog full adder in dataflow  & gate level modelling style.Verilog full adder in dataflow  & gate level modelling style.
Verilog full adder in dataflow & gate level modelling style.Omkar Rane
 
Dsd lab Practical File
Dsd lab Practical FileDsd lab Practical File
Dsd lab Practical FileSoumya Behera
 
Lec3 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMO...
Lec3 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMO...Lec3 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMO...
Lec3 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMO...Hsien-Hsin Sean Lee, Ph.D.
 
Day2 Verilog HDL Basic
Day2 Verilog HDL BasicDay2 Verilog HDL Basic
Day2 Verilog HDL BasicRon Liu
 
Digital system design lab manual
Digital system design lab manualDigital system design lab manual
Digital system design lab manualSanthosh Poralu
 
Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters
Eceg 3201-dld-lec 11-registers_and_asynchoronous_countersEceg 3201-dld-lec 11-registers_and_asynchoronous_counters
Eceg 3201-dld-lec 11-registers_and_asynchoronous_countersNebiyu Musie
 

Mais procurados (20)

VERILOG CODE
VERILOG CODEVERILOG CODE
VERILOG CODE
 
Embedded system design psoc lab report
Embedded system design psoc lab reportEmbedded system design psoc lab report
Embedded system design psoc lab report
 
Digital system design practical file
Digital system design practical fileDigital system design practical file
Digital system design practical file
 
All VLSI programs
All VLSI programsAll VLSI programs
All VLSI programs
 
Vlsilab13
Vlsilab13Vlsilab13
Vlsilab13
 
Sequential Logic Circuits
Sequential Logic CircuitsSequential Logic Circuits
Sequential Logic Circuits
 
Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9
Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9
Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9
 
Experiment write-vhdl-code-for-realize-all-logic-gates
Experiment write-vhdl-code-for-realize-all-logic-gatesExperiment write-vhdl-code-for-realize-all-logic-gates
Experiment write-vhdl-code-for-realize-all-logic-gates
 
Functions for Nano 5 Card
Functions for Nano 5 CardFunctions for Nano 5 Card
Functions for Nano 5 Card
 
Temperature sensor with a led matrix display (arduino controlled)
Temperature sensor with a led matrix display (arduino controlled)Temperature sensor with a led matrix display (arduino controlled)
Temperature sensor with a led matrix display (arduino controlled)
 
Verilog full adder in dataflow & gate level modelling style.
Verilog full adder in dataflow  & gate level modelling style.Verilog full adder in dataflow  & gate level modelling style.
Verilog full adder in dataflow & gate level modelling style.
 
FYP_DCS_seminar
FYP_DCS_seminarFYP_DCS_seminar
FYP_DCS_seminar
 
Dsd lab Practical File
Dsd lab Practical FileDsd lab Practical File
Dsd lab Practical File
 
Vhdl lab manual
Vhdl lab manualVhdl lab manual
Vhdl lab manual
 
VHDL Programs
VHDL ProgramsVHDL Programs
VHDL Programs
 
Lec3 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMO...
Lec3 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMO...Lec3 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMO...
Lec3 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMO...
 
Day2 Verilog HDL Basic
Day2 Verilog HDL BasicDay2 Verilog HDL Basic
Day2 Verilog HDL Basic
 
Digital system design lab manual
Digital system design lab manualDigital system design lab manual
Digital system design lab manual
 
VLSI lab manual
VLSI lab manualVLSI lab manual
VLSI lab manual
 
Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters
Eceg 3201-dld-lec 11-registers_and_asynchoronous_countersEceg 3201-dld-lec 11-registers_and_asynchoronous_counters
Eceg 3201-dld-lec 11-registers_and_asynchoronous_counters
 

Destaque

ECE_467_Final_Project_Report
ECE_467_Final_Project_ReportECE_467_Final_Project_Report
ECE_467_Final_Project_ReportSidharth Kumar
 
Designing of 8 BIT Arithmetic and Logical Unit and implementing on Xilinx Ver...
Designing of 8 BIT Arithmetic and Logical Unit and implementing on Xilinx Ver...Designing of 8 BIT Arithmetic and Logical Unit and implementing on Xilinx Ver...
Designing of 8 BIT Arithmetic and Logical Unit and implementing on Xilinx Ver...Rahul Borthakur
 
FPGA Verilog Processor Design
FPGA Verilog Processor DesignFPGA Verilog Processor Design
FPGA Verilog Processor DesignArchana Udaranga
 
verilog code for logic gates
verilog code for logic gatesverilog code for logic gates
verilog code for logic gatesRakesh kumar jha
 
Verilog codes and testbench codes for basic digital electronic circuits.
Verilog codes and testbench codes for basic digital electronic circuits. Verilog codes and testbench codes for basic digital electronic circuits.
Verilog codes and testbench codes for basic digital electronic circuits. shobhan pujari
 
8 bit single cycle processor
8 bit single cycle processor8 bit single cycle processor
8 bit single cycle processorDhaval Kaneria
 
Design and implementation of 32 bit alu using verilog
Design and implementation of 32 bit alu using verilogDesign and implementation of 32 bit alu using verilog
Design and implementation of 32 bit alu using verilogSTEPHEN MOIRANGTHEM
 

Destaque (10)

8 bit alu design
8 bit alu design8 bit alu design
8 bit alu design
 
ECE_467_Final_Project_Report
ECE_467_Final_Project_ReportECE_467_Final_Project_Report
ECE_467_Final_Project_Report
 
8 bit alu design
8 bit alu design8 bit alu design
8 bit alu design
 
Designing of 8 BIT Arithmetic and Logical Unit and implementing on Xilinx Ver...
Designing of 8 BIT Arithmetic and Logical Unit and implementing on Xilinx Ver...Designing of 8 BIT Arithmetic and Logical Unit and implementing on Xilinx Ver...
Designing of 8 BIT Arithmetic and Logical Unit and implementing on Xilinx Ver...
 
FPGA Verilog Processor Design
FPGA Verilog Processor DesignFPGA Verilog Processor Design
FPGA Verilog Processor Design
 
verilog code for logic gates
verilog code for logic gatesverilog code for logic gates
verilog code for logic gates
 
Verilog codes and testbench codes for basic digital electronic circuits.
Verilog codes and testbench codes for basic digital electronic circuits. Verilog codes and testbench codes for basic digital electronic circuits.
Verilog codes and testbench codes for basic digital electronic circuits.
 
8 bit single cycle processor
8 bit single cycle processor8 bit single cycle processor
8 bit single cycle processor
 
Design and implementation of 32 bit alu using verilog
Design and implementation of 32 bit alu using verilogDesign and implementation of 32 bit alu using verilog
Design and implementation of 32 bit alu using verilog
 
Programs of VHDL
Programs of VHDLPrograms of VHDL
Programs of VHDL
 

Semelhante a Alu description[1]

vlsi design using verilog presentaion 1
vlsi design using verilog   presentaion 1vlsi design using verilog   presentaion 1
vlsi design using verilog presentaion 1MANDHASAIGOUD1
 
Verilog Lecture2 thhts
Verilog Lecture2 thhtsVerilog Lecture2 thhts
Verilog Lecture2 thhtsBéo Tú
 
Vlsi lab manual exp:1
Vlsi lab manual exp:1Vlsi lab manual exp:1
Vlsi lab manual exp:1komala vani
 
Implementing of classical synchronization problem by using semaphores
Implementing of classical synchronization problem by using semaphoresImplementing of classical synchronization problem by using semaphores
Implementing of classical synchronization problem by using semaphoresGowtham Reddy
 
Composing an App with Free Monads (using Cats)
Composing an App with Free Monads (using Cats)Composing an App with Free Monads (using Cats)
Composing an App with Free Monads (using Cats)Hermann Hueck
 
Verilog TASKS & FUNCTIONS
Verilog TASKS & FUNCTIONSVerilog TASKS & FUNCTIONS
Verilog TASKS & FUNCTIONSDr.YNM
 
SKEL 4273 CAD with HDL Topic 2
SKEL 4273 CAD with HDL Topic 2SKEL 4273 CAD with HDL Topic 2
SKEL 4273 CAD with HDL Topic 2alhadi81
 
Building Hierarchy
Building HierarchyBuilding Hierarchy
Building HierarchyMohamed Samy
 
A Verilog HDL Test Bench Primer
A Verilog HDL Test Bench PrimerA Verilog HDL Test Bench Primer
A Verilog HDL Test Bench PrimerNicole Heredia
 
Verilog Lecture4 2014
Verilog Lecture4 2014Verilog Lecture4 2014
Verilog Lecture4 2014Béo Tú
 
Verilog Tasks & Functions
Verilog Tasks & FunctionsVerilog Tasks & Functions
Verilog Tasks & Functionsanand hd
 
DeVry GSP 115 All Assignments latest
DeVry GSP 115 All Assignments latestDeVry GSP 115 All Assignments latest
DeVry GSP 115 All Assignments latestAtifkhilji
 
Unit testing in iOS featuring OCUnit, GHUnit & OCMock
Unit testing in iOS featuring OCUnit, GHUnit & OCMockUnit testing in iOS featuring OCUnit, GHUnit & OCMock
Unit testing in iOS featuring OCUnit, GHUnit & OCMockRobot Media
 

Semelhante a Alu description[1] (20)

vlsi design using verilog presentaion 1
vlsi design using verilog   presentaion 1vlsi design using verilog   presentaion 1
vlsi design using verilog presentaion 1
 
Verilog Lecture2 thhts
Verilog Lecture2 thhtsVerilog Lecture2 thhts
Verilog Lecture2 thhts
 
Verilog hdl
Verilog hdlVerilog hdl
Verilog hdl
 
Fpga 04-verilog-programming
Fpga 04-verilog-programmingFpga 04-verilog-programming
Fpga 04-verilog-programming
 
Verilog tutorial
Verilog tutorialVerilog tutorial
Verilog tutorial
 
Verilog tutorial
Verilog tutorialVerilog tutorial
Verilog tutorial
 
Vlsi lab manual exp:1
Vlsi lab manual exp:1Vlsi lab manual exp:1
Vlsi lab manual exp:1
 
Sankula
SankulaSankula
Sankula
 
Implementing of classical synchronization problem by using semaphores
Implementing of classical synchronization problem by using semaphoresImplementing of classical synchronization problem by using semaphores
Implementing of classical synchronization problem by using semaphores
 
verilog
verilogverilog
verilog
 
Verilog lab mauual
Verilog lab mauualVerilog lab mauual
Verilog lab mauual
 
Composing an App with Free Monads (using Cats)
Composing an App with Free Monads (using Cats)Composing an App with Free Monads (using Cats)
Composing an App with Free Monads (using Cats)
 
Verilog TASKS & FUNCTIONS
Verilog TASKS & FUNCTIONSVerilog TASKS & FUNCTIONS
Verilog TASKS & FUNCTIONS
 
SKEL 4273 CAD with HDL Topic 2
SKEL 4273 CAD with HDL Topic 2SKEL 4273 CAD with HDL Topic 2
SKEL 4273 CAD with HDL Topic 2
 
Building Hierarchy
Building HierarchyBuilding Hierarchy
Building Hierarchy
 
A Verilog HDL Test Bench Primer
A Verilog HDL Test Bench PrimerA Verilog HDL Test Bench Primer
A Verilog HDL Test Bench Primer
 
Verilog Lecture4 2014
Verilog Lecture4 2014Verilog Lecture4 2014
Verilog Lecture4 2014
 
Verilog Tasks & Functions
Verilog Tasks & FunctionsVerilog Tasks & Functions
Verilog Tasks & Functions
 
DeVry GSP 115 All Assignments latest
DeVry GSP 115 All Assignments latestDeVry GSP 115 All Assignments latest
DeVry GSP 115 All Assignments latest
 
Unit testing in iOS featuring OCUnit, GHUnit & OCMock
Unit testing in iOS featuring OCUnit, GHUnit & OCMockUnit testing in iOS featuring OCUnit, GHUnit & OCMock
Unit testing in iOS featuring OCUnit, GHUnit & OCMock
 

Último

Sicily Holidays Guide Book: Unveiling the Treasures of Italy's Jewel
Sicily Holidays Guide Book: Unveiling the Treasures of Italy's JewelSicily Holidays Guide Book: Unveiling the Treasures of Italy's Jewel
Sicily Holidays Guide Book: Unveiling the Treasures of Italy's JewelTime for Sicily
 
Phil....National-Capital-Region-NCR.pptx
Phil....National-Capital-Region-NCR.pptxPhil....National-Capital-Region-NCR.pptx
Phil....National-Capital-Region-NCR.pptxDitasDelaCruz
 
a presentation for foreigners about how to travel in Germany.
a presentation for foreigners about how to travel in Germany.a presentation for foreigners about how to travel in Germany.
a presentation for foreigners about how to travel in Germany.moritzmieg
 
How Safe Is It To Witness Whales In Maui’s Waters
How Safe Is It To Witness Whales In Maui’s WatersHow Safe Is It To Witness Whales In Maui’s Waters
How Safe Is It To Witness Whales In Maui’s WatersMakena Coast Charters
 
Paragliding Billing Bir at Himachal Pardesh
Paragliding Billing Bir at Himachal PardeshParagliding Billing Bir at Himachal Pardesh
Paragliding Billing Bir at Himachal PardeshParagliding Billing Bir
 
Inspirational Quotes About Italy and Food
Inspirational Quotes About Italy and FoodInspirational Quotes About Italy and Food
Inspirational Quotes About Italy and FoodKasia Chojecki
 
question 2: airplane vocabulary presentation
question 2: airplane vocabulary presentationquestion 2: airplane vocabulary presentation
question 2: airplane vocabulary presentationcaminantesdaauga
 
It’s Time Get Refresh Travel Around The World
It’s Time Get Refresh Travel Around The WorldIt’s Time Get Refresh Travel Around The World
It’s Time Get Refresh Travel Around The WorldParagliding Billing Bir
 
Where to Stay in Lagos, Portugal.pptxasd
Where to Stay in Lagos, Portugal.pptxasdWhere to Stay in Lagos, Portugal.pptxasd
Where to Stay in Lagos, Portugal.pptxasdusmanghaniwixpatriot
 
Authentic Travel Experience 2024 Greg DeShields.pptx
Authentic Travel Experience 2024 Greg DeShields.pptxAuthentic Travel Experience 2024 Greg DeShields.pptx
Authentic Travel Experience 2024 Greg DeShields.pptxGregory DeShields
 
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)Mazie Garcia
 
Revolutionalizing Travel: A VacAI Update
Revolutionalizing Travel: A VacAI UpdateRevolutionalizing Travel: A VacAI Update
Revolutionalizing Travel: A VacAI Updatejoymorrison10
 
69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)
69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)
69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)Escort Service
 

Último (15)

Sicily Holidays Guide Book: Unveiling the Treasures of Italy's Jewel
Sicily Holidays Guide Book: Unveiling the Treasures of Italy's JewelSicily Holidays Guide Book: Unveiling the Treasures of Italy's Jewel
Sicily Holidays Guide Book: Unveiling the Treasures of Italy's Jewel
 
Phil....National-Capital-Region-NCR.pptx
Phil....National-Capital-Region-NCR.pptxPhil....National-Capital-Region-NCR.pptx
Phil....National-Capital-Region-NCR.pptx
 
a presentation for foreigners about how to travel in Germany.
a presentation for foreigners about how to travel in Germany.a presentation for foreigners about how to travel in Germany.
a presentation for foreigners about how to travel in Germany.
 
How Safe Is It To Witness Whales In Maui’s Waters
How Safe Is It To Witness Whales In Maui’s WatersHow Safe Is It To Witness Whales In Maui’s Waters
How Safe Is It To Witness Whales In Maui’s Waters
 
Paragliding Billing Bir at Himachal Pardesh
Paragliding Billing Bir at Himachal PardeshParagliding Billing Bir at Himachal Pardesh
Paragliding Billing Bir at Himachal Pardesh
 
Inspirational Quotes About Italy and Food
Inspirational Quotes About Italy and FoodInspirational Quotes About Italy and Food
Inspirational Quotes About Italy and Food
 
Enjoy ➥8448380779▻ Call Girls In Sector 62 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 62 Noida Escorts Delhi NCREnjoy ➥8448380779▻ Call Girls In Sector 62 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 62 Noida Escorts Delhi NCR
 
Enjoy ➥8448380779▻ Call Girls In Sector 74 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 74 Noida Escorts Delhi NCREnjoy ➥8448380779▻ Call Girls In Sector 74 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 74 Noida Escorts Delhi NCR
 
question 2: airplane vocabulary presentation
question 2: airplane vocabulary presentationquestion 2: airplane vocabulary presentation
question 2: airplane vocabulary presentation
 
It’s Time Get Refresh Travel Around The World
It’s Time Get Refresh Travel Around The WorldIt’s Time Get Refresh Travel Around The World
It’s Time Get Refresh Travel Around The World
 
Where to Stay in Lagos, Portugal.pptxasd
Where to Stay in Lagos, Portugal.pptxasdWhere to Stay in Lagos, Portugal.pptxasd
Where to Stay in Lagos, Portugal.pptxasd
 
Authentic Travel Experience 2024 Greg DeShields.pptx
Authentic Travel Experience 2024 Greg DeShields.pptxAuthentic Travel Experience 2024 Greg DeShields.pptx
Authentic Travel Experience 2024 Greg DeShields.pptx
 
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
 
Revolutionalizing Travel: A VacAI Update
Revolutionalizing Travel: A VacAI UpdateRevolutionalizing Travel: A VacAI Update
Revolutionalizing Travel: A VacAI Update
 
69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)
69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)
69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)
 

Alu description[1]

  • 1. Implementation of ALU in Verilog Design an 8-bit ALU in Verilog which performs following operations. AND OR XOR NOT NAND NOR A+B A-B Logical shift left Logical shift right Comparison (A>B, A<B, A=B) Also write its Test Fixture. You have to submit project report in proper format. Your report includes description of ALU and all operations, Verilog module code, Verilog Test Fixture code, Synthesize report and figures of Test Fixture waveform. Last date for report submission and viva is 17th May 2013.
  • 2. Good Luck  Verilog module code `timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 23:18:01 05/12/2013 // Design Name: // Module Name: Eight_bit_alu // Project Name: // Target Devices: // Tool versions: // Description: //
  • 3. // Dependencies: // // Revision: // Revision 0.01 - File Created // Additional Comments: // ////////////////////////////////////////////////////////////////////////////////// module Eight_bit_alu(A,B,operation,out,flag_greater,flag_less,flag_equal); output [7:0]out; input[7:0]A,B; input[3:0]operation; output flag_greater,flag_less,flag_equal; reg flag_greater,flag_less,flag_equal; reg [7:0] out; always @(operation or A or B) begin if(operation==4'b0000) out=A+B; else if(operation==4'b0001) out=A-B; else if(operation==4'b0010) out=A&B; else if(operation==4'b0011) out=A|B; else if(operation==4'b0100) out=A^B; else if(operation==4'b0101) out=~A;
  • 4. else if(operation==4'b0110) out=~(A&B); else if(operation==4'b0111) out=~(A|B); else if(operation==4'b1000) out=A>>B; else if(operation==4'b1001) out=A<<B; if(A==B) flag_equal=1; else flag_equal=0; if(A<B) flag_less=1; else flag_less=0; if(A>B) flag_greater=1; else flag_greater=0; end endmodule
  • 5. Text fixture code: ` `timescale 1ns / 1ps //////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 02:03:52 05/16/2013 // Design Name: Eight_bit_alu // Module Name: D:/ayeen/Eight_bit.v // Project Name: ayeen // Target Device: // Tool versions: // Description: // // Verilog Test Fixture created by ISE for module: Eight_bit_alu // // Dependencies: // // Revision: // Revision 0.01 - File Created // Additional Comments: // //////////////////////////////////////////////////////////////////////////////// module Eight_bit; // Inputs
  • 6. reg [7:0] A; reg [7:0] B; reg [3:0] operation; // Outputs wire [7:0] out; wire flag_greater; wire flag_less; wire flag_equal; // Instantiate the Unit Under Test (UUT) Eight_bit_alu uut ( .A(A), .B(B), .operation(operation), .out(out), .flag_greater(flag_greater), .flag_less(flag_less), .flag_equal(flag_equal) ); initial begin // Initialize Inputs A = 1; B = 0; operation = 0; // Wait 100 ns for global reset to finish #100;
  • 7. A = 1; B = 0; operation = 1; // Wait 100 ns for global reset to finish #100; A = 1; B = 0; operation = 2; // Wait 100 ns for global reset to finish #100; A = 1; B = 0; operation = 3; // Wait 100 ns for global reset to finish #100; A = 1; B = 0; operation = 4; // Wait 100 ns for global reset to finish #100; // Add stimulus here A = 1; B = 0;
  • 8. operation = 5; // Wait 100 ns for global reset to finish #100; A = 1; B = 0; operation = 6; // Wait 100 ns for global reset to finish #100; A = 1; B = 0; operation = 6; // Wait 100 ns for global reset to finish #100; A = 1; B = 0; operation = 7; // Wait 100 ns for global reset to finish #100; A = 1; B = 0; operation = 8; // Wait 100 ns for global reset to finish #100;
  • 9. A = 1; B = 0; operation = 9; // Wait 100 ns for global reset to finish #100; end endmodule
  • 10.