SlideShare ist ein Scribd-Unternehmen logo
1 von 4
Downloaden Sie, um offline zu lesen
Problem Description and Analysis
In this Laboratory, you will design and simulate a simple ALU in Quatrus II Verilog. The
description and specification of the ALU is given below:
An ALU is a logic circuit that performs various Boolean and arithmetic operations on n-bit
operands. This ALU has 2 four-bit data inputs, A and B, a three-bit select input, S, and a four-bit
output, F. The functionality of this simple ALU is specified in the table below.
Operation
Inputs
S
Outputs
F
s2
s1
s0
f3
f2
f1
f0
Clear
0
0
0
0
0
0
0
B - A
0
0
1
B – A
A – B
0
1
0
A – B
ADD
0
1
1
A + B
XOR
1
0
0
A XOR B
OR
1
1
0
A OR B
AND
1
1
0
A AND B
Preset
1
1
1
1
1
1
1
Table 1 – Functionality Table for ALU
Operation
Inputs
S
Outputs
F
s2
s1
s0
f3
f2
f1
f0
Clear
0
0
0
0
0
0
0
B - A
0
0
1
B – A
A – B
0
1
0
A – B
ADD
0
1
1
A + B
XOR
1
0
0
A XOR B
OR
1
1
0
A OR B
AND
1
1
0
A AND B
Preset
1
1
1
1
1
1
1
Solution
module alu(s, A, B, F);
input [2:0] S;
input [3:0] A, B;
output reg [3:0] F;
always @(S, A, B)
case (S)
0: F = 0000;
1: F = B - A;
2: F = A - B;
3: F = A + B;
4: F = A ^ B;
5: F = A | B;
6: F = A & B;
7: F = 1111;
endcase
endmodule

Weitere ähnliche Inhalte

Ähnlich wie Problem Description and AnalysisIn this Laboratory, you will desig.pdf

- Problem Design a simple ALU using VHDL capable of performing the o.pdf
 - Problem Design a simple ALU using VHDL capable of performing the o.pdf - Problem Design a simple ALU using VHDL capable of performing the o.pdf
- Problem Design a simple ALU using VHDL capable of performing the o.pdf
alliedelectronics
 

Ähnlich wie Problem Description and AnalysisIn this Laboratory, you will desig.pdf (20)

Admissions in india 2015
Admissions in india 2015Admissions in india 2015
Admissions in india 2015
 
PST SC015 Chapter 2 Computer System (III) 2017/2018
PST SC015 Chapter 2 Computer System (III) 2017/2018PST SC015 Chapter 2 Computer System (III) 2017/2018
PST SC015 Chapter 2 Computer System (III) 2017/2018
 
1,basic and derived logic gates.pdf
1,basic and derived logic gates.pdf1,basic and derived logic gates.pdf
1,basic and derived logic gates.pdf
 
Digital Logic circuit
Digital Logic circuitDigital Logic circuit
Digital Logic circuit
 
Lect3 organization 2
Lect3 organization 2Lect3 organization 2
Lect3 organization 2
 
Assignment#1b
Assignment#1bAssignment#1b
Assignment#1b
 
Mcsl 17 ALP lab manual
Mcsl 17 ALP lab manualMcsl 17 ALP lab manual
Mcsl 17 ALP lab manual
 
ECE 467 Final Project
ECE 467 Final Project ECE 467 Final Project
ECE 467 Final Project
 
Digital logic mohammed salim ch3
Digital logic mohammed salim ch3Digital logic mohammed salim ch3
Digital logic mohammed salim ch3
 
2 bit alu
2 bit alu2 bit alu
2 bit alu
 
Digital Electronics-Review of Logic Gates.pptx
Digital Electronics-Review of Logic Gates.pptxDigital Electronics-Review of Logic Gates.pptx
Digital Electronics-Review of Logic Gates.pptx
 
