SlideShare une entreprise Scribd logo
1  sur  4
Télécharger pour lire hors ligne
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

Contenu connexe

Similaire à 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
 
Sequential and combinational alu
Sequential and combinational alu Sequential and combinational alu
Sequential and combinational alu
Piyush Rochwani
 
08 chapter03 06_status_bits_otl_otu_scan_logic_fa16
08 chapter03 06_status_bits_otl_otu_scan_logic_fa1608 chapter03 06_status_bits_otl_otu_scan_logic_fa16
08 chapter03 06_status_bits_otl_otu_scan_logic_fa16
John Todora
 

Similaire à 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
 
Digital logic mohammed salim ch3
Digital logic mohammed salim ch3Digital logic mohammed salim ch3
Digital logic mohammed salim ch3
 
- 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
 
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
 
Logic gatesrevised.ppt
Logic gatesrevised.pptLogic gatesrevised.ppt
Logic gatesrevised.ppt
 
Sequential and combinational alu
Sequential and combinational alu Sequential and combinational alu
Sequential and combinational alu
 
PDT DC015 Chapter 2 Computer System 2017/2018 (f)
PDT DC015 Chapter 2 Computer System 2017/2018 (f)PDT DC015 Chapter 2 Computer System 2017/2018 (f)
PDT DC015 Chapter 2 Computer System 2017/2018 (f)
 
Top schools in faridabad
Top schools in faridabadTop schools in faridabad
Top schools in faridabad
 
08 chapter03 06_status_bits_otl_otu_scan_logic_fa16
08 chapter03 06_status_bits_otl_otu_scan_logic_fa1608 chapter03 06_status_bits_otl_otu_scan_logic_fa16
08 chapter03 06_status_bits_otl_otu_scan_logic_fa16
 

Plus de 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
 

Plus de 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
 

Dernier

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Dernier (20)

Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
latest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answerslatest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answers
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health Education
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.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
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.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