- Problem Design a simple ALU using VHDL capable of performing the o.pdf
 - Problem Design a simple ALU using VHDL capable of performing the o.pdf - Problem Design a simple ALU using VHDL capable of performing the o.pdf
- Problem Design a simple ALU using VHDL capable of performing the o.pdf
 
unit 3.pptx
unit 3.pptxunit 3.pptx
unit 3.pptx
 
Free video lectures for mca
Free video lectures for mcaFree video lectures for mca
Free video lectures for mca
 
Lab no 4
Lab no 4Lab no 4
Lab no 4
 
Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in india
 
12.Digital Logic.pdf
12.Digital Logic.pdf12.Digital Logic.pdf
12.Digital Logic.pdf
 
Combinational logic circuits design and implementation
Combinational logic circuits design and implementationCombinational logic circuits design and implementation
Combinational logic circuits design and implementation
 
Logic gates verification using universal gates
Logic gates verification using universal gatesLogic gates verification using universal gates
Logic gates verification using universal gates
 
BOOLEAN ALGEBRA AND LOGIC GATE
BOOLEAN ALGEBRA AND LOGIC GATE BOOLEAN ALGEBRA AND LOGIC GATE
BOOLEAN ALGEBRA AND LOGIC GATE
 

Mehr von ajantaopt

Problem 11-2Athe following are selected transactions of Blanco Com.pdf
Problem 11-2Athe following are selected transactions of Blanco Com.pdfProblem 11-2Athe following are selected transactions of Blanco Com.pdf
Problem 11-2Athe following are selected transactions of Blanco Com.pdf
ajantaopt
 
Problem 8-9A certain investment requires an initial outlay of $12 .pdf
Problem 8-9A certain investment requires an initial outlay of $12 .pdfProblem 8-9A certain investment requires an initial outlay of $12 .pdf
Problem 8-9A certain investment requires an initial outlay of $12 .pdf
ajantaopt
 
Problem 6. Bag 1 has 2 red chips and 4 white chips. Bag 2 has 3 red .pdf
Problem 6. Bag 1 has 2 red chips and 4 white chips. Bag 2 has 3 red .pdfProblem 6. Bag 1 has 2 red chips and 4 white chips. Bag 2 has 3 red .pdf
Problem 6. Bag 1 has 2 red chips and 4 white chips. Bag 2 has 3 red .pdf
ajantaopt
 
Problem 12-9AODGERS INC.Comparative Balance Sheets December 31.pdf
Problem 12-9AODGERS INC.Comparative Balance Sheets December 31.pdfProblem 12-9AODGERS INC.Comparative Balance Sheets December 31.pdf
Problem 12-9AODGERS INC.Comparative Balance Sheets December 31.pdf
ajantaopt
 
Problem 11-2A Fechter Corporation had the following stockholders’ eq.pdf
Problem 11-2A Fechter Corporation had the following stockholders’ eq.pdfProblem 11-2A Fechter Corporation had the following stockholders’ eq.pdf
Problem 11-2A Fechter Corporation had the following stockholders’ eq.pdf
ajantaopt
 

Mehr von ajantaopt (9)

Problem 11-2Athe following are selected transactions of Blanco Com.pdf
Problem 11-2Athe following are selected transactions of Blanco Com.pdfProblem 11-2Athe following are selected transactions of Blanco Com.pdf
Problem 11-2Athe following are selected transactions of Blanco Com.pdf
 
Problem 1.27 ,a,b,f from Chapter 1 in the text book Signals and S.pdf
Problem 1.27 ,a,b,f from Chapter 1 in the text book  Signals and S.pdfProblem 1.27 ,a,b,f from Chapter 1 in the text book  Signals and S.pdf
Problem 1.27 ,a,b,f from Chapter 1 in the text book Signals and S.pdf
 
Problem 11 in Chapter 15 examined the TV-viewing habits of adopted .pdf
Problem 11 in Chapter 15 examined the TV-viewing  habits of adopted .pdfProblem 11 in Chapter 15 examined the TV-viewing  habits of adopted .pdf
Problem 11 in Chapter 15 examined the TV-viewing habits of adopted .pdf
 
Problem httpi.imgur.comLFdvjnJ.jpg1SolutionAssumtions of.pdf
Problem httpi.imgur.comLFdvjnJ.jpg1SolutionAssumtions of.pdfProblem httpi.imgur.comLFdvjnJ.jpg1SolutionAssumtions of.pdf
Problem httpi.imgur.comLFdvjnJ.jpg1SolutionAssumtions of.pdf
 
Problem 8-9A certain investment requires an initial outlay of $12 .pdf
Problem 8-9A certain investment requires an initial outlay of $12 .pdfProblem 8-9A certain investment requires an initial outlay of $12 .pdf
Problem 8-9A certain investment requires an initial outlay of $12 .pdf
 
Problem 6. Bag 1 has 2 red chips and 4 white chips. Bag 2 has 3 red .pdf
Problem 6. Bag 1 has 2 red chips and 4 white chips. Bag 2 has 3 red .pdfProblem 6. Bag 1 has 2 red chips and 4 white chips. Bag 2 has 3 red .pdf
Problem 6. Bag 1 has 2 red chips and 4 white chips. Bag 2 has 3 red .pdf
 
Problem 5At a constant interest rate of 15, compounded annually, .pdf
Problem 5At a constant interest rate of 15, compounded annually, .pdfProblem 5At a constant interest rate of 15, compounded annually, .pdf
Problem 5At a constant interest rate of 15, compounded annually, .pdf
 
Problem 12-9AODGERS INC.Comparative Balance Sheets December 31.pdf
Problem 12-9AODGERS INC.Comparative Balance Sheets December 31.pdfProblem 12-9AODGERS INC.Comparative Balance Sheets December 31.pdf
Problem 12-9AODGERS INC.Comparative Balance Sheets December 31.pdf
 
Problem 11-2A Fechter Corporation had the following stockholders’ eq.pdf
Problem 11-2A Fechter Corporation had the following stockholders’ eq.pdfProblem 11-2A Fechter Corporation had the following stockholders’ eq.pdf
Problem 11-2A Fechter Corporation had the following stockholders’ eq.pdf
 

Kürzlich hochgeladen

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 

Kürzlich hochgeladen (20)

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 

Problem Description and AnalysisIn this Laboratory, you will desig.pdf

  • 1. Problem Description and Analysis In this Laboratory, you will design and simulate a simple ALU in Quatrus II Verilog. The description and specification of the ALU is given below: An ALU is a logic circuit that performs various Boolean and arithmetic operations on n-bit operands. This ALU has 2 four-bit data inputs, A and B, a three-bit select input, S, and a four-bit output, F. The functionality of this simple ALU is specified in the table below. Operation Inputs S Outputs F s2 s1 s0 f3 f2 f1 f0 Clear 0 0 0 0 0 0 0 B - A 0 0 1 B – A A – B 0 1
  • 2. 0 A – B ADD 0 1 1 A + B XOR 1 0 0 A XOR B OR 1 1 0 A OR B AND 1 1 0 A AND B Preset 1 1 1 1 1 1 1 Table 1 – Functionality Table for ALU Operation Inputs S Outputs F
  • 3. s2 s1 s0 f3 f2 f1 f0 Clear 0 0 0 0 0 0 0 B - A 0 0 1 B – A A – B 0 1 0 A – B ADD 0 1 1 A + B XOR 1 0 0 A XOR B OR
  • 4. 1 1 0 A OR B AND 1 1 0 A AND B Preset 1 1 1 1 1 1 1 Solution module alu(s, A, B, F); input [2:0] S; input [3:0] A, B; output reg [3:0] F; always @(S, A, B) case (S) 0: F = 0000; 1: F = B - A; 2: F = A - B; 3: F = A + B; 4: F = A ^ B; 5: F = A | B; 6: F = A & B; 7: F = 1111; endcase endmodule